Jamie Dunning
Jamie Dunning

Reputation: 153

R Markdown Could not find .bib file in one project, whilst working fine in another

Rmd referencing fine in file x, after clicking knit adding references to my reference list, However in file y, also a rmd file set up as follows :

title: Swans
bibliography: library.bib
output: html_document


[@Ticehurst1957]
##bibloography 

after knitting, I get the following error and no output

output file: essay_swan_first.knit.md

pandoc-citeproc: Could not find library.bib pandoc: Error running filter /Applications/RStudio.app/Contents/MacOS/pandoc/pandoc-citeproc Error: pandoc document conversion failed with error 83 Execution halted

Whats going on?

Upvotes: 4

Views: 8905

Answers (1)

scoa
scoa

Reputation: 19867

knitr expects all paths to be either absolute or relative to your current R working directory. In an Rstudio project, the working directory is that where the project has been created (you can check this with getwd()).

You need to either adapt your YAML header to:

---
bibliography: /path/to/library.bib
---

Or copy library.bib in your current rstudio project's folder

Upvotes: 4

Related Questions