Skip to content

Instantly share code, notes, and snippets.

@cboettig
Created December 12, 2011 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cboettig/1469063 to your computer and use it in GitHub Desktop.
Save cboettig/1469063 to your computer and use it in GitHub Desktop.
Makefile for Sweave documents to use nicer syntax highlighting
RSCRIPT = Rscript
pdfclean:
rm -f *.pdf
clean:
rm -f index.html
rm -f *.tex *.bbl *.blg *.aux *.out *.log *.spl
all: pmc.pdf
pmc.pdf: pmc/pmc.Rnw
cp -f pmc/pmc.Rnw .
$(RSCRIPT) --vanilla -e "require(highlight); driver <- HighlightWeaveLatex(boxes = TRUE); Sweave( 'pmc.Rnw', driver = driver );"
# $(RSCRIPT) -e "tools::texi2dvi( 'pmc.tex', pdf = TRUE, clean = FALSE )"
# bibtex pmc
$(RSCRIPT) -e "tools::texi2dvi( 'pmc.tex', pdf = TRUE, clean = TRUE )"
# cp pmc/pmc-fake.Rnw pmc.Rnw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment