local/buildVig.R

#!/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())  # highlighting set in Rnw
    tools::texi2pdf(gsub(".Rnw", ".tex", srcfile))
}))
eddelbuettel/rcppgsl documentation built on March 27, 2024, 12:16 p.m.