Adding elements to Export Style? Please help!

Hi Everybody,

I've read through the CSL editor help page, and I've tried the trial and error approach, both with no luck. So I am hoping somebody with real expertise can point me in the right direction.

I am trying to modify the Antiquity style so that my bibliographic output includes the text from three fields at the end of each entry (URL; Accessed; Archive).

So, for example, I'd like the following entry, when output as party of my bibliography to change from what it is currently:

HOMER. & I.J.F. DE JONG. 2002. A Narratological Commentary on the Odyssey. Cambridge: Cambridge University Press.

to the following [sans brackets]:

HOMER. & I.J.F. DE JONG. 2002. A Narratological Commentary on the Odyssey. Cambridge: Cambridge University Press. [URL]. [Accessed]. [Archive].

This will allow me to enter my own customized data into those fields, which I am not using, for the construction of an annotated bibliography for my students.

Many thanks in advance for help with what I had assumed would be an easy tweak, but which has defeated me so far!

Best,
Rob
  • Is this a requirement for the journal (or another journal) or just your personal preference? If the former, we can just update the style.
  • This is just an addition that I would like to use personally, so certainly not a requirement for the journal.

    I understand that I should be able to tweak that style and save it in such a way that I can access the tweaked version.
  • Here you go:
    https://gist.github.com/bwiernik/8e0dca577d7ebf4c9fd6a77a9445f0d6

    (The official style prints the Archive, Accessed, and URL [in that order] for some items. I used that order here. Also, if the item has a DOI, PMCID, or PMID [which can be used to make persistent, never changing links], I don't have it printing the accessed date [as it is unnecessary]).
  • Thanks for your help on this!

    A couple of issues.

    It looks like I cannot use the URL field at all (I assume it requires a particular syntax), at least for the kind of data I would like to include.

    Would it therefore be possible to have the data from a different field or two included (perhaps the Rights or Extra fields would work?) instead. The order is not important as I can adjust once I know how it works.

    Finally, would it be possible for you to point me in the direction of what exactly you did here so that I could learn myself and not have to pester you or others in the future?

    Many, many thanks!
    Rob
  • edited October 20, 2017
    You mean the item type in Zotero doesn't have a URL field? Which type is that?

    You can add a URL to any item using the Extra field like this:
    URL: https://example.com

    To edit the style, I edited the "access" macro to remove most of the conditions ("if" statements) testing for different item types that decided whether to show Archive, URL, Accessed, etc. (Basically, I looked at the style to see if it was already using the variables you wanted for some item types, saw that it was, then just removed those conditional tests.) You can use the CSL visual editor to edit styles: http://editor.citationstyles.org/visualEditor/

    A basic description of editing the code for CSL styles is here:
    https://www.zotero.org/support/dev/citation_styles/style_editing_step-by-step

    Feel free to post on these forums if you have specific questions about how to accomplish things with the CSL language.
Sign In or Register to comment.