yml_citations() sets citation-related YAML fields, such as specifying a bibliography file or style. For controlling the citation engine in PDF documents, see the citation_package argument in rmarkdown::pdf_document().

yml_citations(
  .yml,
  bibliography = yml_blank(),
  biblio_style = yml_blank(),
  biblio_title = yml_blank(),
  csl = yml_blank(),
  citation_abbreviations = yml_blank(),
  link_citations = yml_blank(),
  nocite = yml_blank(),
  suppress_bibliography = yml_blank()
)

Arguments

.yml

a yml object created by yml(), as_yml(), or returned by a yml_*() function

bibliography

a path to a bibliography file, such as a .bib file

biblio_style

bibliography style, when used with natbib and biblatex. Note that the actual YAML field is biblio-style

biblio_title

bibliography title, when used with natbib and biblatex. Note that the actual YAML field is biblio-title

csl

a path to a Citation Style Language (CSL) file. CSL files are used to specify the citation style; see the CSL repository for the CSL files of dozens of journals.

citation_abbreviations

Path to a CSL abbreviations JSON file. See the pandoc-citeproc documentation. Note that the actual YAML field is citation-abbreviations.

link_citations

Logical. Add citations hyperlinks to the corresponding bibliography entries? Note that the actual YAML field is link-citations.

nocite

Citation IDs ("@item1") to include in the bibliography even if they are not cited in the document. Including the wildcard pattern "@*" will include all citations in the bibliography regardless of if they're cited in the document.

suppress_bibliography

Logical. Suppress bibliography?

Value

a yml object

Examples


yml() %>%
  yml_citations(bibliography = "references.bib", csl = "aje.csl")
#> ---
#> date: '`r format(Sys.Date())`'
#> bibliography: references.bib
#> csl: aje.csl
#> ---
#>