9. Citations and Bibliography

Citing correctly in scientific documents

Author
Affiliation

Dr. Paul Schmidt

Last updated

February 7, 2026

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:

  1. Create a bibliography file: A .bib file contains all literature sources
  2. Reference in YAML: The file is specified in the header
  3. Cite in text: Use @key or [@key] to cite
  4. 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
Tip

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

Citing 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:

  1. Search for a style (e.g., “Nature”, “APA”, “Vancouver”)
  2. Download (.csl file)
  3. Save in your project folder
  4. 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:

# References

If 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

...

# References

Practical tips

Keep citation keys consistent

Use a consistent scheme for keys:

  • authoryeargorman2014
  • author_yeargorman_2014
  • AuthorYearGorman2014

Validate the bibliography

Before final rendering, check:

  • Are all keys present in the .bib file?
  • Are all entries complete (year, author, title)?
  • Are all sources cited in the text?
Tip

RStudio/Positron shows auto-completion of available keys when typing @.

TipExercise: Set up citations
  1. Create a references.bib file with at least two entries
  2. Include the file in the YAML header
  3. Cite both sources in the text (once with @key, once with [@key])
  4. Add a “References” heading at the end
  5. Render to Word and check the result

Further resources

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

BibTeX 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}
}
For attribution, please cite this work as:
Dr. Paul Schmidt. 2026. “9. Citations and Bibliography.” BioMath GmbH. February 7, 2026. https://biomathcontent.netlify.app/content/quarto/09_citations.html.