One quick thing
We track anonymous usage — page views, feature usage, compilation events — to understand what works and what doesn't. No ads, no personal data, no third-party sharing.
\errors{latex}
50 common errors explained — what causes them, how to fix them, and working code examples. Bookmark this for when LaTeX inevitably surprises you.
Overfull \hbox (Xpt too wide) in paragraph at lines N--M.
A line of text is wider than the text area, causing text to stick out into the margin. This is a warning, not an error — compilation continues — but it usually produces visually poor output with text outside the page margins.
For long URLs, use the url or hyperref package with automatic line-breaking. For text, add \sloppy to allow looser line-breaking, or manually insert \- to hint where hyphenation is allowed. For images, ensure they fit within \textwidth.
\documentclass{article}
\begin{document}
See the documentation at https://www.example.com/very/long/url/that/does/not/break/automatically/in/latex.
\end{document}\documentclass{article}
\usepackage{hyperref} % enables automatic URL line-breaking
\begin{document}
See the documentation at \url{https://www.example.com/very/long/url/that/does/not/break/automatically/in/latex}.
\end{document}! LaTeX Error: There's no line here to end.
The \\ (forced line break) command was used in a context where it doesn't make sense — such as immediately after \section{}, at the start of a paragraph, or inside \centering without preceding content.
Remove the \\ from sectioning commands. To add vertical space after a section heading, use \vspace{length}. To force a paragraph break, use \par or leave a blank line instead.
\documentclass{article}
\begin{document}
\section{Introduction}\\ % Misplaced line break
The introduction begins here.
\end{document}\documentclass{article}
\begin{document}
\section{Introduction}
% No \\ needed — paragraph break is implicit
The introduction begins here.
\end{document}Underfull \hbox (badness 10000) in paragraph at lines N--M.
LaTeX couldn't fill a line to the full text width without creating too much visible whitespace between words. This produces lines with large word gaps. Badness 10000 means the spacing is maximally bad.
Rewrite the paragraph slightly to give LaTeX more flexibility. You can also add \emergencystretch=3em to the preamble to allow extra stretch. For short captions or labels, \raggedright avoids the badness at the cost of a ragged right margin.
\documentclass{article}
\begin{document}
\begin{minipage}{3cm}
A.
\end{minipage}
\end{document}\documentclass{article}
\begin{document}
\begin{minipage}{3cm}
\raggedright
A short label.
\end{minipage}
\end{document}! LaTeX Error: Not in outer par mode.
Figure, table, and other floating environments can only be used in 'outer paragraph mode' — the normal flow of text. They cannot appear inside boxes (\mbox, \fbox), minipages, or other constrained environments.
Move the float outside the constraining environment. If you need an image inside a minipage, use \includegraphics{} directly without the figure wrapper. Use \captionof{figure}{} from the capt-of package for a caption outside a float.
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{minipage}{0.5\textwidth}
\begin{figure}[h] % Error: float inside minipage
\includegraphics{image.png}
\end{figure}
\end{minipage}
\end{document}\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{minipage}{0.5\textwidth}
\includegraphics[width=\linewidth]{image.png}
\end{minipage}
\end{document}! Illegal unit of measure (pt inserted).
A dimension argument was given a number without a valid unit, or with an unrecognised unit. LaTeX assumes pt and continues, but the result is likely wrong.
Always specify a unit when giving dimensions. Valid TeX units include pt, bp, mm, cm, in, em, ex, pc, dd, cc, sp. Relative units like \textwidth and \linewidth also work as dimensions.
\documentclass{article}
\begin{document}
\rule{100px}{2px} % px is not a valid LaTeX unit
\end{document}\documentclass{article}
\begin{document}
\rule{100pt}{2pt} % Use LaTeX units: pt, mm, cm, em, etc.
\end{document}! LaTeX Error: Too many unprocessed floats.
LaTeX has an internal limit on how many floating objects (figures, tables) can wait to be placed. If too many floats accumulate without a page break, LaTeX runs out of internal registers and stops.
Insert \clearpage at regular intervals to force LaTeX to place all pending floats and start a new page. Use the placeins package with \FloatBarrier for softer barriers. Change float placement from [h] to [htbp] for more flexibility.
\documentclass{article}
\usepackage{graphicx}
\begin{document}
% Many consecutive figures with no text between them...
\begin{figure}[h]\includegraphics{a.png}\end{figure}
\begin{figure}[h]\includegraphics{b.png}\end{figure}
% ... many more ...
\end{document}\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htbp]\includegraphics{a.png}\end{figure}
\begin{figure}[htbp]\includegraphics{b.png}\end{figure}
\clearpage % Force placement of all pending floats
\end{document}! LaTeX Error: Counter too large.
A counter (typically a footnote number or enumerate item number) exceeded the maximum value that can be represented in the current format. Roman numerals and alphabetic lists have practical limits.
For long alphabetically-numbered lists, switch to numeric numbering using the enumitem package. For footnote overflow, use \setcounter{footnote}{0} periodically, or switch to endnotes with the endnotes package.
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=\alph*)]
% ... 27 or more items ...
\end{enumerate}
\end{document}\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=\arabic*.]
% Numeric — no practical upper limit
\end{enumerate}
\end{document}! LaTeX Error: Float too large for page by Xpt.
A figure or table is taller than the page's float area, so LaTeX cannot place it anywhere. This usually happens with very large images or tables placed inside a float environment.
Scale the image down: \includegraphics[width=\textwidth]{img}. For very tall content, use a full-page figure with \begin{figure}[p]. For long tables, use the longtable package instead of table.
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[h]
\includegraphics{huge-image.png} % No size constraint
\end{figure}
\end{document}\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htbp]
\centering
\includegraphics[width=0.9\textwidth]{huge-image.png}
\caption{Scaled to fit.}
\end{figure}
\end{document}