Error: pandoc document conversion failed with error 2 with pkgdown / rmarkdown
I am trying to create a website with pkgdown , so I ran pkgdown::build_site()
.
This throws the following error:
Construction article 'index.html'
Error: pandoc document conversion failed with error 2
There was a similar problem on SO but the answer didn't solve my problem.
My guess was that the problem was the title of my vignette , which is currently:
output:
rmarkdown::html_vignette:
smart: false
toc: true
I tried to change it to:
output: rmarkdown::html_vignette
as it is used in the pkgdown vignette . When I used this code I got an error and the vignette didn't build.
- smart / -S removed. Use + smart or -smart instead. For example: pandoc -f markdown + smart -t markdown-smart. Try pandoc.exe --help for more information. Error: pandoc document Conversion error with error 2 Optional: Warning message: command "C: / PROGRA ~ 2 / Pandoc / pandoc" + RTS -K512m -RTS Introduction.utf8.md --to html - from markdowns + autolink_bare_uris + ascii_identifiers + tex_math_single_backslash --output pandoc23e071f76af6.html --smart --email-obfuscation none - independently --standalone --section-divs --template "C: \ Users \ E \ Documents \ R \ win-library \ 3.4 \ rmarkdown \ Rmd \ h \ default.html "- glare style pigments --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 "'has status 2 Execution paused
I changed the title as suggested here so that:
output:
html_document:
smart: false
This title inserts a vignette, but I still get the same pandoc error when using build_site()
.
Pandoc is version 2.0. sessionInfo()
returns:
R version 3.4.1 (2017-06-30) Platform: x86_64-w64-mingw32 / x64 (64-bit) Runs on: Windows 7 x64 (Build 7601) Service Pack 1
Matrix products: default
locale:
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.1252base packages included: grDevices utils graphics statistics
database methods databaseother attached packages: pkgdown_0.1.0.9000 devtools_1.13.2
loaded via namespace (and not connected): 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
Any ideas how to fix this?
EDIT:
I ran everything on Ubuntu and I managed to get it working (see the repo ). Still not sure what caused the problem. Here's the result sessionInfo()
:
R version 3.3.3 (2017-03-06) Platform: x86_64-pc-linux-gnu (64-bit) Works under: Ubuntu 16.04.2 LTS
locale:
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 = ru_GB.AMEUTF-8
LC_PAPER = en_GB.UTF = C C
LC_TELEPHONE = C LC_MEASUREMENT = en_GB.UTF-8 LC_IDENTIFICATION = Cbase packages included: grDevices utils graphics statistics
database methods databaseother attached packages: pkgdown_0.1.0.9000 devtools_1.13.1
loaded via namespace (and not attached): 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
source to share
Warning occurs because it uses the argument --smart
: ... running command '"C:/PROGRA~2/Pandoc/pandoc" ... --smart ... "'
. Because --smart/-S has been removed
for Pandoc 2.0, this is a problem. So, remove --smart
from the caller or command line to fix this.
In Pandoc 2+, using the smart interface is the same as using any other extension. To enable it, you add +smart
to the argument, --to
or --from
, or perhaps both. To disable, add -smart
.
For example:
- in html + smart
Or maybe:
- from markdown + autolink_bare_uris + ascii_identifiers + tex_math_single_backslash-smart
source to share