1

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.

Evan
  • 435
  • 3
  • 12
  • Can you add a link to the publisher's guidelines? – Rintze Zelle Apr 11 '17 at 17:34
  • @RintzeZelle done! – Evan Apr 11 '17 at 17:36
  • Ah, so this is for Nature itself? I can't find any mention that they want in-text cites sorted chronologically within a citation group. Can you point me to the relevant section? – Rintze Zelle Apr 11 '17 at 17:47
  • @RintzeZelle Indeed, there is no specification for within group cite order. This leaves authors free to come up with their own ordering (chronological, importance, etc.) I prefer not to order by importance (which is subjective), so I'm choosing to order chronologically, rather than arbitrarily. My worry is that arbitrary ordering could be mistaken for my own perception of the importance of the studies. – Evan Apr 11 '17 at 17:57

2 Answers2

3

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.

  • Ah, yes. So that proposed variable would get assigned an index based on the citation group that the item is first cited in? That would indeed be very clear. I like it. I'll create a ticket. – Rintze Zelle Apr 12 '17 at 00:14
2

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.
Rintze Zelle
  • 1,654
  • 1
  • 14
  • 30
  • (1): The rule would have to be hierarchical. For example, if I cite 3 by itself, then cite 3 with two chronologically earlier references, the citation would still say 3-5, but 3 would occur before 4 & 5 in the bibliography. In fact, this is what happens if I use solution (3) via my reference manager software plugin. (2) would break the citation guideline, and (3) is what I'm currently doing. I'd just like it to be done automatically. – Evan Apr 11 '17 at 17:32
  • I don't think this can be done automatically right now, then. As far as I'm aware, the order in which you cite items currently always determines the unsorted order of these items in the bibliography, which in turn determines the item numbering. For this to work, the sorted order of newly cited items in a citation group should determine their order in unsorted bibliographies, overriding the order in which the items are cited. I'll ping some of my fellow CSL developers. – Rintze Zelle Apr 11 '17 at 17:41
  • That's correct. This can't currently be done and I think it'd be pretty difficult to change CSL so that it would allow that. The logic for how/when the value of `citation-number` would need to be assigned looks quite complex to me, something along the lines of "use the existing value if the item is previously cited, but otherwise don't assign a value until the secondary sort condition has kicked in. – adam.smith Apr 11 '17 at 18:03
  • @RintzeZelle Interesting. If you don't mind updating the answer to mention that my preferred solution is not possible, I'll make the answer correct. – Evan Apr 11 '17 at 18:10