Evan
Evan

Reputation: 477

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.

Upvotes: 1

Views: 1777

Answers (2)

Frank Bennett
Frank Bennett

Reputation: 31

I maintain citeproc-js, which is probably the most widely used CSL processor. While the case isn't covered currently either in the CSL spec or in citeproc-js, the use case and the conditions for triggering the behavior are clear. Thinking about how to approach it, I think there are two layers to consider: the way to express it in the CSL stylesheet; and the way to make in happen inside the processor.

Taking stylesheets first, it might seem straightforward to just implicitly reflect the sort order of citations in an unsorted (or citation-number-sorted) bibliography. That could be done without any change to the CSL language (apart from maybe specifying the behavior). It's tempting, but the sort order in CSL bibliographies can be explicit, so there would be edge cases, and it could get confusing for all concerned.

Under the hood, inside the processor, what you would use for this would be a sort key for something like first-reference-citation-number. [1] You would use that as the primary key for sorting references in the bibliography, with issued (or whatever) as a secondary key. With the items lined up in that order, everything would fall into place: the citation-number would be assigned to items in ascending order in the usual way, the assigned numbers would be mapped into the in-text citation items, and if citations imposed a sort on issued (or whatever), numeric collapsing would work as expected.

For clarity, you would want to allow for an explicit sort on the (still-hypothetical) first-reference-citation-number; and that would require a (modest) change to the CSL specification.

That's my two-bits on the subject. @RinzeZelle and @adam.smith may have further thoughts on it.

[1] We can't use the existing first-reference-note-number for this, since in-text citations all have a note number of 0.

Upvotes: 3

Rintze Zelle
Rintze Zelle

Reputation: 1744

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.

Upvotes: 3

Related Questions