# This is the RSI makefile, written by quentin 06/25/2008 # To use: # athena% make filename.pdf -- turns filename.tex into filename.pdf # athena% make -- turns main.tex into main.pdf # athena% make clean -- removes temporary files, leaving *.tex # This target makes a plain "make" create main.pdf from main.tex all: main.pdf # This loads the LaTeX environment variables from the rsi locker. include /mit/rsi/misc/texenv.make # LATEX_ARGUMENTS specifies the arguments to pass to latex. # # -shell-escape allows the .tex document to execute shell commands, # which is used by our templates to convert .eps files into .pdf files # that can be used by pdflatex. # # Additional arguments: # --interaction batchmode causes latex to immediately exit on error, # instead of prompting you for what to do. # LATEX_ARGUMENTS ?= -shell-escape # above line commented by jhurwitz, 6/20/10, after discussion with cmihelic # This target instructs make on how to create a .pdf file from a .tex file %.pdf: %.tex (pdflatex $(LATEX_ARGUMENTS) $< && bibtex $< && pdflatex $(LATEX_ARGUMENTS) $< && pdflatex $(LATEX_ARGUMENTS) $<)\ || (rm $@ && echo "YOUR FILE $< FAILED TO COMPILE. SCROLL UP FOR ERRORS." && exit 2) # pdflatex needs to be run twice, once to generate the table of # contents (set of references), and then once to insert those # references into the document. # This target instructs make on how to make .tex.d files, which tell # make which .tex files are \included by other .tex files %.tex.d: %.tex /mit/rsi/scripts/maketexdmake.pl $< $@ # This is a list of every .tex file in the current directory texfiles = $(wildcard *.tex) # This includes the .tex.d files for each of those files, which causes # make to generate them if missing. include $(texfiles:.tex=.tex.d) # You can run "make clean" to delete generated .aux, .log, .pdf, and # .tex.d files. .PHONY means that "clean" isn't a real target. .PHONY: clean clean: -rm $(texfiles:.tex=.aux) $(texfiles:.tex=.log) $(texfiles:.tex=.pdf) $(texfiles:.tex=.tex.d) # This causes failure if someone tries to make # {paper,abstract,cover,biblio,preamble}.pdf in a Paper ifeq ($(wildcard main.tex),main.tex) paper.pdf abstract.pdf cover.pdf biblio.pdf preamble.pdf : exit 13 # YOU NEED TO RUN make main.pdf TO COMPILE YOUR PAPER endif