Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 705
A. Donda Avatar asked Mar 06 '15 16:03

A. Donda


People also ask

What is Pandoc Citeproc?

The pandoc-citeproc library supports automatic generation of citations and a bibliography in pandoc documents using the Citation Style Language (CSL) macro language. More details on CSL can be found at http://citationstyles.org/.

What can Pandoc do?

Pandoc is a command-line tool for converting files from one markup language to another. Markup languages use tags to annotate sections of a document. Commonly used markup languages include Markdown, ReStructuredText, HTML, LaTex, ePub, and Microsoft Word DOCX.

How do you use markdown citations?

You insert citations by either using the Insert -> Citation command or by using markdown syntax directly (e.g. [@cite] or @cite ) . Citations go inside square brackets and are separated by semicolons.

How do you use extensions in Pandoc?

An extension can be enabled by adding +EXTENSION to the format name and disabled by adding -EXTENSION . For example, --from markdown_strict+footnotes is strict Markdown with footnotes enabled, while --from markdown-footnotes-pipe_tables is pandoc's Markdown without footnotes or pipe tables.


1 Answers

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>
like image 158
Eric Avatar answered Sep 28 '22 08:09

Eric