Citations & Footnotes

Citations

Quarto will use Pandoc to automatically generate citations and a bibliography in a number of styles. To use this capability, you will need:

  • A quarto document formatted with citations (see Citation Markdown).

  • A bibliographic data source, for example a BibTeX (.bib) file.

  • Optionally, a CSL file which specifies the formatting to use when generating the citations and bibliography.

Bibliography Files

Quarto supports bibliography files in a wide variety of formats including BibTeX and CSL. Add a bibliography to your document using the bibliography YAML metadata field. For example:

---
title: "My Document"
bibliography: references.bib
---
Tip

You can provide more than one bibliography file if you would like by setting the bibliography field’s value to a YAML array.

See the Pandoc Citations documentation for additional information on bibliography formats.

Citation Syntax

Quarto uses the standard Pandoc markdown representation for citations (e.g. [@citation]) — citations go inside square brackets and are separated by semicolons. Each citation must have a key, composed of ‘@’ + the citation identifier from the database, and may optionally have a prefix, a locator, and a suffix. The citation key must begin with a letter, digit, or _, and may contain alphanumerics, _, and internal punctuation characters (:.#$%&-+?<>~/). Here are some examples:

Markdown Format Output
Blah Blah [see @knuth1984, pp. 33-35;
also @wickham2015, chap. 1]
Blah Blah [see Knuth (1984), pp. 33-35; also Wickham (2015), chap. 1]
Blah Blah [@knuth1984, pp. 33-35,
38-39 and passim]
Blah Blah [Knuth (1984), pp. 33-35, 38-39 and passim]
Blah Blah [@wickham2015; @knuth1984].
Blah Blah (Wickham 2015; Knuth 1984).
Wickham says blah [-@wickham2015]
Wickham says blah (2015)

You can also write in-text citations, as follows:

Markdown Format Output
@knuth1984 says blah.
Knuth (1984) says blah.
@knuth1984 [p. 33] says blah.
Knuth (1984, 33) says blah.

See the Pandoc Citations documentation for additional information on citation syntax.

Citation Style

Quarto uses Pandoc to format citations and bibliographies. By default, Pandoc will use the Chicago Manual of Style author-date format, but you can specify a custom formatting using CSL (Citation Style Language). To provide a custom citation stylesheet, provide a path to a CSL file using the csl metadata field in your document, for example:

---
title: "My Document"
bibliography: references.bib
csl: nature.csl
---

You can find CSL files or learn more about using styles at the CSL Project. You can browse the list of more than 8,500 Creative Commons CSL definitions in the CSL Project’s central repository or Zotero’s style repository.

Bibliography Generation

Pandoc will automatically generate a list of works cited and place it in the document if the style calls for it. It will be placed in a div with the id refs if one exists:

### References

::: {#refs}
:::

If no such div is found, the works cited list will be placed at the end of the document.

Tip

You can suppress generation of a bibliography by including suppress-bibliography: true option in your document metadata

Here’s an example of a generated bibliography:

Knuth, Donald E. 1984. “Literate Programming.” The Computer Journal 27 (2): 97–111.
Wickham, Hadley. 2015. R Packages. 1st ed. O’Reilly Media, Inc.

Including Uncited Items

If you want to include items in the bibliography without actually citing them in the body text, you can define a dummy nocite metadata field and put the citations there:

---
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.

It is possible to create a bibliography with all the citations, whether or not they appear in the document, by using a wildcard:

---
nocite: |
  @*
---

Footnotes

Pandoc supports numbering and formatting footnotes using the following syntax:

Here is a footnote reference,[^1] and another.[^longnote]

[^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:

Here is an inline note.^[Inlines notes are easier to write,
since you don't have to pick an identifier and move down to
type the 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.

Example Footnotes

  1. Here is the footnote.↩︎

  2. 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.↩︎

  3. Inlines notes are easier to write, since you don’t have to pick an identifier and move down to type the note.↩︎