4

After upgrading R to 3.1.2 and updating all packages I can no longer build vignettes.

devtools::build_vignettes(shdoe)

The output is as follows:

Building shdoe vignettes
Error : invalid version specification 'pandoc.exe 1.13.1'
Warning in engine$weave(file, quiet = quiet) :
  Pandoc is not available. Please install Pandoc.
Moving shdoe-intro.html, shdoe-intro.R to inst/doc/
Copying shdoe-intro.Rmd to inst/doc/

This is after an update of pandoc from version 1.12.x (which yielded the same error). My OS is windows 7, and Pandoc is on the PATH.

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
SaschaH
  • 351
  • 3
  • 10
  • The error I get (after `R CMD build `) after not finding pandoc is `Error: processing vignette 'translate_gen.Rmd' failed with diagnostics: object 'pb' not found`. According to the source of knitr, `pb` seems to come from [output.R](https://github.com/yihui/knitr/blob/master/R/output.R). Can you `pandoc /?`? I get an error `pandoc: /R: openFile: permission denied (Permission denied).` – Roman Luštrik Nov 13 '14 at 14:46
  • Note also that this happened to me for pandoc 1.9.1. – Roman Luštrik Nov 14 '14 at 10:07

1 Answers1

2

The problem is associated with the way knitr parses the version number returned by

pandoc.exe --version

which includes the name by which pandoc is called:

pandoc.exe 1.13.1
[...]

On windows, R's Sys.which('pandoc') which is used by knitr to get pandoc's executable yields <PATH TO PANDOC>\pandoc.exe, leading to the above call to get pandoc's version which then cannot be handled correctly by knitr.

The faulty code was introduced in knitr version 1.7 (before it used rmarkdown::pandoc_available() to check the availablilty of pandoc).

A workaround is to set the system variable RSTUDIO_PANDOC to <PATH TO PANDOC> (since knitr regards its presence sufficient).

SaschaH
  • 351
  • 3
  • 10