Search code examples
citationscsl

Chronological inline citations - CSL file modification


I'm aware that the ordering of citations within an inline citation group is determined by the .csl citation style. I'm wondering if anyone is able to provide guidance on how to edit an existing style which does not order inline citations chronologically so that it does. Specifically, I'm interested in modifying the Nature style (guidelines) so items from groups cited as, for example "1-5" in the text are sorted chronologically in the bibliography.

Edit: I need this to not break the publisher's citation format guidelines.


Solution

  • I'm one of the developers of CSL, and you can't specify this behavior with the current version of CSL, 1.0.1. I think you have three options available to you:

    1. You can automatically sort the in-text cites within citation groups chronologically, and leave the bibliography in cite-order. However, because item numbering is always based on the bibliography order, this can lead to strange-looking citations such as "4,3,5" (e.g. if you first cite item 3, and then cite item 3, 4, and 5, with item 3 having an issued date between items 4 and 5).
    2. If it's acceptable to you, you probably get nicer results by sorting the entire bibliography chronologically. https://gist.github.com/rmzelle/bc869c900549226483123c11b0a90cb9/revisions#diff-505d66a4e3748adc6417742a07ce4f51 shows the required modification in the Nature style to achieve this (sorting by year).
    3. You could probably also achieve this with the current style, as long as you make sure that you, whenever you cite multiple new items in a single citation, that you cite them in chronological order.