Skip to content

Instantly share code, notes, and snippets.

@maxulysse
Created February 2, 2017 09:22
Show Gist options
  • Save maxulysse/f61a6401a8ef9f5e6b37cf37becd2fd1 to your computer and use it in GitHub Desktop.
Save maxulysse/f61a6401a8ef9f5e6b37cf37becd2fd1 to your computer and use it in GitHub Desktop.
MAIN = myThesis
THESIS = ${MAIN}.pdf
LOGS = ${MAIN}.aux ${MAIN}.bbl ${MAIN}.blg ${MAIN}.idx ${MAIN}.ilg ${MAIN}.ind ${MAIN}.lof ${MAIN}.log ${MAIN}.lot ${MAIN}.maf ${MAIN}.mtc* ${MAIN}.out ${MAIN}.toc
PNGS = $(shell find -type f -iname "*.svg" | sed 's/.svg/.png/g')
PDFS = $(shell find -type f -iname "*.svg" | sed 's/.svg/.pdf/g')
PDF_TEX = $(shell find -type f -iname "*.svg" | sed 's/.svg/.pdf_tex/g')
SVG2PNG = inkscape $< -e $@ -y 255 -d 180
SVG2PDF = inkscape -D -z --file=$< --export-pdf=$@ --export-latex
all: remove ${PNGS} ${PDFS} ${THESIS}
${THESIS}:
pdflatex ${MAIN}
@while ( grep "Rerun to get cross-references" ${MAIN}.log > /dev/null ); \
do \
bibtex ${MAIN}; \
pdflatex ${MAIN}; \
done
makeindex ${MAIN}; \
pdflatex ${MAIN}
@while ( grep "Rerun to get outlines " ${MAIN}.log > /dev/null ); \
do \
pdflatex ${MAIN}; \
done
rm -f ${LOGS}
figures/%.png: figures/%.svg
$(SVG2PNG)
figures/%.pdf: figures/%.svg
$(SVG2PDF)
remove:
rm -f ${THESIS}
clean: remove
rm -f ${LOGS} ${PNGS} ${PDFS} ${PDF_TEX}
log:
pdflatex ${MAIN}
@while ( grep "Rerun to get cross-references" ${MAIN}.log > /dev/null ); \
do \
bibtex ${MAIN}; \
pdflatex ${MAIN}; \
done
makeindex ${MAIN}; \
pdflatex ${MAIN}
@while ( grep "Rerun to get outlines " ${MAIN}.log > /dev/null ); \
do \
pdflatex ${MAIN}; \
done
rebuild: clean all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment