Macros in CSL Basics

I've looked everywhere to figure out how to trigger the macros in APA 6, and to see if it's even possible. Can someone point me in the right direction so I can understand the basics of how the macros are initiated once the CSL style is installed. Thx. (Warning: I know enough to be dangerous, and to sling the jargon around like I might even know what I'm talking about.)
  • You may be misunderstanding what macros do. The concept of "triggering" and "initiating" a macro doesn't really make sense in the way you're asking about it.
    What are you trying to do in more concrete terms?
  • I checked out the CSL editor thinking I could make a modification by following the instructions. Instead I found a possible solution in this coding in APA 6:

    <macro name="issued-year">
    <choose>
    <if variable="issued">
    <group delimiter="/">
    <group>
    <date variable="issued">
    <date-part name="year"/>
    </date>
    <text variable="year-suffix"/>
    </group>
    <date variable="original-date" form="text"/>
    </group>
    </if>
    <else-if variable="status">
    <text variable="status"/>
    <text variable="year-suffix" prefix="-"/>
    </else-if>
    <else>
    <text term="no date" form="short"/>
    <text variable="year-suffix" prefix="-"/>
    </else>
    </choose>
    </macro>

    But now I'm thinking this may only apply to a certain kind of entry ... ?

    In the end, I need to have the in-text citation print so that the YEAR only is the result; I can then add punctuation.

    Appreciate any help pointing me in the right direction.
  • yes, you can just copy over that macro and the use
    <text macro="issued-year"/>
    in your style.
  • OK, so that's where I get lost ...
  • could you be a bit more specific? I'm trying to understand at what level you need help: are you trying something and it's not working or do you not understand something at a more general level. And if so, which part of my brief instructions above is unclear.
    You've seen this:
    https://www.zotero.org/support/dev/citation_styles/style_editing_step-by-step
    in addition to the visual editor?
  • Yes, I have seen the link above, and the visual editor. I see what I want, but I can't figure out how to get it into my stand-along Zotero styles. I'm 'saving as' a different name and I thought I had added it as a new style (or modification of an existing one ... ?) but I don't see the fields that are in the macro.

    Of your brief instructions above, I don't understand why, if I am saving the the style in visual editor and then adding it to my stand-alone Zotero, I don't see the relevant fields (for example "issued").

    Thanks for your patience while I work on figuring this danged thing out ... I'm switching from IEEE to APA 6 for a client whose doctoral thesis I am editing; there are tweaks I must make, so modifying the macro will help with the 300 +/- references.
  • So, when you say you don't see the fields in Zotero -- do you mean they're not in the citation output or the item in Zotero doesn't have the corresponding fields? Zotero items always look the same.
  • No corresponding field in Zotero. Depending on what type of publication, I have different fields available to enter the relevant data.
  • That's right. That's independent of the citation style. So what field are you missing? What's not working?
  • Thanks for your help, Adam. I'm going to leave the coding fix for another day ... it's easier to work around it for now.
Sign In or Register to comment.