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.
  • sorry, tags are not available to citation styles, so this can't easily be done.

    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?
  • Thanks for your quick reply. Does the word have to be "Keyword" in the Extra field? It would work better for us for it to be "Research Theme". (But if it has to be Keyword, we could change it in Word after export.)

    Yes, I would very much appreciate your tell me how to output the Extra field.
  • Yes, it has to be "Keyword:" but the label is not going to be part of the citation.

    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.
  • This works - thank you so much! I agree that it'll take a lot of work to get the tags into the Extra field, but I think that it'll be worth it (and less work than doing it manually after the fact).

    One last question: If I want to put a period at the end of the keywords, how would I do that?
  • (If you have access to a developer or know a bit of python or javascript, moving tags to Extra can be automated; but it does requires a brief script)

    For the period, you'd add a suffix like so:

    <text prefix=". Research Theme: " variable="keyword" suffix="."/>
  • Thank you, thank you! I'm truly impressed with your quick and super helpful responses!!
  • Oh, I missed your comment about access to a developer and knowing python or javascript. I don't know python or javascript (sadly) but will explore whether someone at my research center might be able to help me. It would be amazing to be able to automate the task (especially since the grant is due soon :)
  • ...and there are over a 1000 publications in our bibliography! :)
  • For javascript you'd use this:
    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
  • Thank you - you're awesome!
  • @damnation you might have that repository set to private? It certainly doesn't show up on your account.
  • Ah, thanks! That's public now. :)
Sign In or Register to comment.