错误:pkgdown / rmarkdown 的 pandoc 文档转换失败,错误 2

epo*_*po3 5 yaml r pandoc r-markdown r-package

我正在尝试使用pkgdown建立一个网站,所以我运行了pkgdown::build_site().

这会引发以下错误:

构建文章“index.html”

错误:pandoc 文档转换失败,错误 2

SO 上也有类似的问题,但答案并没有解决我的问题。

我的猜测是问题出在我的小插图的标题中,目前是:

output: 
  rmarkdown::html_vignette:
    smart: false
    toc: true
Run Code Online (Sandbox Code Playgroud)

我尝试将其更改为:

output: rmarkdown::html_vignette
Run Code Online (Sandbox Code Playgroud)

因为它在 pkgdown 的vignette中使用。当我使用该代码时,出现错误并且插图未构建。

--smart/-S 已被删除。请改用 +smart 或 -smart 扩展。例如:pandoc -f markdown+smart -t markdown-smart。尝试 pandoc.exe --help 以获取更多信息。错误:pandoc 文档转换失败,错误 2 另外:警告消息:运行命令 '"C:/PROGRA~2/Pandoc/pandoc" +RTS -K512m -RTS Introduction.utf8.md --to html --from markdown+ autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --输出 pandoc23e071f76af6.html --smart --email-obfuscation none --self-contained --standalone --section-divs --template "C:\Users\E\Documents\R\win-库\3.4\rmarkdown\rmd\h\default.html" --highlight-style pygments --css "C:\Users\E\Documents\R\win-library\3.4\rmarkdown\rmarkdown\templates\html_vignette\resources \vignette.css" --mathjax --variable "mathjax-url: https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML "' 状态 2 执行已停止

我按照此处的建议将标题更改为:

output:
  html_document: 
    smart: false
Run Code Online (Sandbox Code Playgroud)

这个标题编织了一个小插图,但在使用时我仍然遇到相同的 pandoc 错误build_site()

Pandoc 是 2.0 版本。sessionInfo()返回:

R 版本 3.4.1 (2017-06-30) 平台:x86_64-w64-mingw32/x64(64 位) 运行环境:Windows 7 x64(内部版本 7601)Service Pack 1

矩阵产品:默认

区域设置:

LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
LC_TIME=English_United Kingdom.1252

附加基础包: 统计图形 grDevices utils
数据集 方法基础

其他附加软件包:pkgdown_0.1.0.9000 devtools_1.13.2

通过命名空间加载(且未附加):MASS_7.3-47
compiler_3.4.1 magrittr_1.5 R6_2.2.2 tools_3.4.1
withr_1.0.2 roxygen2_6.0.1 Rcpp_0.12.12 memoise_1.1.0 xml2_1.1.1 stringi_1.1.5 stringr_1.2.0摘要_0。 6.12
commonmark_1.2 rlang_0.1.1.9000

有什么想法如何修复它吗?

编辑:

我在 Ubuntu 上运行了整个过程,并设法使其工作(请参阅存储库)。仍然不知道是什么导致了这个问题。这是输出sessionInfo()

R 版本 3.3.3 (2017-03-06) 平台:x86_64-pc-linux-gnu(64 位) 运行环境:Ubuntu 16.04.2 LTS

区域设置:

LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C
LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8
LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
LC_PAPER=en_GB.UTF-8 LC_NAME=C LC_ADDRESS= C
LC_TELEPHONE=C LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C

附加基础包: 统计图形 grDevices utils
数据集 方法基础

其他附加软件包:pkgdown_0.1.0.9000 devtools_1.13.1

通过命名空间加载(且未附加):MASS_7.3-45
magrittr_1.5 R6_2.2.2 tools_3.3.3 withr_2.0.0
roxygen2_6.0.1 Rcpp_0.12.12 memoise_1.1.0 xml2_1.1.1
stringi_1.1.2 stringr_1.2.0摘要_0.6.12 commonmark_1。 2 rlang_0.1.1

zer*_*2cx 3

发出警告是因为--smart此处使用了该参数:... running command '"C:/PROGRA~2/Pandoc/pandoc" ... --smart ... "'。因为--smart/-S has been removed对于 Pandoc 2.0 来说,这是一个问题。因此,请--smart从调用者或命令行中删除以解决此问题。

在 Pandoc 2+ 中,smart 的用法与任何其他扩展相同。要启用它,您可以将其附加+smart到 it--to--from参数,或者可能同时附加到两者。要禁用,请附加-smart.

例如:

--html+智能

或者可能:

--来自markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-smart