2015-11-05 130 views
1

在單擊將針對參考列表添加引用的編織之後,Rmd引用文件x中的罰款,但是在文件y中,也是一個rmd文件,設置如下:R Markdown無法在一個項目中找到.bib文件,同時在另一個項目中正常工作

title: Swans 
bibliography: library.bib 
output: html_document 


[@Ticehurst1957] 
##bibloography 

織成後,我收到以下錯誤並沒有輸出

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

回事請告訴我?

+0

潛在退房http://stackoverflow.com/questions/25191744/ knitcitations-給-pandoc-citeproc錯誤?我只是搜索錯誤代碼,這似乎是合理的。 –

+0

你的rmarkdown和bib文件在哪裏?這可能是你的wd不是你想象的那樣,特別是如果你正在使用Rstudio項目和嵌套子目錄。你可以嘗試設置library.bib相對於你的項目根目錄 – scoa

+0

@scoa的路徑,似乎已經完成了這個伎倆。移動圍兜。文件與我當前的項目相同。謝謝你的幫助 –

回答

0

knitr預計所有路徑都是絕對的或相對於您的current R working directory。在Rstudio項目中,工作目錄是創建項目的地方(可以用getwd()進行檢查)。

您需要可以適應您的YAML頭:

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

或者在當前的rstudio項目的文件夾複製library.bib

相關問題