Sort multi citations (in text)

2»
  • There is a plan to replace the current CSL citation formatter, following the final release of Zotero 2.0. In the new formatting module (not yet deployed), this works correctly; it is likely that development manpower within Zotero proper is being directed to the 2.0 release, as a first priority. The problem should clear up when the new processor becomes available.
  • Are you serious? Following the release of Zotero 2.0?

    For anyone who's working in a field that requires an author-date citation format and who has more than one citation per author per year, Zotero has been utterly broken for months. I find it astonishing that fixing this bug isn't urgently prioritised, and I'm baffled by the patience that Zotero users have been showing towards a defect this basic and this crippling.

    Why does nuts and bolts functionality need to take a back seat to cool new features?
  • Partly because this issue is less widespread than you think. For some reason this only occurs in some cases, so it's actually not affecting all author-date users (by far).

    Some of this seems pretty straightforward to fix though and a patch has been posted by mglueck on the dev list - why hasn't that been implemented? (anark - for the time being you can do that manually by the way - the patches are linked to above).
  • edited November 25, 2009
    @anark,

    It's a big project with lots of moving parts.

    For my own part, some of the "cool new features" included in the new processor are "nuts and bolts functionality" for myself and my students in the field of comparative law -- specifically, footnote backreferencing, in-field formatting, multi-script sorting and cross-language citation output. Without these features, Zotero is "utterly broken" for me personally, and I am unable to use it in my own writing. To help shape the system to my own needs, my response has been to forego an academic publication this year, and instead draft the new processor, which now weighs in at a plumpish 6,283 lines of code. As you suggest, this fresh project has been a selfish priority in its way. Intentionally so.

    EDIT: (Dropping mis-directed rant concerning difficulties etc etc. See adamsmith's cross-references above for info on patches. Agree that it would be a nice thing to see these tested and merged.)
  • I took your word for it that that the patch was going to be in the next update, so I sat back and waited. I might patch it manually if I positively have to.
  • yep, that's what I expected and hoped for, but nothing I can do about it, either - "my word" isn't exactly the decisive instance here...
    Before you get too upset, just a quick reminder that Zotero is a relatively young program maintained and developed by a pretty small staff free of charge for you - so while it's perfectly OK to be unhappy with specific developments, it's good to keep things in perspective.
  • @fbennett,

    Thanks for your perspective on the new citation formatter.

    @adamsmith,

    I assumed the issue was widely spread because of a few tests I had done on several different operating systems, all of which turned out to be affected by incorrect reference sorting. Your assertion that the problem affects only a minority of users is, I trust, based on more rigorous testing.

    Will the patch be included in the next upgrade or is the matter considered to be of too little importance?
  • @anark:
    thankfully this isn't OS specific - else most likely a solution would be harder to find.
    It seems to be style specific _and_ citation specific in ways that I haven't been able to completely understand. I haven't done rigorous testing either, but since I write (and test) a lot of styles for people I do think I see quite a bit and get a lot of reports back from users.

    I'm in no position to tell you if this will be in the next update - as I said I hoped it'd be in this one. I have no association with Zotero beyond my frequent presence here on the forum and the occasional coding of styles (which as you probably know can be contributed independently of the actual program).
  • I've applied mglueck's patch in the latest trunk dev build. The old CSL processor is no longer being maintained, and I have nothing to do with the code, but Simon OKed the patch. It'd be helpful if someone could test out the dev build and verify that this is fixed, however, as I don't believe anyone else has confirmed that the patch works.

    Thanks to mglueck for the patch.
  • To avoid confusion as several issues have been discussed here: The patch Dan committed addresses the sorting problem with multiple sources in one in-text citation. It does not address the sorting problem in the bibliography when sorting by date. That is a different issue.
  • Does this mean that the date sorting issue won't be fixed until the "old" CSL processor gets replaced some time after the 2.0 release?
  • Hi,
    I am trying to use zotero to format a paper for Yeast (Wiley).
    I am modifying the Yeast (dev) style that comes with zotero.

    What I could not get to work is sorting of the citations by year i.e.
    [Bones et al., 2007; Jones et al., 2009] instead of the other way around (sorting by author). Form this thread I have understood that this is not yet possible? Please tell me if I am right or wrong on this, I had some difficulty following the details of the discussion?

    It is also not yet possible to format "et al." in italics? This is a minor problem that I can search and replace.

    Thanks for your answer!
  • on "et al" in italics - definitely not possible.
    On sorting citations by year - maybe not possible due to a bug, but in theory possible, I'd have to look at the exact case.
  • edited December 2, 2009
    Try

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

    within citation
  • If you do:<macro name="year-issued">
    <date variable="issued">
    <date-part name="year"/>
    </date>
    </macro>
    ... and then ...<sort>
    <key macro="year-issued"/>
    <key variable="author"/>
    </sort>
    ... does that do better?
  • Hi,
    it did not work for me. Using the csl editor of zotero:

    Single Citations
    [Grzelak et al., 2006]
    [Raspor et al., 2005]
    Multi Citations
    [Grzelak et al., 2006; Raspor et al., 2005]

    below is the citation part of the yeast (dev) style (added the sort tags:

    <citation>
    <sort>
    <key variable="issued"/>
    <key variable="author"/>
    </sort>
    <option name="et-al-min" value="3"/>
    <option name="et-al-use-first" value="1"/>
    <option name="et-al-subsequent-min" value="6"/>
    <option name="et-al-subsequent-use-first" value="1"/>
    <option name="disambiguate-add-year-suffix" value="true"/>
    <option name="disambiguate-add-names" value="true"/>
    <option name="disambiguate-add-givenname" value="true"/>
    <option name="collapse" value="year"/>
    <layout prefix="[" suffix="]" delimiter="; ">
    <group delimiter=", ">
    <group delimiter=", ">
    <text macro="author-short"/>
    <text macro="year-date"/>
    </group>
    <text variable="locator"/>
    </group>
    </layout>
    </citation>

    I suppose that the location of the sort tags within the cotetion tag does not matter?
  • Try it in word. It doesn't work in the csl-editor
  • edited December 2, 2009
    My suggestion above is to use a macro that renders the year explicitly as the sort key, rather than the raw variable. I don't know the internals of the current processor, but the intuition behind the suggestion is that because date variables are compound objects composed of several parts, or sub-variables (i.e. year, month, day), the processor's sort key machinery may be stumbling over the need to extract the relevant elements.

    Does using a macro work for you?

    (EDIT: Ah, I missed the gist of part of the discussion, sorry. If asplundj's solution works in the document, use that instead; simpler is better. If it doesn't work for you, you might try the macro approach as a last-ditch workaround.)
  • Hi again,
    I tested the suggestion of fbennett, but the result is the same.
    btw I use zotero 2.0b7.6/openoffice plugin 3.0a5/FF 3.5.5/OO3.1.1 on ubuntu karmic
    I also checked that the style is not broken.

    thanks

    <macro name="year-issued">
    <date variable="issued">
    <date-part name="year"/>
    </date>
    </macro>

    <citation>
    <sort>
    <key macro="year-issued"/>
    <key variable="author"/>
    </sort>
    <option name="et-al-min" value="3"/>
    <option name="et-al-use-first" value="1"/>
    <option name="et-al-subsequent-min" value="6"/>
    <option name="et-al-subsequent-use-first" value="1"/>
    <option name="disambiguate-add-year-suffix" value="true"/>
    <option name="disambiguate-add-names" value="true"/>
    <option name="disambiguate-add-givenname" value="true"/>
    <option name="collapse" value="year"/>
    <layout prefix="[" suffix="]" delimiter="; ">
    <group delimiter=", ">
    <group delimiter=", ">
    <text macro="author-short"/>
    <text macro="year-date"/>
    </group>
    <text variable="locator"/>
    </group>
    </layout>
    </citation>
  • Hi, tested both in openoffice, same result.

    There is an option in the plugin "keep sources sorted".
    What does this mean?
    Would this affect the situation?
  • just another comment.

    I had at least resolved the number of authors before et al. in the citations by using the csl editor.

    Turns out that the result is different actually formatting the paper using the oo plugin.

    csl editor:

    Multi Citations
    [Lah et al., 2004; Miloshev et al., 2002; Nemavarkar et al., 2004; Rank et al., 2009; Raspor et al., 2005]

    oo plugin

    [Miloshev, Mihaylov, and Anachkova, 2002; Lah et al., 2004; Nemavarkar et al., 2004; Raspor et al., 2005; Rank et al., 2009]

    The sorting of the refs by year I did manually. The oo plugin also screws up the formatting of the paper.
    It seems that the zotero functions for formatting papers might actually be a bit too early to actually use. I know this is free software and all, so I dont want to be pushy, but Is there any idea when there will be new versions (csl 1.0 , an updated plugin etc..).
  • This discussion ended december 2d 2009. My experience is that the problem still is unfixed. I agree with many other people that this issue (sorting in text references by issued date) is important to fix. Any solutions yet?
  • I assume you are talking about (Smith, 1999, Adams, 2001) type sorting?

    Since Dan applied the patch to the main Zotero update (version 2.0b6? or so) in late November, it's been working fine for me.
    What version are you running? What word-processor?

    The other issue (bibliography sort) may not be fixed yet by the sounds of things...
  • Thanx for the replay. Yes its the citations that I have problems with. I use Zotero 2.0rc5 with microsoft word and WinWord Integration 3.0a3. I can not see any effect by using the sort tag with issued date. Here is an example of a not sorted item.

    (Gustafsson et al. 2008, Drizo et al. 2006, Bowden et al. 2009).

    Here is my sort tag which is located under the citation tag

    <sort>
    <key variable="issued" sort="descending"/>
    </sort>
  • edited March 18, 2010
    Surprised this isn't fixed yet. To summarize, I cannot sort citations in the text differently from citations in the bibliography. Only <sort> tags in the bibliography have any effect, and the control the sort order in both places. Since every scientific journal I have ever submitted to requires references to be sorted by year in the text, and either by appearance order or alphabetical order in the bibliography, this should be a priority #1 bug fix. For now, the best solution appears to be to add the citations in chronological order when you insert them.

    UPDATE: I now realize that it only fails in the preview pane in Firefox, but works in Word, after noticing komrade's comment below. At least, it worked for old multi-citation fields if I edited them, unclicked "Keep sorted", then reclicked "Keep sorted", after having added the normal <sort> entry to my style file. I may test this further to see what, if anything, does not work in Word.
  • This is (still) working fine for me since around November.
    It doesn't work in the Zotero test-pane, but works in Word (XP, v. 2003)

    (Carson, 1965; Attenborough, 1979).
    Attenborough, S.D. (1979) Life on Earth: A Natural History. Fontana.
    Carson, R. (1965) Silent spring. Penguin.

    Don't know what is preventing the fix from working for others...
    OOO? Keep sources sorted? Some magic line in the CSL?
  • Hi there,

    I'm trying to add a multi-author sort parameter to the Chicago Author-Date style (by date). I can't seem to find wherever this sort exists within the code, which would make sense as the sorting is terribly wonky in my Word documents (whatever order I selected the sources in, and there's no "keep sorted" button).

    This is the current citation code:

    <citation>
    <option name="et-al-min" value="4"/>
    <option name="et-al-use-first" value="1"/>
    <option name="et-al-subsequent-min" value="4"/>
    <option name="et-al-subsequent-use-first" value="1"/>
    <option name="disambiguate-add-year-suffix" value="true"/>
    <option name="disambiguate-add-names" value="true"/>
    <layout prefix="(" suffix=")" delimiter="; ">
    <group delimiter=", ">
    <group delimiter=" ">
    <text macro="contributors-short"/>
    <text macro="date"/>
    </group>
    <text macro="point-locators"/>
    </group>
    </layout>
    </citation>

    How should I edit it to add a sort order by date (the bibliography I want to remain sorted alphabetically)? Thanks for any help. My dissertation is due in 8 days and I'm a bit frazzled.
  • edited August 3, 2010
    add

    <sort>
    <key macro="date"/>
    </sort>

    between the last "option name" and the <layout prefix... lines

    Edit: I'm not sure but I believe this might _not_ auto-update all citations in your document. You wouldn't actually have do change them, but might have to, for every multi-author ciation, click "edit citation" and then "OK".
  • Adam, thanks again for your help. This didn't work at first, so I switched the doc over to a different style, then back to Chicago, then tried "edit citation" then "OK" and it worked! And now I see the "keep sources sorted" box. Very much appreciated.

    One final thing: Is it possible to then sort alphabetically within the citation? For example, right now this is what the in-text citations look like:

    (Lessig 2004; Jenkins 2006; Benkler 2006; Zittrain 2008; Doctorow 2008).

    I would like them to look like this:

    (Lessig 2004; Benkler 2006; Jenkins 2006; Doctorow 2008; Zittrain 2008).

    Thanks again for your help!
  • edited August 4, 2010
    <sort>
    <key macro="date"/>
    <key macro="contributor-short"/>
    </sort>

    i.e. just add the contributor-short line.
Sign In or Register to comment.