Skip to content

Using Citations in Pandoc: A Guide

This content is not available in your language yet.

In Pandoc, citation management is facilitated by employing Citation Style Language (CSL) and files, along with the style processor, Citeproc. Here are the basic steps for incorporating citations in Pandoc documents:

  1. Create a Bibliography:
  • Generate a bibliography file in BibTeX using CiteDrive. This file contains information about the cited sources.
  • Example BibTeX file, as exported by CiteDrive: mylibrary.bib
mylibrary.bib
@article{entry1, ...}
@book{entry2, ...}
...
@book{entryn, ...}
  1. Select a Citation Style Language (CSL) File:

Example: apa.csl

  1. Pandoc Command for Citations:
  • Use the --citeproc switch of Pandoc to enable citation processing.
  • Specify the bibliography file (--bibliography) and the CSL file (--csl).

Example:

Terminal window
pandoc input.md --citeproc --bibliography=mylibrary.bib --csl=apa.csl -o output.pdf

Citations in Text:

  • Insert citation markers in the text to reference the corresponding entries in the bibliography.

Example in Markdown:

This is a citation[@author2020title].
  1. Here, author2020title is replaced by the BibTeX key of the cited entry.

  2. Generate Bibliography:

  • A bibliography is automatically created at the end of the document when using the --citeproc switch.

Note that the exact steps and commands may vary depending on specific requirements and citation styles you are using. It is advisable to consult the official Pandoc documentation and the documentation of the chosen citation style for precise information.