]> git.donarmstrong.com Git - lib.git/blobdiff - templates/makefiles/sweave_rules.mk
add some makefile templates
[lib.git] / templates / makefiles / sweave_rules.mk
diff --git a/templates/makefiles/sweave_rules.mk b/templates/makefiles/sweave_rules.mk
new file mode 100644 (file)
index 0000000..32b1a44
--- /dev/null
@@ -0,0 +1,15 @@
+R ?= R
+
+%.pdf: %.svg
+       inkscape -A $@ $<
+       pdfcrop $@
+       mv $(dir $@)*-crop.pdf $@
+
+%.png: %.svg
+       inkscape -e $@ -d 300 $<
+
+%.tex: %.Rnw
+       $(R) CMD Sweave --encoding=utf-8 $<
+
+%.pdf: %.tex $(wildcard *.bib) $(wildcard *.tex)
+       latexmk -pdflatex=xelatex -bibtex -use-make -pdf $<