This is a template for latex documents. While common mathematics-related latex commands and packages are used, the makefile will be of use for any type of document.
If you just want to easily compile latex documents and aren't interested in the draft version capabilities (see below), you may wish to try latexmk instead. In terms of simply compiling documents, the primary difference between this project and latexmk is that I don't know how to use latexmk.
Included are several make targets:
final: Simply builds the document.
finalbib: Build the bibliography.
finalre: Forcibly rebuilds the document, and if it doesn't exist, builds it twice. This handles changing of labels.
finalall: Performs a complete build (equivalent to
In short: use
make final after normal changes, use
make finalre after
changes involving labels, and use
make finalall after modifying the
There are also the targets
which do the same but build draft versions (see below). Finally, there is the
all target, which will build both the draft and final versions.
The default build target is
draft, though this is easily modifiable. This is
for convenience, as it will be by far the most used target when writing
Draft and final versions
If the document is built as a draft, it is built with the macro
1. This triggers the following effects:
- The document class is set with the parameter
draft, for use with the
- Labels are shown on the left side of the page
\todonotes are displayed.
- The command
\norefwill produce a red question mark.
- The current git revision is displayed below the title.
On final builds, the above are all hidden.
The makefile contains all the information required for configuring it. Take
note of how to build a document with no bibliography; you must remove the
BIBDEPENDENCIES line and uncomment the
.IGNORE: $(BIBTARGETS) line. If
you do this, you can perform full builds using
all will still work, performing redundant steps).
By default, when in draft mode, the generated document will display the most
recent git commit short SHA1 and message. This is done by writing to
.revisioninfo inside the makefile. The filename used can be modified by
changing it once
Makefile and once in
template.tex (you will probably want
to change it in
.gitignore too). To disable the output all together (for
example if you aren't using git), simply delete these sections.
A full build (eg
finalall) consists of the following steps:
pdflatexto build the
.auxfile, containing all used citations
bibtexto build the
.bblfile using the
.auxfile. This contains the required bibliography entries.
pdflatexto rebuild the
.auxfile by adding the found citations from the
pdflatexto produce the final