Skip to content

Modifying an Rcpp Vignette

Dirk Eddelbuettel edited this page Jul 16, 2016 · 2 revisions

After making changes to the vignettes, please make sure to run them! For historical reason (such as no pandoc integration back in 2010 to 2011 when most of these were written or started) we use the highlight package you need to have installed. You also need a working LaTeX setup.

Then, in order to create the vignettes, you will need to use the following script:

#!/usr/bin/Rscript

## use given argument(s) as target files, or else default to .Rnw files in directory
files <- if (length(commandArgs(TRUE)) == 0) dir(pattern="*.Rnw") else commandArgs(TRUE)

## convert all files from Rnw to pdf using the highlight driver
invisible(sapply(files, function(srcfile) {
    Sweave(srcfile, driver=highlight::HighlightWeaveLatex(boxes=TRUE))
    tools::texi2pdf(gsub(".Rnw", ".tex", srcfile))
    tools::texi2pdf(gsub(".Rnw", ".tex", srcfile), texi2dvi="pdflatex")
}))
Clone this wiki locally