CSL Problem : sorting a Bibliography first by year, then by author

I need for a webpage a formatted bibliography, which is first sorted by publication year, and then by authors within.
And I don't seem to manage it : putting just after the


gives a list sorted by years, however within years the list is unordered
What is astonishing is that doing the inverse :




does give a list ordered by authors, and then within authors by year.

Anybody any ideas ? Is this a problem of Zoteros CSL parsing ?
Cheers

  • To show code on the forums, you need to wrap it in <code> </code> tags.

    But take a look at the APA (curriculum vitae) style for an example of how to do this (or you could use this style directly).
    https://www.zotero.org/styles?q=APA cv
  • thanks bwiernik for the hint,
    the APA style uses exactly the same code as I tried

    <sort>
    <key variable="issued" sort="descending"/>
    <key variable="author" name-as-sort-order="first" sort="ascending"/>
    </sort>


    and it does not work (even in the preview of the styles editor) : the bibliography is sorted by year, but the authors within year are unordered

  • just to complement my first post, which does not show the code :

    when you do


    <sort>
    <key variable="author" name-as-sort-order="first" sort="ascending"/>
    <key variable="issued" sort="descending"/>
    </sort>


    the bibliography is ordered by authors a->z and then within authors by year

    however when you do the inverse :


    <sort>
    <key variable="issued" sort="descending"/>
    <key variable="author" name-as-sort-order="first" sort="ascending"/>
    </sort>


    then you get the bib ordered by year, but within year the authors are unordered.


  • I'm confused -- that's not what the APA CV style uses for sorting, it uses

    <sort>
    <key macro="date-sort-group" sort="descending"/>
    <key macro="date-issued-year" sort="descending"/>
    <key macro="date-sort"/>
    <key variable="status"/>
    <key macro="author-sort"/>


    And that works for me. Note that it doesn't just call the date variable but specific macros which APA uses for sorting.
    My guess is that you have more precise dates in Zotero and your code sorts by the entire date, so December 20 would sort before November 1st etc.
Sign In or Register to comment.