PDF Bibliography Double Spaced? #11797
|
After updating to the latest version of Pandoc, the bibliography in my PDF output started having spaces between entries, even though the main text has no space between paragraphs. I didn't experience this issue prior to updating. I will appreciate your help! Command line: |
Replies: 2 comments 5 replies
|
Try to not use your custom pandoc data dir with a small test doc, if I do that I don't see double spacing in latex output:
If so probably you are using a custom template and you have not updated your template with the latest default LaTeX template changes, the current template is comprised of a few files, the CSL bit I think is here: https://github.com/jgm/pandoc-templates/blob/master/common.latex#L149 Instead of outputting to PDF, output to LaTeX and you will then be able to examp=ine if your LaTeX code looks similar to the expected template markup. |
|
Do not change this: \newenvironment{CSLReferences}[2]The I can reproduce the actual version change with the same Markdown/BibTeX input: The second value is the inter-entry spacing, in multiples of For a durable fix, copy Pandoc's current default style and change only that setting: pandoc --print-default-data-file default.csl > no-bib-gap.cslIn <bibliography ... entry-spacing="0">Then add the style to your existing command: pandoc ***.md -s -o ***.pdf \
--data-dir=/Users/***/Documents/Pandoc \
--pdf-engine=xelatex \
--resource-path=/Users/***/Documents/Pandoc \
-C --bibliography=library.bib \
--csl=no-bib-gap.csl -NThis preserves the current Chicago 18 citation formatting and changes only the bibliography entry gap. It also works independently of your custom Pandoc data directory. You can verify the result before making the PDF: pandoc ***.md -s -t latex \
-C --bibliography=library.bib \
--csl=no-bib-gap.csl > check.tex
grep 'begin{CSLReferences}' check.texThe output should contain: \begin{CSLReferences}{1}{0}So the existing reply correctly identified the |

Do not change this:
\newenvironment{CSLReferences}[2]The
[2]means “this environment takes two arguments”; it is not the spacing. Changing it to[0.75]would make the LaTeX definition invalid while the body still refers to#1and#2.I can reproduce the actual version change with the same Markdown/BibTeX input:
The second value is the inter-entry spacing, in multiples of
\baselineskip. The change began in Pandoc 3.8, when its bundled default CSL was updated from Chicago 17th to 18th edition. The old style explicitly hadentry-spacing="0"; the current one omits the attribute, and the CSL default…