0

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!

Philopolis
  • 515
  • 4
  • 13
  • Not sure if you've already tried this, but see perhaps https://github.com/SublimeText/LaTeXTools/issues/1082 and a related discussion at https://support.rstudio.com/hc/en-us/articles/200532257-Customizing-LaTeX-Options – Weihuang Wong Jul 04 '19 at 14:58
  • Thanks for your reply! The first link did not work, and the second one could only helped to compile the file manually without errors... but without the colors either :) I think that minted just won't work if the Rnw file is "translated" from an Org file. Something is probably lost in between... Well, not a big deal, I'll juste write the vignette in markdown syntax. However, this other link might be a promising solution: https://stackoverflow.com/questions/46741739/how-to-use-makefiles-with-r-cmd-build?rq=1 ; I have no knowledge at all on makefiles but it may be a good place to start. ;) – Philopolis Jul 04 '19 at 15:42

0 Answers0