My current Makefile for weaving looks something like:
SUFFIXES: .tex .pdf .Rnw
MAIN = lecture
INCLUDES = chapter1.tex chapter2.tex ...
all: $(INCLUDES) $(MAIN).pdf
$(MAIN).pdf: $(INCLUDES) $(MAIN).tex
.Rnw.tex:
R CMD Sweave $*.Rnw
.tex.pdf:
pdflatex $*.tex
<snip>
Suppose I want to change the Sweave driver to use the highlight package (say). What’s the best way of doing this?
You could do what we do for the Rcpp* packages. Here is RcppGSL:
This keeps the actual source and a ‘fake’ variant in a subdirectory
inst/doc/RcppGSL/to trick R into recreating the pdf only when we want it too—otherwise it sees an Rnw and pdf of the same basename and is happy.
A little more convoluted than the basic
Makefileyou started with, but currently stillthe only way to switch to highlight that we know.