Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
864 views
in Technique[技术] by (71.8m points)

markdown - How does pandoc-citeproc sort citations?

I have a pandoc-style Markdown text where I cite two papers by the same author in the same place:

Lorem ipsum [@Author2000;@Author2001] dolor sit amet.

This is rendered as

Lorem ipsum (Author 2001, 2000) dolor sit amet.

Why are these citations sorted this way, contradicting the sequence in my text, contradicting author-year sorting, and contradicting the sequence in which they appear in the list of references? How can I change this? Is it possible to switch off any kind of sorting and keep the order in which I specify the citations?

More information: The text is converted by pandoc with the options --filter pandoc-citeproc --csl=elsevier-harvard.csl into latex and then processed with xelatex. The csl file can be downloaded from Zotero. Pandoc is v1.13.2, pandoc-citeproc is v0.6.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

In-text citation formatting is defined by your CSL between <citation></citation> tags. The sorting of your citations is defined between the <sort></sort> tags. The CSL you are using sorts by author and then by descending date issued - (Author 2001, 2000):

<citation ...>
    <sort>
        <key macro="author"/>
        <key macro="issued" sort="descending"/>
    </sort>
    ...
</citation>

To sort by author and then by ascending date issued - (Author 2000, 2001):

<citation ...>
    <sort>
        <key macro="author"/>
        <key macro="issued" sort="ascending"/>
    </sort>
    ...
</citation>

To not sort the citations, just remove everything between the <sort></sort> tags.

<citation ...>
    <sort>
    </sort>
    ...
</citation>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...