1
votes

I am using RStudio and the R package bookdown. I am having issues when trying to add a new bibtex entry to a .bib file.

In my index.Rmd I have the following line:

bibliography: [book.bib, packages.bib]

I added a new entry to packages.bib and then I built the book with the "Build Book" button in RStudio (I tried HTML and PDF). When opening the book in html or pdf, the citation looks like "???". When I close packages.bib and open it again, the entry that I added is not there anymore. Furthermore, when I make a change to any of the .bib files (just adding a space) and then saving the following error is displayed:

Error in if (config$output_dir != ".") exclude <- c(exclude, config$output_dir) : 
  argument is of length zero

I tried cleaning the project and building it again but that did not solve the problem.

Versions:

  • OS: Windows 10
  • R: 3.6.1
  • RStudio: 1.2.1335
  • bookdown: 0.12
  • rmarkdown:1.14
  • knitr:1.24
1
This sound a little like a file permission issue. Have you tried saving the bib as a new file and changing the lines in your index.Rmd? - JBGruber

1 Answers

2
votes

In the default bookdown project the file packages.bib is dynamically created to contain citation information for the specified R packages only. Use book.bib for adding BibTeX entries by hand.