首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >编织机-pandoc-citeproc编译pdf输出时的错误

编织机-pandoc-citeproc编译pdf输出时的错误
EN

Stack Overflow用户
提问于 2016-01-30 15:35:24
回答 1查看 2.7K关注 0票数 5

有人能帮我解决这个错误吗?当我试图用西班牙语编译一个.Rmd文档时,遇到了下一个错误,该文件是一个外部的胶乳.bib文件。

代码语言:javascript
复制
---
title: "Untitled"
output: 
  pdf_document: 
    fig_caption: yes
bibliography: biblio.bib
lang: spanish
---

错误信息是:

代码语言:javascript
复制
  |.................................................................| 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

关于这个会议的信息:

代码语言:javascript
复制
> 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  

如果我这么做是为了分离,那是可行的:

代码语言:javascript
复制
---
title: "Untitled"
output: 
  pdf_document: 
    fig_caption: yes
bibliography: biblio.bib
---

代码语言:javascript
复制
---
title: "Untitled"
output: 
  pdf_document: 
    fig_caption: yes
lang: spanish
---

当我尝试改变yaml

代码语言:javascript
复制
lang: es-ES

给出此错误:

代码语言:javascript
复制
! 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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-02-04 19:27:38

您的rmarkdown版本似乎太老了。我想你需要update.packages(ask = FALSE)。最新版本的rmarkdown使得在使用pdf_documentcitation_package参数时不使用pandoc-citeproc处理书目成为可能。

代码语言:javascript
复制
---
title: "Untitled"
output: 
  pdf_document: 
    fig_caption: yes
    citation_package: natbib
bibliography: biblio.bib
lang: spanish
---
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35103571

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档