Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A sample makefile for a paper in LaTeX.
TEX = pdflatex -interaction nonstopmode
BIB = bibtex
GS = gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite
COVER = cover
PAPER = paper_main
SUPP = paper_supp
BIBFILE = temp.bib
BUNDLE = paper_bundle.pdf
all: $(COVER).pdf $(PAPER).pdf $(SUPP).pdf
$(GS) -sOutputFile=$(BUNDLE) $(COVER).pdf $(PAPER).pdf $(SUPP).pdf
view: $(BUNDLE)
open $(BUNDLE)
spell::
ispell *.tex
clean::
rm -fv *.aux *.log *.bbl *.blg *.toc *.out *.lot *.lof $(PAPER).pdf $(SUPP).pdf $(BUNDLE)
$(PAPER).pdf: $(PAPER).tex $(PAPER).bbl
$(TEX) $(PAPER)
$(TEX) $(PAPER)
$(PAPER).bbl: $(PAPER).tex $(BIBFILE)
$(TEX) $(PAPER)
$(BIB) $(PAPER)
$(SUPP).pdf: $(SUPP).tex $(SUPP).bbl
$(TEX) $(SUPP)
$(TEX) $(SUPP)
$(SUPP).bbl: $(SUPP).tex $(BIBFILE)
$(TEX) $(SUPP)
$(BIB) $(SUPP)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment