Skip to content

Instantly share code, notes, and snippets.

@emilemathieu
Created October 30, 2020 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emilemathieu/de8a7ad8f6c8c129c5360bf79f75988f to your computer and use it in GitHub Desktop.
Save emilemathieu/de8a7ad8f6c8c129c5360bf79f75988f to your computer and use it in GitHub Desktop.
makefile for latex compiling
LATEX=pdflatex
LATEXOPT=--shell-escape
NONSTOP=--interaction=batchmode#--interaction=nonstopmode
LATEXMK=latexmk
LATEXMKOPT=-pdf
MAIN=main
all: clean
$(LATEXMK) $(LATEXMKOPT) $(NONSTOP) -pdflatex="$(LATEX) $(LATEXOPT) %O %S" $(MAIN)
make clean
make split
clean:
$(LATEXMK) --c $(MAIN)
rm -rf *~ *.tmp
split:
pdftk $(MAIN).pdf cat 1-13 output core.pdf
pdftk $(MAIN).pdf cat 14-r1 output supplementary.pdf
.PHONY: all clean
@talesa
Copy link

talesa commented Nov 15, 2020

What does NONSTOP=--interaction=batchmode#--interaction=nonstopmode do?

@talesa
Copy link

talesa commented Nov 15, 2020

PS I usually use a much simpler Makefile, texi2pdf does the entire latex/bibtex/latex dance for you, and --tidy puts all the aux files in a separate subfolder main.t2d

main :
	texi2pdf --shell-escape --tidy main.tex

clean :
	rm -rf main.t2d
	make

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment