Sort multi citations (in text)

Multi citations sort parameter does not work.

When I do multiple citations, I want them to be sorted according to the publication date, e.g. (Dudley & Schmitt, 1996; Williams, 1997; Hoverman & Relyea, 2008).

For this, a sort parameter is present, (which in APA, the style I base all my biological journal styles upon, looks like follows:

<sort>
<key macro="author"/>
<key variable="issued"/>
</sort>

a similar is present in the bibliography.

In order to change the sorting from issued, I changed the lines to:

<sort>
<key macro="issued"/>
<key variable="author"/>
</sort>

in the citation, which didnt had any effect. However, when I changed the lines in the bibliography, the bibliography AND the multi-citation was now sorted according to the year issued. Therefore, my interpretation is as follows: it is possible to sort multi citations based on issued year, however, the multi citation sorting does not work as it is ignored (not just overrided, even if I delete the sort field in the bibliography the sort field in citation does not work).

If someone help me out with this problem I can submit a large number of biological journal styles to zotero. However, as all biological journals I am aware of sort multi citations based on issued year and the bibliography based on author name, this "bug" or programming problem makes all my styles containing an irritating error.

A solution is very much appretiated!
«1
  • I also ran into this problem a while ago but I never got any feedback (here). It's frustrating because this one, apparently minor, glitch is really the only thing keeping me from using Zotero to it's full potential.
  • This looks indeed like a bug and should be fixed.

    But, OTOH, there's no reason you can't manually sort the citations. I know it's not ideal, but I don't think it's a deal breaker, and I don't think it should stop you from submitting the styles. Indeed, if more people use the (correctly coded) styles and come across this bug, the more likely they'll complain about it, and the more likely it'll get fixed (since the Zotero devs have to prioritize among a host of competing requests).
  • It isn't a deal-breaker for using Zotero itself, more the Word plugin since the multi-citations get re-sorted when the bibliography is updated. At least that was the case with 1.03. I haven't checked with 1.04 yet.
  • You can turn off citation sorting. I forget the details, but poke around a bit and you'll find it.
  • Have this been fixed yet?
  • As far as I can tell, this has been partly fixed.

    If I have:

    <sort>
    <key variable="author"/>
    </sort>

    inside the bibliography tag, and

    <sort>
    <key variable="issued"/>
    </sort>

    inside the citation tag, everything works as desired, except that only new citations get sorted by date. Old citations don't update, which seems odd since other changes such as changing the et-al-min option update existing citations. This seems like a remaining bug in the plugin, at least for OpenOffice which I am using.



    This is very important since all biological journals sort citations by year and bibliography by author name.
  • Will this be fixed in the new CSL?

    rgerkins example above isn't working for me...

    The citation just sorts by author,
    even with <sort>
    <key variable="issued"/>
    </sort>

    in the citation section.

    Am I missing something?
  • Does this citation sorting issue need a ticket?
    I can't work out whether it's a CSL bug or a Zotero one (or both?!).

    It seems that automatic sorting of citations doesn't work - it's overriden by the bibliography sorting.
    A workaround is possible in the word plug in by de-selecting the "Keep Sources Sorted" box and adding in the required order.

    This is the only substantive thing preventing many of my styles from being perfect!
  • I also can't get that snippet of code to work. I'm trying to use APA, and no matter what I do with the <sort> </sort> field, it doesn't have any effect.

    Has somebody gotten this to work?
  • I can't sort multi-citations either. Really annoying. References need to be sorted by author (this works) and the multi-citations need to be sorted by date (doesn't work).
  • I've looked at the issue and submitted two patches to the dev group to fix this issue. In case anyone cares to patch their version only two lines of code are needed. The problem discussed here is a combination of the date generally not working as a sort key and multiple source sorting having a bug.

    The date not working for sorting is addressed here:
    http://groups.google.com/group/zotero-dev/browse_thread/thread/f1e9dc4484b915a2#

    The sorting of multiple sources not working is addressed here:
    http://groups.google.com/group/zotero-dev/browse_thread/thread/64fde1acaca8f8aa#
  • I would love(!) to apply this patch for a report I'm submitting next week (60+ papers all sorted in weird ways because most start with the same author). However, I can't find a "csl.js" file anywhere on my hard disk. Am I missing something obvious?

    Thanks!
  • uhm - this may be a bit daunting, depending on how comfortable you are with your computer. Whatever you do, keep backup copies of everything!

    http://forums.zotero.org/discussion/8784/howto-enable-additional-tinymce-note-editor-functionality/
    describes the general process of patching code in Zotero.
    csl.js is in the /content/zotero/xpcom folder of the Zotero.jar
  • Thanks for the pointer. I'll figure it out.

    Rob
  • edited November 7, 2009
    Hello,

    I can't find csl.js in the /content/zotero/xpcom folder of the Zotero.jar
    I'm using Zotero 1.0.10, WinXP, FF 3.5.5.

    Do you know why? It seems a very useful file to find a list of types (which are not on the wiki)
    Thanks!
  • I don't know where the csl.js is for the 1.0 version
    In 2.0 you can see it by pasting
    chrome://zotero/content/xpcom/csl.js
    into the URL bar, but I doubt that will work in 1.0
    You're right, the types should probably be in the wiki, I'll take a look.
  • Hello,
    I would like to apply the patches too but like Gracile I can't find the csl.js anywhere in the zotero.jar. I'm using Zotero 1.0.10, WinXP.
    Could anyone tell us how to apply the patch on Zotero 1.0.10?

    Thanks,

    PS: I'd like to use Zotero 2 but I get errors when I want to update it my word document from Zotero 1 to Zotero 2.
  • edited November 7, 2009
    I don't know how well this will work in 1.0 - it's possible that the csl processor is part of the zotero code in 1.0 - it has become a lot easier, e.g., to manage translators in 2.0 and I can see this being similar with the csl processor.
    Have you tried posting about your upgrade problem? Most people's issues have been resolved successfully with some help here.

    Edit: And let me caution against patching code unless you either really know what you're doing or are adventurous and willing to potentially spend some time figuring things out (with backups there isn't much that can happen, but it's a learning experience, as such it may take some time and patience). Most people will likely be better of waiting for this to get fixed in an upcoming release.
  • Thanks for the quick reply. I have some experience with coding and I like to play around so no worries about that :).
    I'll post my upgrade problem in http://forums.zotero.org/discussion/8703/3/ms-word-plugin-document-update-problem/

    Thanks.
  • edited November 7, 2009
    Please don't. Start a new thread.
  • OK, I've applied the update to fix these two bugs with no problem, and verified in the chrome: window that the new code is present. However, it doesn't change the behavior of my bug at all. From the Zotero test window:

    Aaltonen, T. et al. 2008, Phys. Rev. Lett., 100, 161803
    Aaltonen, T. et al. 2009, Phys. Rev. Lett., 103, 092002
    Aaltonen, T. et al. 2008, preprint (hep-ex/0811.1062)
    Aaltonen, T. et al. 2009a, preprint (hep-ex/0910.0969)

    Is there something weird with the handling of authors in sorts like there was with dates? Each of these papers has a LOT of authors (hundreds), but is being reduced to "et al", as desired. I want the papers sorted by author with the "et al", not the original full list.

    My style says:

    <sort>
    <key macro="author"/>
    <key variable="issued"/>
    </sort>

    and

    <macro name="author">
    <choose>
    <if type="webpage">
    <text variable="note" suffix=": "/>
    </if>
    <else>
    <names variable="author">
    <name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with=". "
    delimiter-precedes-last="always" delimiter=", "/>
    <substitute>
    <text macro="anon"/>
    </substitute>
    </names>
    </else>
    </choose>
    </macro>
  • I think this might be more complicated in this particular case - could it be that Zotero is correctly sorting by the second author?
    Note that the author macro does not include the et al directions - those are in the bibliography - so I'd expect Zotero to move to the second author if the first one is identical.
    Unfortunately, if I'm right, there is no way to fix this in the current csl.
    My understanding is that 1.0 will have a possibility to extract the first author - that would work then.
  • I think it's more likely the authors differ in #200 or #300. The first 10 are the same. I was afraid this was going to be the problem. I'll just have to change the entries to delete most of the authors and make sure the rest are identical.

    The problem here is that if I have two entries:

    A, B, C, D, E, F 2009
    A, B, C, D, E, G 2009

    and the style makes them come out as:

    A et al 2009
    A et al 2009

    then the citations will be ambiguous. They need to have the "a" and "b" on them if they are going to be put in the citation in an ambiguous fashion. This is a much bigger issue than just looking at the first author. We need to look at the printed format in the bibliography or citation and see what is going to be ambiguous.
  • edited November 8, 2009
    I believe that's being addressed in csl 1.0
    Zotero does have a disambiguate by adding names function already -
    <option name="disambiguate-add-names" value="true"/>
    this will add names before the et al until the citation is disambiguated.
  • Thanks. I look forward to the next version, but it's not going to help my paper due in 5 days, unfortunately. I'll have to fake it.

    I know about that feature of Zotero, but it's the wrong thing for this style. If there are more than 8 authors, it must say one author and then "et al" and they must be disambiguated using letters after the year. Not to mention that a bibliography entry with 200-300 names with the 301st name different isn't going to look very nice anyway.

    The style I'm writing is for the Astrophysical Journal (ApJ).
  • adamsmith,

    I've added a list of item types and their mapping in the wiki (csl syntax summary). I hope I'm not totally mistaken: could you check quickly please? Thanks!
  • looks good in general - though you used (or at least link to) the future csl version (1.0) not the current one (0.8), which has the mappings within Zotero here:
    chrome://zotero/content/xpcom/csl.js
  • I've actually used the one I've found ;-) ... because, as I said in my previous post, I'm using zotero 1.0 and csl.js is unavailable for me.
  • sorry, forgot about that - different 1.0 there, unfortunately (i.e. csl vs. Zotero) - but at first glance this looks like it hasn't changed (so far).
  • Reference sorting still appears to be broken in Zotero 2.0b7.5.

    This seems like one of the most basic things a citation manager ought to get right. It used to work. Then it broke and and has been broken for a long time.

    What level of priority is being assigned to fixing this issue?
Sign In or Register to comment.