diff --git a/make-includes/standard_rules.make b/make-includes/standard_rules.make index 9dc479e..93549f7 100644 --- a/make-includes/standard_rules.make +++ b/make-includes/standard_rules.make @@ -27,7 +27,7 @@ # Default rules. # # -# PDF from LaTeX, typically for images drawn using PSTricks. +# PDF from LaTeX, typically for images drawn using PSTricks or TikZ. # %.pdf %-print.pdf: $(IMGDIR)/%.tex ifdef UNICODE @@ -226,24 +226,24 @@ # PDFs (previously it over-cropped slightly). # %.pdf %-print.pdf: %.svg - $(RSVG_CONVERT) -f pdf $< | $(PDFCROP) - $(IMGDIR)/$@ + $(RSVG_CONVERT) --format pdf $< | $(PDFCROP) - $(IMGDIR)/$@ # # PNG from SVG (via librsvg) # %.png %-print.png %-web.png: %.svg - $(RSVG_CONVERT) -f png -b white -z 4 $< | convert -trim -scale 30% -density 96 - $(IMGDIR)/$@ + $(RSVG_CONVERT) --format png --background-color white --zoom 4 $< | convert -trim -scale 30% -density 96 - $(IMGDIR)/$@ %-web-zoom.png: %.svg - $(RSVG_CONVERT) -f png -b white -z 4 $< | convert -trim -scale 45% -density 144 - $(IMGDIR)/$@ + $(RSVG_CONVERT) --format png --background-color white --zoom 4 $< | convert -trim -scale 45% -density 144 - $(IMGDIR)/$@ %-print-zoom.png: %.svg - $(RSVG_CONVERT) -f png -b white -z 4 $< | convert -trim -density 300 - $(IMGDIR)/$@ + $(RSVG_CONVERT) --format png --background-color white --zoom 4 $< | convert -trim -density 300 - $(IMGDIR)/$@ %-print-zoom-transparent.png: %.svg - $(RSVG_CONVERT) -f png -z 4 $< | convert -trim -density 300 - $(IMGDIR)/$@ + $(RSVG_CONVERT) --format png --zoom 4 $< | convert -trim -density 300 - $(IMGDIR)/$@ %-transparent.png: %.svg - $(RSVG_CONVERT) -f png -z 4 $< | convert -trim -scale 30% -density 96 - $(IMGDIR)/$@ + $(RSVG_CONVERT) --format png --zoom 4 $< | convert -trim -scale 30% -density 96 - $(IMGDIR)/$@ # # PNG from PNG (change the name). # These appear to need to be separate rules. If both variants need to be @@ -271,3 +271,20 @@ %.css: %.scss $(SASS) $< $@ +# +# SVG, PNG, TeX from PlantUML +# +%.svg: %.pu + $(PLANTUML) -tsvg -output $(IMGDIR) $< +%.png: %.pu + $(PLANTUML) -tpng -output $(IMGDIR) $< +%.tex: %.pu + $(PLANTUML) -tlatex:nopreamble -output $(IMGDIR) $< + $(MV) $(IMGDIR)/$*.latex $(IMGDIR)/$@ +# +# PDF from PlantUML +# Direct PDF from PlantUML is problematic, go via SVG instead. +# Note PlantUML generated diagrams are already minimal dimensions, so no need to crop. +# +%.pdf: %.pu + $(PLANTUML) -tsvg -pipe < $< | $(RSVG_CONVERT) --format pdf > $(IMGDIR)/$@