sorting multiple references by same author year - special case

A situation has arisen that has me a bit perplexed.

In a document I have inserted a few references with the same author and year. These appear correctly, i.e., text.... (Smith 2011a) ... text ... (Smith 2011b), etc.

Later, I wish to cite them again but in a combined citation (Smith 2011a, 2011b). However, when doing the multiple citation selection, if I select the 2011b citation before I select the 2011a citation (e.g., because the title of the 2011b reference begins with 'A' whereas the title of the 2011a citation begins with 'S', the resultant combined citation appears as (Smith 2011b, 2011a).

I know that it is the 'disambiguate add-year-suffix' command that adds the 'a', 'b', etc. but is there a way to then sort the result so that I don't have to use 'edit citation' to reorder the way they are added?

Thanks.
  • In principle this can be done - Zotero has an option to automatically order in-text citations, including by title. However, most style only sort by author and year, so this won't work in most existing styles. But to give you an idea how you can make it work quite easily, have a look at the APA style.
    First, you need to make sure that the year suffix is added systematically in the bibliography - i.e. you need to add sorting by title as a sort criterion.
    In the bibliography section, find
    <sort>
    <key macro="author"/>
    <key macro="issued-year" sort="ascending"/>
    </sort>
    and add a line for title at the end:

    <sort>
    <key macro="author"/>
    <key macro="issued-year" sort="ascending"/>
    <key macro="title"/>
    </sort>

    This means that Smith 2001a will be the title earlier in the alphabet.

    Now you do the same thing for the citation, i.e. in the citation section find
    <sort>
    <key macro="author"/>
    <key macro="issued-year"/>
    </sort>
    and change to
    <sort>
    <key macro="author"/>
    <key macro="issued-year"/>
    <key macro="title"/>
    </sort>
    Done.
    See here for general instructions:
    http://www.zotero.org/support/csl_simple_edits

    What isn't possible afaik is to have the item you cite first be labeled 2001a and then to automatically place that before 2001b in subsequent citations.
    I hope this is clear, if not feel free to ask.
  • "What isn't possible afaik is to have the item you cite first be labeled 2001a and then to automatically place that before 2001b in subsequent citations."

    Too bad. That is exactly what I was wanting to do. I guess the only way to do that is to ensure that the 'keep items sorted' box is not ticked and select the multiple citations in the same order they were initially entered (as determined by looking at the bibliography). It would be a nice feature to allow one to move individual citations up or down in the box where they are shown as selected. This would allow for 'on-the-fly' adjustments.
  • Moving items around is planned - isn't it already in the plugins for the 2.1b release? I keep forgetting.

    One other thing to try - see if you can maybe sort by variable="citation-number" - I have never seen that outside of a numerical style, but it might still work and would capture which item is cited first (i.e. in my instructions above, substitute <key variable="citation-number"/> for <key macro="title"/> )This is just a try, though - I have no idea if it will work and no time to play around. But let us know if you try and it does work.
  • Don't know if it is in the 2.1b plugins.

    Tried your suggestion re <key variable="citation-number"/>. It worked for the references I tried. Very nice indeed!

    Thanks a bunch!
  • Further on this, while the <key variable="citation-number"/> suggestion resolved the particular issue so that when an item cited is first labeled 2001a it is then automatically placed before 2001b in subsequent citations, it does cause another problem in that if the first time items are cited and it is in a multiple (ie, a, b, c, ...) citation, the sort by title no longer exists. Therefore, when doing a multiple select, the 'keep items sorted' box must not be ticked and the multiple items added alphabetically.

    Overall though, I think this is easier than my original approach.
Sign In or Register to comment.