From db9aa720373987a8b13ee3ffb62ea4f95c6c5ee0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 7 Sep 2023 09:06:23 -0700 Subject: Fix default citeproc entry-spacing. According to the CSL manual, the default entry spacing is 1. We were treating it as 0. T.P.Citeproc: always include an entry-spacing attribute in the Div if the bibliography element contains an entry-spacing attribute (previously we omitted it when it was 0). LaTeX writer: use entry spacing 1 if no entry-spacing attribute is present. Update tests. See #9058. --- src/Text/Pandoc/Citeproc.hs | 2 +- src/Text/Pandoc/Writers/LaTeX.hs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index 9b3e38b65..e38239763 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -87,7 +87,7 @@ processCitations (Pandoc meta bs) = do "csl-bib-body" : ["hanging-indent" | styleHangingIndent sopts] let refkvs = (case styleEntrySpacing sopts of - Just es | es > 0 -> (("entry-spacing",T.pack $ show es):) + Just es -> (("entry-spacing",T.pack $ show es):) _ -> id) . (case styleLineSpacing sopts of Just ls | ls > 1 -> (("line-spacing",T.pack $ show ls):) diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index dc726475a..937729c12 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -345,9 +345,7 @@ blockToLaTeX (Div (identifier,classes,kvs) bs) = do then "1" else "0") <> braces - (case lookup "entry-spacing" kvs of - Nothing -> "0" - Just s -> literal s)) + (maybe "1" literal (lookup "entry-spacing" kvs))) $$ inner $+$ "\\end{CSLReferences}" else blockListToLaTeX bs -- cgit v1.2.3