Chapter 4 Footnotes and citations

4.1 Footnotes

Footnotes are put inside the square brackets after a caret ^[]. Like this one 1.

4.2 Citations

Reference items in your bibliography file(s) using @key.

For example, we are using the bookdown package2 (check out the last code chunk in index.Rmd to see how this citation key was added) in this sample book, which was built on top of R Markdown and knitr3 (this citation was added manually in an external file book.bib). Note that the .bib files need to be listed in the index.Rmd with the YAML bibliography key.

The bs4_book theme makes footnotes appear inline when you click on them. In this example book, we added csl: chicago-fullnote-bibliography.csl to the index.Rmd YAML, and include the .csl file. To download a new style, we recommend: https://www.zotero.org/styles/

The RStudio Visual Markdown Editor can also make it easier to insert citations: https://rstudio.github.io/visual-markdown-editing/#/citations


  1. This is a footnote.↩︎

  2. Yihui Xie, Bookdown: Authoring Books and Technical Documents with r Markdown, 2022, https://CRAN.R-project.org/package=bookdown.↩︎

  3. Yihui Xie, Dynamic Documents with R and Knitr, 2nd ed. (Boca Raton, Florida: Chapman; Hall/CRC, 2015), http://yihui.org/knitr/.↩︎