繁体   English   中英

带有 Rmarkdown 文件的 pandoc-citeproc 错误 83

[英]pandoc-citeproc error 83 with Rmarkdown file

我有以下文档,我正在尝试使用 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

我在不同的主题上发现了类似的问题,但没有一个提议的解决方案对我有用......

“解决了”。

问题来自我的 library.bib 文件。

我使用 Mendeley 生成了它,它插入了许多 pandoc-citeproc 不支持的特殊字符......

这很可能是 pandoc-citeproc 问题。 要诊断,请手动运行rmarkdown::render ,例如: rmarkdown::render(output_format = "html_document", input = your_vignette, clean = FALSE)

就我而言,我需要将.bib添加到bibliography: bibfile行的 YAML 小插图标题中。

当编织一个应用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

我在渲染 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

我得到Error: pandoc document conversion failed with error 83 in empty environments 如下所示。

错误的方法

```{example}

```

正确的方法

```{example}
Some content.
```

如果您使用的是Mac,请打开终端并键入:

brew install pandoc-citeproc

要么

brew upgrade pandoc-citeproc

如果不起作用,您需要降级到pandoc-citeproc的某个工作版本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM