Skip to content

Instantly share code, notes, and snippets.



Created Oct 5, 2014
What would you like to do?
LaTeX Makefile
# NOTE: Change "written" to the name of your TeX file with no extension
all: $(TARGET).pdf
## Generalized rule: how to build a .pdf from each .tex
LATEXPDFS=$(patsubst %.tex,%.pdf,$(wildcard *.tex))
$(LATEXPDFS): %.pdf: %.tex
pdflatex -interaction nonstopmode $(patsubst %.pdf,%.tex,$@)
rm *.aux *.log || true
veryclean: clean
rm $(TARGET).pdf
view: $(TARGET).pdf
if [ "Darwin" = "$(shell uname)" ]; then open $(TARGET).pdf ; else evince $(TARGET).pdf ; fi
submit: $(TARGET).pdf
cp $(TARGET).pdf ../
print: $(TARGET).pdf
lpr $(TARGET).pdf
.PHONY: all clean veryclean view print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.