LaTeX Basics

11. Debugging Errors

How to understand and fix common compiler errors.

6 min read Share

Errors are normal. Do not panic. Read the log message carefully.

Common Critical Errors

! Missing $ inserted.

Cause: You used a math symbol (_, ^, \alpha) in normal text.

Fix: Wrap it in dollar signs: $x_2$.

! Undefined control sequence.

Cause: A typo in a command (e.g., \sectionn) or missing package.

Fix: Check spelling or add \usepackage.

Runaway argument?

Cause: Missing closing brace }.

Fix: Check your brackets match.

Warnings (Yellow)

Overfull \hbox (10.2pt too wide)

Text is protruding into the margin. Usually caused by long words LaTeX can't hyphenate.