Replies: 5 comments 1 reply
-
|
One approach is to use For a very similar issue, see #11279 I am also picky about this sort of thing, so it would be good to solve it. |
Beta Was this translation helpful? Give feedback.
-
|
Another workaround you could try: |
Beta Was this translation helpful? Give feedback.
-
|
Here's a bit from typical CSL file, apa.csl: <macro name="citation-locator">
<!-- Abbreviate page and paragraph, leave other locator labels in long form, cf. Rule 8.13 -->
<group delimiter=" ">
<choose>
<if locator="page paragraph" match="any">
<label variable="locator" form="short"/>
</if>
<else>
<label variable="locator" text-case="capitalize-first"/>
</else>
</choose>
<text variable="locator"/>
</group>
</macro>Here you have the "label" ("sec.") and the the locator (the number). Where does the space come from? it comes from the delimiter, which is specified on the group element as |
Beta Was this translation helpful? Give feedback.
-
|
Another approach that may work is adding a zero-width joiner to the end of each label (section, volume, etc.) in |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for your quick replies! I have I do like the idea of changing the CSL file to use a different delimiter, such as a non-breaking space, as I wouldn't want the line broken there in any output format anyway. I'll try implementing that soon. Still, it doesn't feel like a complete solution, depending on the use-case. Half the point of using pandoc markdown and CSL references is to make it really easy to switch output formats and citation styles. I'm not going manually edit every CSL file of the ~10,000 in their repo. Similarly, I'd prefer not to put things into the document that would make it incompatible with changing to a different style with different abbreviations, or to use solutions only compatible with xelatex/lualatex instead of pdflatex. Still, a partial workaround is better than nothing! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Consider the following minimal document:
Compile with this command (using the pdflatex engine), using the default CSL file, or any other that converts "§" to "sec.".
In the output, you'll see that the first line is ever so slightly longer than the second, because there is more space between "sec." and "6.54" in the first. LaTeX by default puts more space between sentences, and is wrongly treating the period in "sec." as if it ended a sentence.
This happens with most abbreviations CSL uses, not just sec. but ch. (for chapters), pp. (if enabled in the style, etc.)
I can't for the life of me figure out how to prevent this. None of these work, i.e., they all still yield the extra space:
[@tlp, sec. 6.54][@tlp, sec.\ 6.54][@tlp, sec. 6.54](Unicode non-breaking space U+00A0)Is there a way to prevent this? Should there be? I realize citeproc is a general tool, not specifically aimed at LaTeX-based output, but since pandoc's PDF conversions do use LaTeX by default, this is a constant annoyance. (Though I admit I'm fussier than most.)
I'm using pandoc 3.8.3 on archlinux if that matters.
Beta Was this translation helpful? Give feedback.
All reactions