zepinglee / citeproc-lua

A Lua implementation of the Citation Style Language (CSL)
MIT License
62 stars 7 forks source link

cannot change line spacing in bibliography #59

Closed jpjoines closed 3 months ago

jpjoines commented 3 months ago

Describe the bug The "References" generated by \printbibliography are always double-spaced regardless of which options I use with package setspace. I need them to be single-spaced.

Additional information

To Reproduce

\documentclass[twoside]{article}

\usepackage{setspace}

\usepackage{citation-style-language}
  \cslsetup{style = apa}
  \addbibresource{mwe-bib-spacing.json}

\begin{document}
  First, citing a first paper \cite{forbes-1887-Bull.PeoriaSci.Assoc.}.  Then, citing a second paper \cite{cowles-1899-Bot.Gaz.}.  Finally, citing a third paper and final paper \cite{cooper-1913-BotanicalGazette}.  This paragraph is now long enough to see that it is single-spaced, but the bibliography below is double-spaced.

\singlespacing
\printbibliography

\end{document}

Contents of mwe-bib-spacing.json:

[
  {"id":"cooper-1913-BotanicalGazette","accessed":{"date-parts":[["2014",11,17]]},"author":[{"family":"Cooper","given":"William S."}],"citation-key":"cooper-1913-BotanicalGazette","container-title":"Botanical Gazette","container-title-short":"Botanical Gazette","ISSN":"0006-8071","issue":"3","issued":{"date-parts":[["1913",3,1]]},"page":"189-235","source":"JSTOR","title":"The climax forest of Isle Royale, Lake Superior, and its development. III","type":"article-journal","URL":"http://www.jstor.org/stable/2468507","volume":"55"},
  {"id":"cowles-1899-Bot.Gaz.","accessed":{"date-parts":[["2011",11,1]]},"author":[{"family":"Cowles","given":"Henry Chandler"}],"citation-key":"cowles-1899-Bot.Gaz.","container-title":"Botanical Gazette","ISSN":"0006-8071","issue":"2","issued":{"date-parts":[["1899",2,1]]},"note":"ArticleType: research-article / Full publication date: Feb., 1899 / Copyright © 1899 The University of Chicago Press","page":"95-117","source":"JSTOR","title":"The ecological relations of the vegetation on the sand dunes of Lake Michigan. Part I. Geographical relations of the dune floras.","type":"article-journal","URL":"http://www.jstor.org/stable/2465177","volume":"27"},
  {"id":"forbes-1887-Bull.PeoriaSci.Assoc.","author":[{"family":"Forbes","given":"Stephen A."}],"citation-key":"forbes-1887-Bull.PeoriaSci.Assoc.","container-title":"Bulletin of the Peoria Scientific Association","issued":{"date-parts":[["1887"]]},"page":"77-87","title":"The lake as a microcosm","type":"article-journal"}
]
zepinglee commented 3 months ago

Thanks for your feedback and I can reproduce that.

Unlike BibTeX or biblatex, the CSL has a configurable line-spacing option for the bibliography and it has higher priority than the format outside \printbibliography. line-spacing=2 is set in apa.csl and Thus \singlespacing here doesn't have effects. You can set the line spacing inside bibliography by \cslsetup {bib-font = \singlespacing} or \cslsetup {bib-font = \linespread{1}} without setspace package.

https://github.com/zepinglee/citeproc-lua/blob/4febfb5c6c228189619cfbb586ab6943d8a5b383/submodules/styles/apa.csl#L1820

jpjoines commented 3 months ago

Thank you so much for your help. I completely missed the bib-font option to cslsetup in the documentation.