9. Troubleshooting and cheat sheet¶
9.1 Common errors¶
Message |
Usual cause |
Fix |
|---|---|---|
|
A misspelt command, or a missing package |
Check the spelling, or load the package |
|
Maths outside maths mode, or an unescaped |
Add |
|
Unbalanced braces |
Find the unmatched |
|
A package isn't installed |
Install it, or let MiKTeX do so |
|
A wrong image or input path |
Check the relative path |
|
The key is wrong, or BibTeX hasn't run |
Check the key, then run the full sequence |
|
A missing label, or too few runs |
Add the label, or compile again |
|
A line is too wide |
A warning, so rewrite if it's visible |
|
A name clash |
Rename your command, as with |
If a document breaks after a strange failure, delete the helper files and compile again.
9.2 Cheat sheet¶
\documentclass[11pt]{article} % document type
\usepackage{amsmath} % load a package
\newcommand{\name}[1]{...#1...} % your own command
\section{Title}\label{sec:x} % heading with a label
\ref{sec:x} \eqref{eq:y} % refer to a number
\citep{key} % citation
\emph{a} \textbf{b} \texttt{c} % emphasis, bold, code
$a^2$ \[ x \] \frac{a}{b} % maths
\includegraphics[width=\linewidth]{f} % image
\input{file} % another file
pdflatex main # compile
bibtex main # build the bibliography
latexmk -pdf main # do all the runs
latexmk -c # remove helper files
9.3 References and further reading¶
LaTeX Project (n.d.) LaTeX documentation. https://www.latex-project.org/help/documentation/
MacTeX (n.d.) MacTeX. TeX Users Group. https://www.tug.org/mactex/
MiKTeX (n.d.) MiKTeX. https://miktex.org
Overleaf (n.d.) Overleaf. https://www.overleaf.com
TeX Live (n.d.) TeX Live. TeX Users Group. https://www.tug.org/texlive/
Wikibooks (n.d.) LaTeX. https://en.wikibooks.org/wiki/LaTeX
Ammar, A. (n.d.) research-helpers. https://github.com/GeospatialGeeks/research-helpers
Ammar, A. (n.d.) Marxian political economy: project source. https://github.com/AhmadAmmar/marxist-economics