diff --git a/make-includes/standard_rules.make b/make-includes/standard_rules.make index 73eaaa0..8d2cf43 100755 --- a/make-includes/standard_rules.make +++ b/make-includes/standard_rules.make @@ -92,6 +92,15 @@ %.pdf %-print.pdf: %.plo ploticus -eps -tightcrop -o stdout $< | shiftbbox | epstopdf --filter --outfile=$(IMGDIR)/$@ # +# PDF from R. +# This assumes that the first argument to the R script is the output filename +# for the resultant PDF. +# +%.pdf %-print.pdf: %.R + R --slave --file=$< --args "$(IMGDIR)/$@" + pdfcrop $(IMGDIR)/$@ + -mv $(IMGDIR)/$*-crop.pdf $(IMGDIR)/$@ +# # PDF from PS # %.pdf %-print.pdf: %.ps @@ -108,9 +117,9 @@ # because it crops slightly too closely. # %.pdf %-print.pdf: %.svg - inkscape --file=$< --without-gui --export-pdf=$(IMGDIR)/$*-tmp.pdf - pdfcrop $(IMGDIR)/$*-tmp.pdf $(IMGDIR)/$@ - -rm -f $(IMGDIR)/$*-tmp.pdf + inkscape --file=$< --without-gui --export-pdf=$(IMGDIR)/$@ + pdfcrop $(IMGDIR)/$@ + -mv $(IMGDIR)/$*-crop.pdf $(IMGDIR)/$@ # # PNG from SVG (via Inkscape) # This is weird: --export-pdf writes the output image exactly where you tell