APA subtitle capitalization with a CSL JSON bibliography #10588
Replies: 7 comments 3 replies
-
CSL does not support that: you can either write a Lua filter or edit your database.
|
Beta Was this translation helpful? Give feedback.
-
Can't you just capitalize 'The' in the title you enter in Zotero? |
Beta Was this translation helpful? Give feedback.
-
I had followed Zotero's instructions to enter the titles in lowercase, since "Zotero will automatically capitalize the subtitle for styles that require it" (from the link in my original post), and Zotero does that if I create the APA bibliography straight from it (e.g. RTF). I wasn't aware that once it's converted to CSL (via Better BibTeX), it's no longer possible to get the APA capital subtitle in Pandoc, unless I do a Lua filter like suggested by @badumont.
Unfortunately, some of the features Zotero provides are absent from the CSL specification (which it is supposed to implement), although they are recommendable ones. There is not even a concept of subtitle in the CSL specification (https://docs.citationstyles.org/en/v1.0.2/specification.html)!
Instead of using a Lua filter, which would require to parse the formatted bibliography produced by Pandoc, you could process your bibliography with Javascript directly in Zotero. It may be worth for 300+ items. Here is the documentation: https://www.zotero.org/support/dev/client_coding/javascript_api
|
Beta Was this translation helpful? Give feedback.
-
Another option might be to use jq |
Beta Was this translation helpful? Give feedback.
-
Also, Zotero BBT supports postprocessing with postscripts. https://retorque.re/zotero-better-bibtex/exporting/scripting/index.html |
Beta Was this translation helpful? Give feedback.
-
Thank you everyone for your suggestions! In sum, the options include:
Currently the BBT postscript (or perhaps jq) seems like the choice I'm going to investigate further. |
Beta Was this translation helpful? Give feedback.
-
By exporting as BibTeX/BibLaTeX instead of CSL JSON in Better BibTeX for Zotero, you can avoid the APA subtitle capitalization issue. Considering the following example: @book{albertus2015,
title = {Autocracy and redistribution: the politics of land reform},
shorttitle = {Autocracy and redistribution},
author = {Albertus, Michael},
date = {2015},
publisher = {Cambridge University Press},
location = {New York},
doi = {10.1017/CBO9781316227107}
} Copying the BibLaTeX entry above and then run the command (macOS): pbpaste | pandoc -f biblatex -t csljson The output is: [
{
"DOI": "10.1017/CBO9781316227107",
"author": [
{
"family": "Albertus",
"given": "Michael"
}
],
"id": "albertus2015",
"issued": {
"date-parts": [
[
2015
]
]
},
"publisher": "Cambridge University Press",
"publisher-place": "New York",
"title": "Autocracy and redistribution: The politics of land reform",
"title-short": "Autocracy and redistribution",
"type": "book"
}
] You can see it converts |
Beta Was this translation helpful? Give feedback.
-
I'm using Zotero 7.0.11 + Better BibTeX 7.05 to create a CSL JSON bibliography that I use with Pandoc 3.6.2 to generate PDFs with APA 7th ed citations and a bibliography. I have entered the titles into Zotero in sentence case, separating the title and subtitle with a colon as recommended in Zotero knowledge base. Everything works perfectly except the following tiny detail.
I'm using the APA style, where the subtitle is capitalized. For example, "Thinking in jazz: the infinite art of improvisation" should become "Thinking in jazz: The infinite art of improvisation". However, the subtitle is not capitalized and the output remains in the same format as I've entered it into Zotero (perhaps this is intentional?)
Is it possible to automatically capitalize the subtitle in the Pandoc process? Or should I edit my database?
Beta Was this translation helpful? Give feedback.
All reactions