-
Install TeXLive. It’s the One True™ TeX distribution system.
-
Need help?
texdoc <packagename>on the command line.- At the very least skim the documentation of every package you’re using, to look for gotchas and interesting options
-
Still need help? Google, http://tex.stackexchange.com
-
If you are Jon Snow (you know nothing):
texdoc lshort– “The not so short introduction to LaTeX” -
Learn the basics of typography: LaTeX supports you but it won’t coddle you
- Use typographically correct punctuation and spacing
- English quotes:
“…”(or``…'') - Need a minus sign: math mode!
- Use wide margins, narrow text
- But do use the margins when it makes sense
- By all that’s holy: USE SINGLE LINE SPACING.
- Correctly typeset gene names, protein names, species names (italic, straight, italic) …
-
Don’t use outdated packages
- Use
polyglossiainstead ofbabel - Use
biblatex, notbibtex - Don’t use
inputenc,utf8…
- Use
-
The golden rule of TeX: Use semantic markup: write macros to encapsulate style into semantically meaningful units
-
LaTeX is unforgiving, but not forthcoming with error messages. Use
nagto get better warnings (see example template for usage). -
\figureand\tableare floating environments. They float. That is their purpose. If you really want figures with a fixed position (but consider this carefully), don’t use\figure, and use\captionofto create a non-floating caption. -
Use
latexmkto build your document- It automatically runs the required auxiliary programs (
bibtex,biber…), and the necessary number of times - Want live preview?
latexmk -pvc - Highly configurable, but works well out of the box
- It automatically runs the required auxiliary programs (
-
On OS X? Use Skim as the document viewer instead of Preview.app.
-
Use XeLaTeX/LuaTeX. Do not use
pdfLaTeXpdfLaTeXis old and revered – let it rest in peace- In particular, no support for UTF-8 (yes: not even with auxiliary packages)
- No great support for non-8-bit fonts
latexmk -xetex
-
Want to change margins/metrics? Do not muck around with lengths, use
geometry -
Don’t use the standard document classes, use the replacements from KOMA-Script
- Don’t be put off by the fact that KOMA’s
\maketitlecreates lots of pages. This is intentional – read the relevant section in the documentation.
- Don’t be put off by the fact that KOMA’s
-
Some bibliography managers allow exporting BibTeX references with custom cite keys (usually of the format
Author:Year) – this makes usage with LaTeX vastly easier -
For numbers and units in text, use
siunitx. I recommend not using naked numbers in text at all (always use\num{x}instead). -
todonotesfor “TO DO”s. However, this interacts badly withclassicthesis. -
Avoid writing non-simple macros: programming in LaTeX is a nightmare. Use existing packages instead.
-
Use Git from the start, commit changes religiously and have a look at
gitinfo2(helpful for the revision phase) -
Organisation
- One file per chapter
- Use logical names, not
chapter1.texetc so the otder can be changed effortlessly
- Use logical names, not
- Have an outline handy (separate document)
- Configuration separate from main document
- One file per chapter
-
Use
classicthesisin combination with KOMA’sscrbook.- Based on best practices of print design and typography
- No, its margins are not too wide
-
University of Cambridge templates exist. However, they are a typographer’s nightmare (cf. line spacing, text width) and extremely convoluted, thus hard to customise
- Template from Engineering department
- Used by Nenad, had some bugs and we took days to fix some margin problems
- However, updated since, maybe better now
- Template from Computer Science department
- Used by Samuel, successfully
- Template from Engineering department
The example file thesis.tex contains the outline for a thesis source document.
Each chapter has its own file and is included via \input. Configuration and
custom macros reside in config.tex. This is also where packages should be
loaded.
.latexmkrc is the configuration for latexmk. At the moment it is empty
except for a commented-out line which would cause it to pass the -shell-escape
option to xelatex. This option is required by certain packages, such as
minted.
Finally, the Makefile enables compilation via simple make verbs. To
recompile the document, use
make
# or
make thesisTo trigger continuous background compilation for interactive preview, use
make previewThe example file requires the following fonts to be available for successful compilation:
- TeX Gyre Pagella
- Droid Sans
- Droid Sans Mono
Download the fonts (for the last two, go on the website and click the “download”/arrow button) and install them on your system.
Need inspiration? Take a look here:
texdoc tikztexdoc pgfplots- Showcase of beautiful typography done in TeX