4

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?

Community
  • 1
  • 1
Jamie Dunning
  • 153
  • 1
  • 9
  • Potentially check out http://stackoverflow.com/questions/25191744/knitcitations-gives-pandoc-citeproc-error? I just googled the error code, and it seems reasonable. – Akhil Nair Nov 05 '15 at 15:59
  • where are your rmarkdown and bib file? It might be that your wd is not what you think it is, especially if you are working with an Rstudio project and nested subdirectories. You could try setting the path to library.bib relative to your project root – scoa Nov 06 '15 at 08:29
  • @scoa that seems to have done the trick. Moved the bib. File to the same as my current project. Thanks for your help – Jamie Dunning Nov 06 '15 at 09:55

1 Answers1

4

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

scoa
  • 19,359
  • 5
  • 65
  • 80