Last active
June 7, 2016 20:06
-
-
Save SunnyRaj/d32528aee32698c6b04404b4d309cc5c to your computer and use it in GitHub Desktop.
Makefile for compiling latex documents
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
target = paper | |
.PHONY: ${target}.pdf all clean | |
all: ${target}.pdf | |
# CUSTOM BUILD RULES | |
# In case you didn't know, '$@' is a variable holding the name of the target, | |
# and '$<' is a variable holding the (first) dependency of a rule. | |
# "raw2tex" and "dat2tex" are just placeholders for whatever custom steps | |
# you might have. | |
%.tex: %.raw | |
./raw2tex $< > $@ | |
%.tex: %.dat | |
./dat2tex $< > $@ | |
${target}.pdf: ${target}.tex | |
latexmk -pdf -pdflatex="pdflatex -interaction=nonstopmode" -use-make ${target}.tex | |
clean: | |
latexmk -CA | |
# Credit: http://tex.stackexchange.com/questions/40738/how-to-properly-make-a-latex-project |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment