我有以下文档,我正在尝试使用Rstudio进行编译:
---
title:
shorttitle:
author:
bibliography:
- library.bib
output: papaja::apa6_pdf
---
```{r message = FALSE, warning = FALSE}
library("papaja")
apa_prepare_doc() # Prepare document for rendering
```
# Introduction
@Bakan1966
# References
```{r create_r-references}
r_refs(file = "r-references.bib")
```
当我运行knit时,它会编译.md文件,但是pandoc会出错:
pandoc-citeproc: "stdin" (line 232, column 2):
unexpected "a"
expecting "c", "C", "p", "P", "s" or "S"
pandoc: Error running filter /Applications/RStudio.app/Contents/MacOS/pandoc/pandoc-citeproc
Error: pandoc document conversion failed with error 83
In addition: Warning messages:
1: In yaml::yaml.load(enc2utf8(string), ...) :
NAs introduced by coercion: 1,2,3 is not an integer
2: In yaml::yaml.load(enc2utf8(string), ...) :
NAs introduced by coercion: 1,2,3 is not an integer
Execution halted
我在不同的主题上发现了类似的问题,但提议的解决方案都没有为我工作......
答案 0 :(得分:9)
"Solved".
The problem comes from my library.bib file.
I have generated it using Mendeley, which has inserted a lot of special characters that are not supported by pandoc-citeproc...
答案 1 :(得分:3)
这可能是pandoc-citeproc问题。要进行诊断,请手动运行rmarkdown::render
,例如:
rmarkdown::render(output_format = "html_document", input = your_vignette, clean = FALSE)
就我而言,我需要将.bib
添加到小插图的YAML标题中的bibliography: bibfile
行。
答案 2 :(得分:1)
在编织应用arules::apriori()
的rmarkdown文件时遇到错误83。
---
title: "[**Pattern Discovery in Data Mining** *Programming Assignment: Frequent Itemset Mining Using Apriori*](https://www.coursera.org/learn/data-patterns)"
subtitle: "[**Data Mining** *by University of Illinois at Urbana-Champaign*](https://www.coursera.org/specializations/data-mining)"
author: "[®γσ, Eng Lian Hu](http://englianhu.wordpress.com) <img src='figure/ShirotoNorimichi2.jpg' width='24'> 白戸則道®"
date: "`r Sys.Date()`"
output:
tufte::tufte_html:
toc: yes
tufte::tufte_handout:
citation_package: natbib
latex_engine: xelatex
tufte::tufte_book:
citation_package: natbib
latex_engine: xelatex
bibliography: skeleton.bib
link-citations: yes
---
删除该行后,其工作正常:bibliography: skeleton.bib
。
答案 3 :(得分:0)
如果您使用的是Mac,请打开终端并输入:
brew install pandoc-citeproc
或
brew upgrade pandoc-citeproc
如果无法正常工作,则需要降级到pandoc-citeproc的某个正常工作版本。
答案 4 :(得分:0)
呈现HTML文件时我遇到了相同的错误,但是解决我的问题的方法却有所不同:
我在YAML标头中指定了csl: nature.csl
。我不知道的是,我还必须下载nature.csl
文件,并在YAML标头中指定其路径。所以不用:
bibliography: references/library.bib
csl: nature.csl
我下载了nature.csl
文件,并放入了library.bib
所在的文件夹中。正确的YAML标头看起来像这样
bibliography: references/library.bib
csl: references/nature.csl