Makefile for LaTeX

# 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: *.pdf

# pdf tells latexmk to generate a PDF 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.
# interaction=nonstopmode keeps the pdflatex backend from stopping at missing file reference and interactively asking you for an alternative.
# synctex=1 is required to jump between the source PDF and the text editor.
# pvc (preview continuously) watches the directory for changes.
# quiet suppresses most status messages (
.PRECIOUS: *.pdf
*.pdf: *.tex
	latexmk -quiet -bibtex $(PREVIEW_CONTINUOUSLY) -f -pdf -pdflatex="xelatex -file-line-error -synctex=1 -interaction=nonstopmode -shell-escape %S %O -verbose" -use-make *.tex

# The .PHONY rule keeps make from processing a file named "watch" or "clean".
.PHONY: watch

# Set the PREVIEW_CONTINUOUSLY variable to -pvc to switch latexmk into the preview continuously mode.
watch: *.pdf

.PHONY: clean cleanall

# -bibtex also removes the .bbl files (
	latexmk -c -bibtex *.tex

	latexmk -C -bibtex *.tex

Additional Info

If there is an error while running 'make' command which prompts the following,
:makefile:4: *** missing separator. Stop.
check out [this solution] with funny remarks given by nsd:
cat -e -t -v


Kali terakhir halaman ini dikemaskini/disemak semula adalah pada .