Edit style to add tags to printed bibliography
Help! I need to attach tags to records in the bibliography for a grant application. Can anyone explain how I can edit the style (I don't think that the specific style matters but just in case, I'm using ASA) to add the tags associated with a reference at the end of the record? The example below shows how I'd like it to look for a reference that has 2 tags (T Theme #1 and Theme #2). Records could have up to 3 tags (though most will be only 1 or 2).
Bae, Youngjoon. 2024. “Younger Older Americans and Sarcopenic Obesity: The Moderating Role of Living Alone.” The Journals of Gerontology. Series B, Psychological Sciences and Social Sciences 79(9):gbae117. doi: 10.1093/geronb/gbae117. Theme #1, Theme #2.
Bae, Youngjoon. 2024. “Younger Older Americans and Sarcopenic Obesity: The Moderating Role of Living Alone.” The Journals of Gerontology. Series B, Psychological Sciences and Social Sciences 79(9):gbae117. doi: 10.1093/geronb/gbae117. Theme #1, Theme #2.
You can do something like
Keyword: Theme #1, Theme #2
in the Extra field and then modify the ASA style to include those keywords (if that's an option, we can tell you how exactly), but you'd fist have to get the keywords into the Extra field, which might take longer than just modifying the bibliography by hand?
Yes, I would very much appreciate your tell me how to output the Extra field.
In the ASA style, as row 334, right after
<text prefix=". " macro="access"/>
add<text prefix=". " variable="keyword"/>
That will just put "Theme #1, Theme #2" at the end of the citation, preceded by a period and a space. If you want it to say "Research Theme: Theme #1, Theme #2"
change that to
<text prefix=". Research Theme: " variable="keyword"/>
you get the idea.
General instructions are here: https://www.zotero.org/support/dev/citation_styles/style_editing_step-by-step
Don't forget to change your modified style's title and id as described there.
One last question: If I want to put a period at the end of the keywords, how would I do that?
For the period, you'd add a suffix like so:
<text prefix=". Research Theme: " variable="keyword" suffix="."/>
https://www.zotero.org/support/dev/client_coding/javascript_api#batch_editing
For python, you'd use pyzotero https://pyzotero.readthedocs.io/en/latest/
which just announced that it has added support for the local API Zotero exposes in Z7