Affects me in Manjaro with inkscape 0.91 from the official Arch repos, and affected me in Quirky compiled from source. For a while I resorted to 0.48 patched for compatibility with recent cairo and poppler, but now I'm using Hobbyblobby's solution with some adjustments:
The main difference is that the target is a file instead of .PHONY and the rule only generates the target (and its pdf or pdf_tex complement) rather than running through the whole svg directory. Make should recreate %.pdf and %.pdf_tex when at least one is missing or older than %.svg, for each %.svg in SVG2PDFTEX_SVG_FILES, but otherwise won't waste its time. One could specify the required figures manually per project instead of the wildcard and patsubst method, or maybe automatically when building with latexmk; I think I recall that it would attempt "make (file)" if pdflatex reported (file) were missing.
Affects me in Manjaro with inkscape 0.91 from the official Arch repos, and affected me in Quirky compiled from source. For a while I resorted to 0.48 patched for compatibility with recent cairo and poppler, but now I'm using Hobbyblobby's solution with some adjustments:
##MAKEFILE## data/figures SVG_FILES := $(wildcard $(FIG_DIR) /svg2pdftex_ in/*.svg) PDF_FILES= $(patsubst $(FIG_DIR) /svg2pdftex_ in/%.svg, $(FIG_DIR) /svg2pdftex_ out/%.pdf, $(SVG2PDFTEX_ SVG_FILES) ) TEX_FILES= $(patsubst $(FIG_DIR) /svg2pdftex_ in/%.svg, $(FIG_DIR) /svg2pdftex_ out/%.pdf_ tex,$(SVG2PDFTE X_SVG_FILES) )
FIG_DIR=
SVG2PDFTEX_
SVG2PDFTEX_
SVG2PDFTEX_
main.pdf: main.tex $(SVG2PDFTEX_ PDF_FILES) $(SVG2PDFTEX_ TEX_FILES)
# call your favourite build tool
$(FIG_DIR) /svg2pdftex_ out/%.pdf $(FIG_DIR) /svg2pdftex_ out/%.pdf_ tex: $(FIG_DIR) /svg2pdftex_ in/%.svg s.*page= " "$$(dirname $@)/$$(basename $< .svg).pdf_tex") ; do \ "$$(echo $$j | sed 's/^.*page= \([0-9] *\).*$$ /\1/g') " ; \ aphics. *page=' $$CHECKPAGE' .*$$//g' "$$(dirname $@)/$$(basename $< .svg).pdf_tex" ; \
inkscape -z -f $< --export-latex -A "$$(dirname $@)/$$(basename $< .svg).pdf" -C ; \
PAGES=$$(pdfinfo "$$(dirname $@)/$$(basename $< .svg).pdf" | grep Pages | cut -d" " -f11) ; \
for j in $$(egrep "includegraphic
CHECKPAGE=
if [ $$CHECKPAGE -gt $$PAGES ] ; then \
sed -i 's/^.*includegr
fi ; \
done
##MAKEFILE(END)##
wherein I use a multitarget pattern rule to allow make to decide when a figure needs to be reprocessed, and some automatic variables to get the target name and directory; see http:// www.gnu. org/software/ make/manual/ make.html# Pattern- Examples
The main difference is that the target is a file instead of .PHONY and the rule only generates the target (and its pdf or pdf_tex complement) rather than running through the whole svg directory. Make should recreate %.pdf and %.pdf_tex when at least one is missing or older than %.svg, for each %.svg in SVG2PDFTEX_ SVG_FILES, but otherwise won't waste its time. One could specify the required figures manually per project instead of the wildcard and patsubst method, or maybe automatically when building with latexmk; I think I recall that it would attempt "make (file)" if pdflatex reported (file) were missing.