andras-simonyi / citeproc-el

A CSL 1.0.2 Citation Processor for Emacs.
GNU General Public License v3.0
85 stars 9 forks source link

Fix subtitle captialization #81

Closed rudolf-adamkovic closed 2 years ago

rudolf-adamkovic commented 2 years ago

MWE with APA style:

Note: APA dictates to capitalize the subtitle in sentence case.

@Article{test,
  author       = {{Author}},
  title        = {title here},
  month        = {sep},
  year         = 2021,
  subtitle     = {subtitle here},
  journal      = {journal},
  pages        = 10,
  day          = 1,
}
\documentclass{article}
\addbibresource{test.bib}
\begin{document}
Per \textcite{test} \ldots
\printbibliography{}
\end{document}
$ pandoc test.tex --output=test.html --citeproc --csl=apa.csl --bibliography test.bib

Expected subtitle (as generated by pandoc): "Subtitle here"

<p>Per <span class="citation" data-cites="test">Author (2021)</span> …</p>
<div id="refs" class="references csl-bib-body hanging-indent" data-line-spacing="2" role="doc-bibliography">
<div id="ref-test" class="csl-entry" role="doc-biblioentry">
Author. (2021). Title here: Subtitle here. In <em>journal</em> (p. 10).
</div>
</div>

Actual subtitle (as generated by citeproc-el): "subtitle here"

andras-simonyi commented 2 years ago

This is again a question regarding proper bib(la)tex -> CSL conversion, i.e., whether the sentence-case recommended by CSL for title fields requires (the first word of) (sub)titles to be capitalized. I found a discussion here: https://discourse.citationstyles.org/t/sentence-case-variants/1221, but it doesn't seem to be conclusive. @denismaier, @bdarcus WDYT? should the first characters of titles be automatically upcased during the bib(la)tex -> CSL conversion? My instinct would be not to touch them, but Pandoc seems to be doing it during conversion. BTW, @salutis what is the use case here? Why not simply capitalize the subtitle in the entry if this is the required rendering?

Quintus commented 2 years ago

If I may give my entirely unqualified comment (we do not have title case in German): these title case conversion questions seem nasty enough to warrant a note in the documentation describing the behaviour, the effect of langid, and other possible influences. I would expect this to pop up quite often, so having it in the docs would ease things.

That requires coming to a conclusion here first obviously. I can’t comment on this question and will thus refrain from doing that further on. Just my 2 cent.

denismaier commented 2 years ago

I'd think that usually fields should start with a capital letter anyway. Also, I think bibtex and biblatex want titles in English to be entered in title case with proper names protected by {}. So, the convertion citeproc-el should be doing is "title case -> sentence case".

andras-simonyi commented 2 years ago

@salutis, @Quintus, @denismaier thanks for the input, I've pushed a commit (39e23b1c0ce1237ab503e67c7d736172a9062512) which upcases the first char of titles during conversion and hopefully fixes the issue.

rudolf-adamkovic commented 2 years ago

I have just upgraded citeproc.el and re-tested it against Pandoc. It works now! Thanks everyone. Closing.