Add a, b, c, etc. to citations/references according to in-text occurence, not reference order

edited August 20, 2024
HI, I have a few references from the same authors in the same year that get an a, b, etc. at the end. How do I modify the APA style such that the first cited reference gets the a, the second the b, etc? Currently they get the letters according to how they are sorted in the references section.
I found another thread that suggested removing the
<key macro="title"/>
line in the <sort> block, but it did not work for me.
Any suggestions?
Thanks a lot!
  • To be clear, it is correct APA style for the year suffixes to follow the bibliography sort order, not order of appearance in text.
  • But if you want to sort (incorrectly, as per APA) in order of appearance, adding
    <key variable="citation-number"/> before title in the sort section should work.
  • Yeah yeah sure it is correct but I want to modify it. I cannot get it to work. Maybe I misunderstand your message. This is how I have seit it up now:
    <citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-givenname="true" collapse="year" givenname-disambiguation-rule="primary-name-with-initials">
    <sort>
    <key macro="author-sort" names-min="3" names-use-first="1"/>
    <key macro="date-sort-group" sort="ascending"/>
    <key macro="date-sort" sort="ascending"/>
    <key variable="citation-number"/>
    <key macro="title"/>
    </sort>
  • In the bibliography, not the citation sort section
  • Thanks, but it still does not work and shows c and d in the text before a and b. I changed the code to:

    <bibliography hanging-indent="true" et-al-min="21" et-al-use-first="19" et-al-use-last="true" entry-spacing="0" line-spacing="2">
    <sort>
    <key macro="author-sort"/>
    <key macro="date-sort-group" sort="ascending"/>
    <key macro="date-sort" sort="ascending"/>
    <key variable="citation-number"/>
    <key macro="title"/>
    </sort>


    Is this what you meant?
  • edited August 26, 2024
    Hm, I cannot get it to work. I changed it to:
    <bibliography hanging-indent="true" et-al-min="21" et-al-use-first="19" et-al-use-last="true" entry-spacing="0" line-spacing="2">
    <sort>
    <key variable="citation-number"/>
    <key macro="author-sort"/>
    <key macro="date-sort-group" sort="ascending"/>
    <key macro="date-sort" sort="ascending"/>
    <key macro="title"/>
    </sort>

    which works in the text, as in the first cited reference with the same author list in the text is "a", the second "b", etc. But the order of the references section is messed up. There, I still want the alphabetical order.
    Any ideas how to make this work? I am surprised that this is not the standard. In economics at least, journals usually start with "a" in text and have alphabetically sorted reference sections. Fully aware that this is APA but other Zotero styles like Chicago and Harvard don't do this either...
  • The examples I’ve seen in American Economic Review sort the bibliography by order of appearance, for example https://scholarcommons.scu.edu/cgi/viewcontent.cgi?article=1117&amp;&amp;context=econ&amp;&amp;sei-redir=1&amp;referer=https%3A%2F%2Fscholar.google.com%2Fscholar%3Fhl%3Den%26as_sdt%3D0%252C10%26q%3DAmerican%2Beconomic%2Breview%2B%25E2%2580%259C2000a%25E2%2580%259D%26btnG%3D#search="American economic review “2000a”" or https://www.nber.org/system/files/working_papers/w14656/w14656.pdf


    Chicago style formats the same way as APA — with bibliography sorted alphabetically and letters assigned by order of bibliography (Rule 15.20).

    In general, assigning letters by in text order but sorting the bibliography alphabetically creates a confusing experience for readers because the letters appear in essentially a random order in the bibliography and you need to hunt through each entry to find the correct letter.

    I’ve never actually seen a published example of a journal or style requiring that formatting. Do you have links to any examples?
  • I think "alphabetical" refers to alphabetical by author, which obviously all author date styles do, but the last code snippet wouldn't (it'd sort like a numerical bibliography). I think we all agree that once you create a,b,c by order of appearance, they should appear in the same order in the bibliography .

    <bibliography hanging-indent="true" et-al-min="21" et-al-use-first="19" et-al-use-last="true" entry-spacing="0" line-spacing="2">
    <sort>
    <key macro="author-sort"/>
    <key macro="date-sort-group" sort="ascending"/>
    <key macro="date-sort" sort="ascending"/>
    <key variable="citation-number"/>
    <key macro="title"/>
    </sort>


    Should work for that, though. Can you replicate this not using a,b,c in order of appearance in a fresh document?
  • Thanks so much.The AER paper that bwiernik linked does exactly what I want (sorry maybe I was not clear before): Gordon "a" comes first in the text (before b and c) and in the bibliography too, but all other references are sorted alphabetically, Goldin before and Gramlich after Gordon.

    Adamsmith, using your code, does not do that. I still get c before a and b in the text:

    https://s3.amazonaws.com/zotero.org/images/forums/u5581225/14llzeq0p0vf01e6ftnk.png
  • Oh, but those are alphabetical by 2nd or 3rd author respectively. If you don't want that, you'd have to play with author mins in the sort keys
  • Something like


    <bibliography hanging-indent="true" et-al-min="21" et-al-use-first="19" et-al-use-last="true" entry-spacing="0" line-spacing="2">
    <sort>
    <key macro="author-sort" names-min="3" names-use-first="1"/>
    <key macro="date-sort-group" sort="ascending"/>
    <key macro="date-sort" sort="ascending"/>
    <key variable="citation-number"/>
    <key macro="author-sort"/>
    <key macro="title"/>
    </sort>
  • Hm, no. It starts with "d" in the text and the bibliography is wild:
    https://s3.amazonaws.com/zotero.org/images/forums/u5581225/v27argjgvvabdt4ikzfh.png

    I cannot find the AER style - just "Latin American Economic Review", but that one also does not work and starts with "c"...
  • Also need to add names-use-last="false"

    Edited style is available here:
    https://raw.githubusercontent.com/bwiernik/zotero-tools/master/apa-text-order-suffix.csl
  • Can this be done for Oxford Press HUMSOC as well? [recap: First in-text citation of one of three Brodeur et al (2024) papers should show (2024a) and the reference section should be sorted alphabetically by author.]

    I tried to copy paste the bib sort section from bwiernik's github (see above) but it does not work.

    <bibliography hanging-indent="true" et-al-min="21" et-al-use-first="19" et-al-use-last="true" entry-spacing="0" line-spacing="1">
    <sort>
    <key macro="author-sort" names-min="3" names-use-first="1" names-use-last="false"/>
    <key macro="date-sort-group" sort="ascending"/>
    <key macro="date-sort" sort="ascending"/>
    <key variable="status"/>
    <key variable="citation-number"/>
    <key macro="title"/>
    </sort>


    In-text citations start with Brodeur et al. (2024a), which is correct but the reference section is not in alphabetical order:
    https://s3.amazonaws.com/zotero.org/images/forums/u5581225/oqy02e3wffwccup38fk6.png

    When I change <key variable="status"/> to <key variable="author"/> the reference section is in alphabetical order but then the in-text citations start with Brodeur et al. (2024c) instead of (2024a).

    What can I do to fix that?

    Thanks a lot in advance!
  • a, b, c is always assigned by order of items in the bibliography, you can't change that, sorry.
    Is this actually a requirement somewhere because I find the idea of randomly sorting suffixes in the bibliography very odd (and hard to read).
  • Hm, above code for apa from bwiernik does what I want. It just does not work for Oxford Press HUMSOC when i copy paste the bibliography sort code or play around with it trying different things.

    The edited apa style does what I want:
    1) In-text: the first occurence of an in-text citation of one of the three Brodeur et al. (2024) papers is marked as "a", the second as "b", and the third as "c"
    2) the reference section is sorted alphabetically for all references (marked with the red arrow in the screenshot below), and
    3) the three Brodeur 2024 papers show up in the order a,b,c in the reference section (marked in yellow)

    https://s3.amazonaws.com/zotero.org/images/forums/u5581225/75ptdradltvzntfzbbze.png

    Now, when I use the Oxford Press HUMSOC one, I can get either the in-text citations to show up as in 1) or the reference section to be in alphabetical order but not both like for apa. If the in-text citations start with 2024a, then the reference section looks like this:

    https://s3.amazonaws.com/zotero.org/images/forums/u5581225/98e8y3iucm25eq6wb6xg.png
  • Oh, you mean alphabetical by first author, only. Yes that's doable. What's the exact sort section you are using?
  • Yes. This is the code I am using:

    <citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" givenname-disambiguation-rule="primary-name" collapse="year">
    <sort>
    <key macro="author"/>
    <key macro="issued-year"/>
    </sort>
    <layout prefix="(" suffix=")" delimiter="; ">
    <group delimiter=" ">
    <text macro="author-short"/>
    <text macro="issued-year"/>
    <text macro="citation-locator"/>
    </group>
    </layout>
    </citation>
    <bibliography hanging-indent="true" et-al-min="21" et-al-use-first="19" et-al-use-last="true" entry-spacing="0" line-spacing="1">
    <sort>
    <key macro="author-sort" names-min="3" names-use-first="1" names-use-last="false"/>
    <key macro="date-sort-group" sort="ascending"/>
    <key macro="date-sort" sort="ascending"/>
    <key variable="status"/>
    <key variable="citation-number"/>
    <key macro="title"/>
    </sort>
  • @adamsmith, any idea what to change? Thanks! :-)
Sign In or Register to comment.