Reputation: 65
I am having some trouble getting citations to work in rmarkdown.
I use write_bib()
to generate a bibliography file which seems to work.
knitr::write_bib("knitr", "package.bib")
@Manual{R-knitr,
title = {knitr: A General-Purpose Package for Dynamic Report Generation in R},
author = {Yihui Xie},
year = {2020},
note = {R package version 1.29},
url = {https://CRAN.R-project.org/package=knitr},
}
However when I try to use this in the document like this.
---
title: "Example"
output: html_document
Bibliography: package.bib
---
[@R-knitr]
I get this
I think I am missing something but I cannot work out what it is.
Thanks in advance for any help.
Upvotes: 2
Views: 102
Reputation: 700
Rmarkdown metadata are formatted in YAML, which is case sensitive. The correct format would be
---
title: "Example"
output: html_document
bibliography: package.bib
---
Upvotes: 3