-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (42 loc) · 1.68 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Latex Makefile using latexmk
# Modified by Dogukan Cagatay <dcagatay@gmail.com>
# Originally from : http://tex.stackexchange.com/a/40759
LATEX=pdflatex
# Use -synctex=1 for sync with PDF viewer and Editor
LATEXOPT=--shell-escape
# interaction=nonstopmode keeps the pdflatex backend from stopping at a
# missing file reference and interactively asking you for an alternative.
# Using nonstopmode or batchmode
NONSTOP=--interaction=batchmode
BUILDDIR=builddir
LATEXMK=latexmk
LATEXMKOPT=-bibtex -pdf -outdir=$(BUILDDIR) \
-pdflatex="$(LATEX) $(LATEXOPT) $(NONSTOP)" \
-use-make
# CONTINUOUS=-pvc
# Change only the variable below to the name of the main tex file.
PROJNAME=main
# FIGURES := $(shell find images/* -type f)
# You want $(LATEXMK) to *always* run, because make does not have all the info.
# Also, include non-file targets in .PHONY so they are run regardless of any
# file of the given name existing.
.PHONY: all clean clean-all lint
# The first rule in a Makefile is the one executed by default ("make"). It
# should always be the "all" rule, so that "make" and "make all" are identical.
all: $(PROJNAME).pdf
# `-pdf' tells $(LATEXMK) to generate PDF directly (instead of DVI).
# `-pdflatex' tells $(LATEXMK) to call a specific backend with specific options.
# use-make tells $(LATEXMK) to call make for generating missing files.
%.pdf: %.tex
$(LATEXMK) $(LATEXMKOPT) $<
$(PROJNAME).pdf: $(PROJNAME).tex
$(LATEXMK) $(LATEXMKOPT) $<
lint: $(PROJNAME).tex
-lacheck $<
-chktex $<
$(LATEXMK) $(LATEXMKOPT) $<
clean:
$(LATEXMK) -c -outdir=$(BUILDDIR)
# -bibtex also removes the .bbl files (http://tex.stackexchange.com/a/83384/79184).
clean-all:
$(LATEXMK) -C -bibtex -outdir=$(BUILDDIR)