A field guide to the messages LaTeX prints. Errors (!) stop the build; warnings do not, but often signal a real problem (a bad line, a broken reference). Here are the common ones, with what each means and the usual fix. (For how to read them and the ? prompt, see “Reading errors & debugging.”)
TeX errors
| Message | Cause & fix |
|---|
! Undefined control sequence | An unknown command — a typo, or a package not loaded |
! Missing $ inserted | A math symbol outside math mode — wrap it in $...$ |
! Too many }'s | More } than { |
! Missing } inserted | An unclosed { |
! Misplaced alignment tab character & | & used outside a table; for a literal one use \& |
LaTeX errors
| Message | Cause & fix |
|---|
LaTeX Error: File not found | A package/file is missing — install via tlmgr, check spelling |
Environment undefined | Undefined environment — package not loaded, or a typo |
\begin{x} ended by \end{y} | Mismatched or overlapping \begin…\end |
Something's wrong--perhaps a missing \item | An empty list, or text before the first \item |
Command \x already defined | Redefining an existing command — use \renewcommand |
LaTeX warnings
| Message | Meaning & fix |
|---|
Overfull \hbox | A line overran the margin — reword, hyphenate, or local \sloppy |
Underfull \hbox | A too-loose line (badness) — reword or adjust breaks |
Reference undefined | A \ref/\label mismatch, or recompile once more |
Citation undefined | Unknown bib key, or bibtex/biber not run |
Label multiply defined | The same label is defined twice |
Font shape undefined | A bad or uninstalled font; a default is substituted |
Common misuse
- Unclosed
$ → math runs away. Always pair them. - Too many
& → match the table’s column count; for a literal one use \&. - Misused
\\ → use a blank line for paragraphs; \\ is not needed on a last line or right after a heading. - Brace mismatch
{ } → find it fast with your editor’s bracket matching.