Citations & Footnotes
Introduction
This guide provides an overview of how to include citations and footnotes in your Quarto documents. It covers the following topics:
- Formatting basics using BibLaTeX, BibTeX, and CSL for precise citation styles.
- Automatic bibliography generation and customization.
- Advanced features including footnote formatting and the inclusion of uncited items.
Citations
You’ll need:
- A Quarto document with citations.
- A bibliography source file, like BibLaTeX (
.bib
) or BibTeX (.bibtex
). - Optionally, a
CSL
file for specific formatting (when not usingnatbib
orbiblatex
).
Bibliography Files
Specify a bibliography file field in the YAML metadata.:
---
title: "My Document"
bibliography: references.bib
---
Citation Syntax
- Citations are in square brackets, separated by semicolons:
[@citation]
or[@citation1; @citation2]
. - Each citation has a key starting with
@
plus an identifier from the database. - Keys must start with a letter, digit, or
_
, and can include alphanumerics,_
, and certain punctuation (:.#$%&-+?<>~/
).
Here is examples of a citations in a markdown document:
Markdown Format:
- Blah Blah (see Knuth 1984, 33–35; also Wickham 2015, chap. 1)
- Blah Blah (Knuth 1984, 33–35, 38–39 and passim)
- Blah Blah (Wickham 2015; Knuth 1984)
- Wickham says blah (2015)
Output (default):
- Blah Blah (see Knuth 1984, 33–35; also Wickham 2015, chap. 1)
- Blah Blah (Knuth 1984, 33–35, 38–39 and passim)
- Blah Blah (Wickham 2015; Knuth 1984)
- Wickham says blah (2015)
Output (csl
):
- Blah Blah see [1], pp. 33-35; also [1], chap. 1
- Blah Blah [1], pp. 33-35, 38-39 and passim
- Blah Blah [1, 2]
- Wickham says blah [1]
csl: diabetologia.csl
, see Section 2.3
Citation Style
- Default style: Chicago Manual of Style (author-date format)
- Add a custom citation format by specifying a CSL (Citation Style Language) file path in your document metadata field:
---
title: "My Document"
bibliography: references.bib
csl: nature.csl
---
- Resources for CSL files:
Bibliography Generation
- Automatically generated
- Placed at the end of the document by default (or in a div with the id
refs
if one exists):
### References
::: {#refs} :::
You can suppress generation of a bibliography by including suppress-bibliography: true
option in your document metadata
Example of a generated bibliography:
Including Uncited Items
To add bibliography items not cited in the text, use a nocite
metadata field for the citations.
---
nocite: |
@item1, @item2
---
@item3
In this example, the document will contain a citation for item3
only, but the bibliography will contain entries for item1
, item2
, and item3
.
Footnotes
Syntax:
[^1] and another.[^longnote]
Here is a footnote reference,
[^1]: Here is the footnote.
[^longnote]: Here's one with multiple blocks.
Subsequent paragraphs are indented to show that they belong to the previous footnote.
{ some.code }
The whole paragraph can be indented, or just the first line.
In this way, multi-paragraph footnotes work like multi-paragraph list items.
This paragraph won't be part of the note, because it isn't indented.
Output
Here is a footnote reference,1 and another.2
This paragraph won’t be part of the note, because it isn’t indented.
In addition, you can also write single paragraph footnotes inline using the following syntax:
[Inlines notes are easier to write, since you don't have to pick an identifier and move down to type the note.] Here is an inline note.^
Output
Here is an inline note.3
The footnotes that are generated from the above examples are included in the following section. See the Pandoc Footnotes for additional information.
Footnotes
Here is the footnote.↩︎
Here’s one with multiple blocks.
Subsequent paragraphs are indented to show that they belong to the previous footnote.
{ some.code }
The whole paragraph can be indented, or just the first line. In this way, multi-paragraph footnotes work like multi-paragraph list items.↩︎
Inlines notes are easier to write, since you don’t have to pick an identifier and move down to type the note.↩︎