Resources‎ > ‎LaTeX‎ > ‎

Including SVG

The Inkscape now has a support for exporting a SVG file to a EPS file on the command line.  This allows you to generate the necessary PDFs for inserting into LaTeX documents from Makefiles.  Thus your paper/presentation repository can be kept in a source-only condition (highly desirable, otherwise you end up with version-skew between source and generated files). A basic Makefile for this looks like:

SRC=thesis
REPORT=$(SRC).pdf
DIAGRAM=myimage.svg
DIAGRAMeps=$(DIAGRAM:.svg=.eps)
DIAGRAMpdf=$(DIAGRAM:.svg=.pdf)

all: $(REPORT)

$(REPORT): $(SRC).tex $(DIAGRAMpdf)
    pdflatex $(SRC).tex && bibtex $(SRC) && pdflatex $(SRC).tex && pdflatex $(SRC).tex && wc -w *.tex */*.tex

$(DIAGRAMpdf): $(DIAGRAMeps)
    epstopdf $(DIAGRAMeps)

$(DIAGRAMeps): $(DIAGRAM)
    inkscape -E $(@) $(DIAGRAM)

clean:
    rm -f *~ *.aux *.log *.snm *.out *.toc *.nav $(DIAGRAMeps) $(DIAGRAMpdf) *.dvi $(SRC).ps $(SRC).pdf

Comments