WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
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