diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2023-09-07 09:06:23 -0700 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2023-09-07 09:06:23 -0700 |
| commit | db9aa720373987a8b13ee3ffb62ea4f95c6c5ee0 (patch) | |
| tree | e98b2e77eae133a78b18418cf651bad52eebf0b9 /src/Text | |
| parent | 62732204497dc67a54497cd27b9e6005d2c3ff25 (diff) | |
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.
Diffstat (limited to 'src/Text')
| -rw-r--r-- | src/Text/Pandoc/Citeproc.hs | 2 | ||||
| -rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 4 |
2 files changed, 2 insertions, 4 deletions
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 |
