From d351b5cb09b69fb1a26300bb5e7610596acfc0b3 Mon Sep 17 00:00:00 2001 From: Daniel Bosk Date: Fri, 15 May 2020 11:25:45 +0200 Subject: [PATCH] Adds pdfcrop to crop svg->pdf output --- doc.mk | 3 +++ doc.mk.nw | 3 +++ 2 files changed, 6 insertions(+) diff --git a/doc.mk b/doc.mk index 169fab5..0dd4a65 100644 --- a/doc.mk +++ b/doc.mk @@ -20,6 +20,8 @@ ODF2PDF?= soffice --convert-to pdf ODF2PDFFLAGS?=--headless INKSCAPE?= inkscape INKSCAPEFLAGS?= -D -z --export-latex +PDFCROP?= pdfcrop +PDFCROPFLAGS?= DIA?= dia DIAFLAGS?= XCF2PNGFLAGS?= -flatten @@ -75,6 +77,7 @@ todo: %.pdf: %.svg ${INKSCAPE} ${INKSCAPEFLAGS} --file=$< --export-pdf=$@ + ${PDFCROP} $@ %.ps: %.svg ${INKSCAPE} ${INKSCAPEFLAGS} --file=$< --export-ps=$@ diff --git a/doc.mk.nw b/doc.mk.nw index 08169f0..614a9c6 100644 --- a/doc.mk.nw +++ b/doc.mk.nw @@ -213,10 +213,13 @@ Unlike previously, we will only allow flags for [[inkscape]] to be set. <>= INKSCAPE?= inkscape INKSCAPEFLAGS?= -D -z --export-latex +PDFCROP?= pdfcrop +PDFCROPFLAGS?= @ <>= %.pdf: %.svg ${INKSCAPE} ${INKSCAPEFLAGS} --file=$< --export-pdf=$@ + ${PDFCROP} $@ @ We can thus create similar rules for the formats PS and EPS, instead of PDF. <>= %.ps: %.svg