簡體   English   中英

編譯pdf輸出時編譯-pandoc-citeproc錯誤

[英]knitr -pandoc-citeproc error when compiling pdf output

有人可以幫我解決這個錯誤嗎? 當我嘗試使用外部乳膠.bib文件編譯西班牙語的.Rmd文檔時,我遇到了下一個錯誤

---
title: "Untitled"
output: 
  pdf_document: 
    fig_caption: yes
bibliography: biblio.bib
lang: spanish
---

並且錯誤消息是:

  |.................................................................| 100%
label: unnamed-chunk-3 (with options) 
List of 2
 $ echo   : logi FALSE
 $ results: chr "asis"


/usr/bin/pandoc bib.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output bib.pdf --filter /usr/bin/pandoc-citeproc --template /home/juanchi/R/x86_64-pc-linux-gnu-library/3.2/rmarkdown/rmd/latex/default.tex --highlight-style tango --latex-engine pdflatex --variable 'geometry:margin=1in' --bibliography biblio.bib 
output file: bib.knit.md

pandoc-citeproc: could not find locale data for spanish
pandoc: Error running filter /usr/bin/pandoc-citeproc
Filter returned error status 1
Error: pandoc document conversion failed with error 83

使用此會話信息:

> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 15.10

locale:
 [1] LC_CTYPE=pt_BR.UTF-8       LC_NUMERIC=C               LC_TIME=pt_BR.UTF-8       
 [4] LC_COLLATE=es_ES.UTF-8     LC_MONETARY=pt_BR.UTF-8    LC_MESSAGES=es_ES.UTF-8   
 [7] LC_PAPER=pt_BR.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=pt_BR.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] htmltools_0.2.6   tools_3.2.2       yaml_2.1.13       rmarkdown_0.6.2.2
[5] knitr_1.10.5      digest_0.6.8  

如果我這樣做是為了分離它的工作原理:

---
title: "Untitled"
output: 
  pdf_document: 
    fig_caption: yes
bibliography: biblio.bib
---

要么

---
title: "Untitled"
output: 
  pdf_document: 
    fig_caption: yes
lang: spanish
---

當我嘗試改變yaml

lang: es-ES

給出了這個錯誤:

! Package babel Error: Unknown option `es-ES'. Either you misspelled it
(babel)                or the language definition file es-ES.ldf was not found.


See the babel package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.299 \ProcessOptions*

pandoc: Error producing PDF from TeX source
Erro: pandoc document conversion failed with error 43

您的rmarkdown版本似乎太舊了。 我認為你需要update.packages(ask = FALSE) 當您使用pdf_documentcitation_package參數時,最新版本的rmarkdown使得不能使用pandoc-citeproc處理參考書目,例如

---
title: "Untitled"
output: 
  pdf_document: 
    fig_caption: yes
    citation_package: natbib
bibliography: biblio.bib
lang: spanish
---

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM