I am currently writing a vignette for an R package (in a quite complicated workflow, since the vignette is primarily written in Org-mode and then translated in .Rnw... okay, I'm not taking the easy way). So the vignette is basically made from a .Rnw file when the package builds.
In this vignette, I would like to use syntax highlighting with the minted LaTeX package. But this package requires to use LaTeX with the argument shell-escape
.
Thus, when I try to build my package with R CMD build
, I get the following error:
* creating vignettes ... ERROR
--- re-building ‘vignette.Rnw’ using Sweave
Error: processing vignette 'vignette.Rnw' failed with diagnostics:
l'exécution de 'texi2dvi' sur 'vignette.tex' failed
LaTeX errors:
! Package minted Error: You must invoke LaTeX with the -shell-escape flag.
I have no idea how I could specify that R must use this flag when it tries to build the vignette with LaTeX.
Thanks for your help!