Scientific documents require correct citations. Quarto supports a powerful citation system that automatically generates the bibliography and can apply different citation styles (APA, Vancouver, etc.).
The basic principle
Citations in Quarto work like this:
-
Create a bibliography file: A
.bibfile contains all literature sources - Reference in YAML: The file is specified in the header
-
Cite in text: Use
@keyor[@key]to cite - Bibliography appears automatically: At the end of the document
The bibliography file
BibTeX format
Literature sources are stored in BibTeX format. A .bib file is a text file with entries like these:
@article{horst2020,
author = {Horst, Allison M. and Hill, Alison Presmanes and Gorman, Kristen B.},
title = {palmerpenguins: Palmer Archipelago (Antarctica) penguin data},
journal = {R package version 0.1.0},
year = {2020},
doi = {10.5281/zenodo.3960218}
}
@book{wickham2023,
author = {Wickham, Hadley and Çetinkaya-Rundel, Mine and Grolemund, Garrett},
title = {R for Data Science},
edition = {2nd},
year = {2023},
publisher = {O'Reilly Media},
url = {https://r4ds.hadley.nz/}
}
@inproceedings{gorman2014,
author = {Gorman, Kristen B. and Williams, Tony D. and Fraser, William R.},
title = {Ecological Sexual Dimorphism and Environmental Variability within a Community of Antarctic Penguins (Genus Pygoscelis)},
booktitle = {PLOS ONE},
year = {2014},
volume = {9},
number = {3},
doi = {10.1371/journal.pone.0090081}
}Save this file as references.bib in your project folder.
Entry types
| Type | Usage |
|---|---|
@article |
Journal articles |
@book |
Books |
@inproceedings |
Conference papers |
@techreport |
Technical reports |
@online |
Websites |
@misc |
Miscellaneous |
Exporting from reference managers
Most reference managers can export BibTeX:
- Zotero: Right-click → Export → BibTeX
- Mendeley: File → Export → BibTeX
- EndNote: File → Export → BibTeX
With Zotero and the Better BibTeX plugin, you can create an automatically synchronized .bib file. Every change in Zotero is automatically written to the file.
Including the bibliography
In the YAML header:
---
title: "Penguin Analysis"
bibliography: references.bib
---For multiple files:
bibliography:
- references.bib
- additional_refs.bibCiting in text
Basic syntax
| Syntax | Output | Usage |
|---|---|---|
@horst2020 |
Horst et al. (2020) | In sentence |
[@horst2020] |
(Horst et al., 2020) | At sentence end |
[-@horst2020] |
(2020) | Year only |
Examples
The data come from the palmerpenguins package @horst2020.
The penguins were observed on three islands [@gorman2014].
As Gorman [-@gorman2014] showed, the species differ significantly.Becomes:
The data come from the palmerpenguins package Horst et al. (2020).
The penguins were observed on three islands (Gorman et al., 2014).
As Gorman (2014) showed, the species differ significantly.
Multiple sources
Several studies support this [@horst2020; @gorman2014; @wickham2023].Becomes: (Gorman et al., 2014; Horst et al., 2020; Wickham et al., 2023)
Specifying page numbers
As described [@wickham2023, pp. 42-45]...Citation styles (CSL)
What is CSL?
Citation Style Language (CSL) defines how citations are formatted. There are thousands of styles for different journals and disciplines.
Setting a style
---
bibliography: references.bib
csl: apa.csl
---Finding styles
Most styles are available in the Zotero Style Repository:
- Search for a style (e.g., “Nature”, “APA”, “Vancouver”)
- Download (
.cslfile) - Save in your project folder
- Reference in YAML
Commonly used styles:
| Style | File | Example |
|---|---|---|
| APA 7th | apa.csl |
(Author, 2020) |
| Vancouver | vancouver.csl |
[1] |
| Nature | nature.csl |
1. |
| Chicago | chicago-author-date.csl |
(Author 2020) |
Bibliography heading
By default, the bibliography appears at the end with the heading “References”. To customize it:
# ReferencesIf this is the last heading in the document, the bibliography appears below it.
Or in YAML:
---
reference-section-title: "Bibliography"
---Practical example
Project structure
my_report/
├── report.qmd
├── references.bib
└── apa.csl
YAML header
---
title: "Morphology of Adelie Penguins"
author: "Research Team"
date: today
format: docx
bibliography: references.bib
csl: apa.csl
lang: en
---Document content
# Introduction
The Palmer penguins are a commonly used example dataset
for data analysis [@horst2020]. The original data were collected by
@gorman2014.
# Methods
The analysis was performed in R [@wickham2023].
# Results
...
# ReferencesPractical tips
Keep citation keys consistent
Use a consistent scheme for keys:
-
authoryear→gorman2014 -
author_year→gorman_2014 -
AuthorYear→Gorman2014
Validate the bibliography
Before final rendering, check:
- Are all keys present in the
.bibfile? - Are all entries complete (year, author, title)?
- Are all sources cited in the text?
RStudio/Positron shows auto-completion of available keys when typing @.
- Create a
references.bibfile with at least two entries - Include the file in the YAML header
- Cite both sources in the text (once with
@key, once with[@key]) - Add a “References” heading at the end
- Render to Word and check the result
Further resources
- Quarto Citations — Official documentation
- Zotero Style Repository — CSL styles
- Better BibTeX for Zotero — Automatic BibTeX synchronization
What is next
In Chapter 10, we will learn how to use parameters to generate the same report for different datasets — e.g., a penguin report for each of the three species.
Citation
@online{schmidt2026,
author = {{Dr. Paul Schmidt}},
publisher = {BioMath GmbH},
title = {9. {Citations} and {Bibliography}},
date = {2026-02-07},
url = {https://biomathcontent.netlify.app/content/quarto/09_citations.html},
langid = {en}
}