簡體   English   中英

錯誤:pandoc文檔轉換失敗,錯誤2與pkgdown / rmarkdown

[英]Error: pandoc document conversion failed with error 2 with pkgdown / rmarkdown

我正在嘗試使用pkgdown構建一個網站,所以我運行了pkgdown::build_site()

這會引發以下錯誤:

構建文章'index.html'

錯誤:pandoc文檔轉換失敗,錯誤2

在SO上有類似的問題 ,但答案並沒有解決我的問題。

我的猜測是問題出現在我的小插圖的標題中,目前是:

output: 
  rmarkdown::html_vignette:
    smart: false
    toc: true

我嘗試將其更改為:

output: rmarkdown::html_vignette

因為它在pkgdown的插圖中使用 當我使用該代碼時,我收到了一個錯誤,並且沒有構建插圖。

--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 --output pandoc23e071f76af6.html --smart --email-obfuscation none - self-contained --standalone --section-divs --template“C:\\ Users \\ E \\ Documents \\ R \\ win- library \\ 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

這個標題編織了一個小插圖,但在使用build_site()時我仍然得到相同的pandoc錯誤。

Pandoc是2.0版。 sessionInfo()返回:

R版本3.4.1(2017-06-30)平台:x86_64-w64-mingw32 / x64(64位)運行於:Windows 7 x64(build 7601)Service Pack 1

Matrix產品:默認

區域:

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

附加的基礎包:stats graphics 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 digest_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

附加的基礎包:stats graphics 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 digest_0.6.12 commonmark_1.2 rlang_0.1.1

提出警告是因為在這里使用了--smart這個參數: ... running command '"C:/PROGRA~2/Pandoc/pandoc" ... --smart ... "' 。因為--smart/-S has been removed用於Pandoc 2.0,這是一個問題。所以,從調用者或命令行中刪除--smart來解決這個問題。

在Pandoc 2+中,智能的使用與任何其他擴展的使用相同。 要啟用它,您將追加+smart要么在--to--from參數,或者可能是兩者。 要禁用,請附加-smart

例如:

- 到HTML +智能

或者可能:

--from markdown + autolink_bare_uris + ascii_identifiers + tex_math_single_backslash-smart

暫無
暫無

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

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