Bibtex Bibliography Not Showing Up, No Error

Hi all,

I am trying to make a PDF document using R markdown that contains references using Bibtex. When I knit the markdown file, I get a PDF, but the references section is blank. My yaml heading is as follows:

---
title: "help_bibliography"
author: "Maria Burzillo"
date: "2/28/2020"
output: bookdown::pdf_document2
bibliography: bib.bib
biblio-style: "apalike"
link_citations: true
---

My bib.bib file is included in the repo and is as follows:

% Encoding: UTF-8

@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.27},
  url = {https://CRAN.R-project.org/package=knitr},
}
@Manual{R-stringr,
  title = {stringr: Simple, Consistent Wrappers for Common
    String Operations},
  author = {Hadley Wickham},
  year = {2019},
  note = {R package version 1.4.0},
  url = {https://CRAN.R-project.org/package=stringr},
}
@Book{knitr2015,
  title = {Dynamic Documents with {R} and knitr},
  author = {Yihui Xie},
  publisher = {Chapman and Hall/CRC},
  address = {Boca Raton, Florida},
  year = {2015},
  edition = {2nd},
  note = {ISBN 978-1498716963},
  url = {https://yihui.org/knitr/},
}
@InCollection{knitr2014,
  booktitle = {Implementing Reproducible Computational
    Research},
  editor = {Victoria Stodden and Friedrich Leisch and Roger D.
    Peng},
  title = {knitr: A Comprehensive Tool for Reproducible
    Research in {R}},
  author = {Yihui Xie},
  publisher = {Chapman and Hall/CRC},
  year = {2014},
  note = {ISBN 978-1466561595},
  url = {http://www.crcpress.com/product/isbn/9781466561595},
}

I read the answers to the related question on Github and ran the reproducible example on my computer, which worked when the output was the original and also when I set the output to bookdown::pdf_document2, which I need for my project. Any ideas? I have no idea why this isn't working. Thank you!

I didn't realize that you actually had to reference something in the text for it to show up as a reference, so now it is working. Is there a way to have your references show up even if you don't explicitly cite them though? Thanks

Hi there,

For what it's worth, I have done something like this before in LaTeX but not in markdown. My trick was to include all the citations but use a white text colour to turn them effectively invisible in the text.

Maybe that helps.

It's hacky, but here's what I do in the YAML header:

include_uncited: |
  @concord2, @clerc2014, @brenner1996, @bookdown, @datatable, @ggplot2, @ggiraph

I adapted it from the Pandoc documentation. include_uncited is an arbitrary name, picked only because it's unlikely to conflict with what Pandoc or knitr do now or will do. The real trick is that, now, the references are cited somewhere in the document.

Pandoc also lets you include all citations in the bibliography file with a wildcard reference:

nocite: |
  @*
2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.