Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

markdown

r

pandoc

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?

like image 508
Jamie Dunning Avatar asked Oct 25 '25 15:10

Jamie Dunning


1 Answers

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

like image 85
scoa Avatar answered Oct 27 '25 03:10

scoa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!