Reverse number bibliography?
Hello,
I am trying to create a bibliography in this order:
3. Citation, 2017
2. Citation, 2010
1. Citation, 1997
The style I am using (based on Cell) currently outputs:
1. Citation, 2017
2. Citation, 2010
3. Citation, 1997
It seems like this question has already been asked:
https://forums.zotero.org/discussion/comment/99189
But, I cannot find anything in Zotero or in CSL documentation as to how to do this. Apologies if this has already been answered somewhere - I am a CSL newbie and learning to do this for a faculty member.
Much thanks for any assistance,
Donna
I am trying to create a bibliography in this order:
3. Citation, 2017
2. Citation, 2010
1. Citation, 1997
The style I am using (based on Cell) currently outputs:
1. Citation, 2017
2. Citation, 2010
3. Citation, 1997
It seems like this question has already been asked:
https://forums.zotero.org/discussion/comment/99189
But, I cannot find anything in Zotero or in CSL documentation as to how to do this. Apologies if this has already been answered somewhere - I am a CSL newbie and learning to do this for a faculty member.
Much thanks for any assistance,
Donna
OK - I will make do. This would be a great thing to incorporate!
Thanks for your reply and for considering,
Donna
https://github.com/citation-style-language/test-suite/blob/master/processor-tests/humans/sort_BibliographyCitationNumberDescendingViaMacro.txt
The trick seems to be wrapping
citation-number
in a macro, then using that as the sort key.Here's my code, apologies in advance for the sloppiness - I think I implemented your suggestion properly - apologies if I made a mistake!
https://gist.github.com/dtwrub/1ea15dc9ea1fd8abd412917289ecab4c
citation-number
macro call to the last position in the bibliography sort block, and setting the other keys also tosort="descending"
.I added your code:
<macro name="citation-number">
<text variable="citation-number"/>
</macro>
and then changed the sort:
<bibliography>
<sort>
<key macro="issued" sort="ascending"/>
<key macro="citation-number" sort="descending"/>
</sort>
...
</bibliography>
And it's perfect! I was unaware that the *order* of the keys in the sort block made a difference... my newbie is showing :)
Thank you SOOOO MUCH for your help - this is going to help a number of people I work with!!!
Have a great weekend!!
Thank you again!! :) :) :)
cs:bibliography
withsort="descending"
, whether as a variable or via a macro, citation-number will reverse the order of citations, with the highest citation-number at the top of the listing. When used as a secondary key incs:bibliography
withsort="descending"
whether called as a variable or as a macro, citation-number will reverse the numbering of citations without affecting a stable primary sort.I don't think this will alter the results from the structures covered in this thread: the only change is to eliminate the strange and wonderful difference between macro and variable calls to citation-number in
cs:key
. But just in case.