LaTeX error · Warnings: references, floats and boxes
LaTeX Error: Too many unprocessed floats.
Quick answer
LaTeX keeps figures and tables in order: if one float cannot be placed, every later one of the same type waits behind it. When too many are waiting at once, LaTeX runs out of storage and stops. The blocker is usually a float with restrictive options ([h], [t], [p] alone) or one too large for the allowed area. Give floats flexible placement [htbp], and add \clearpage (or \FloatBarrier from placeins) after a long run of figures so the queue is flushed.
The error in the log
This is how the message appears in the .log file (and in the compile output). The line starting with l. is the line number where TeX noticed the problem; the real mistake is there or just before it.
! LaTeX Error: Too many unprocessed floats.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.19 \ifnum\fig<60 \repeatWhy it happens
- A float that may only go somewhere it cannot:
[p]for a small figure that never fills a float page,[t]or[b]for a figure taller than the top or bottom area,[h]when there is no room here. - Many figures or tables in a row with little text between them, such as an appendix of plots, so pages never break to give LaTeX places to put them.
- Floats inside a part of the document that never ends a page, such as a very long single paragraph.
How to fix it
Use [htbp] (or omit the option) so each float has several places it may go, and make sure large figures are smaller than about 0.7 of the text height or are allowed on their own page with p.
After a long series of figures or tables, add \clearpage, which places all waiting floats on pages of their own, or load placeins and use \FloatBarrier. LaTeX already provides more float storage than in older versions; \extrafloats{100} adds more but only postpones a real blockage.
Broken: reproduces the error
\documentclass{article}
\begin{document}
% A small figure that may only go on a page of floats
\begin{figure}[p]
\centering
\rule{6cm}{1cm}
\caption{Overview.}
\end{figure}
% ...and many figures after it, which must wait behind it
\newcount\fig
\loop
\begin{figure}[t]
\centering
\rule{6cm}{1cm}
\caption{Result \the\fig.}
\end{figure}
Paragraph about result \the\fig.\par
\advance\fig by 1
\ifnum\fig<60 \repeat
\end{document}Try this in Octree — free LaTeX editor with AI, compiles in your browser
Fixed: compiles cleanly
\documentclass{article}
\begin{document}
\begin{figure}[htbp]
\centering
\rule{6cm}{1cm}
\caption{Overview.}
\end{figure}
\newcount\fig
\loop
\begin{figure}[htbp]
\centering
\rule{6cm}{1cm}
\caption{Result \the\fig.}
\end{figure}
Paragraph about result \the\fig.\par
\advance\fig by 1
\ifnum\fig<60 \repeat
\end{document}LaTeX Error: Float(s) lost.
! LaTeX Error: Float(s) lost.A float or a \marginpar was created somewhere LaTeX cannot output it, so it disappeared. Typical causes are a \marginpar or \todo (todonotes) inside a figure, table or footnote, and a figure or table placed inside a box or another float. The error is reported at the end of the document, so search for margin notes and nested floats; use \todo[inline] inside floats, and \captionof from the caption package instead of a figure environment inside a minipage.
Related errors
- Not in outer par mode – A figure, table or
\marginparinside a box, minipage or table cell. - Reference undefined – A
\refor\eqrefhas no matching\label, so the PDF shows ??. - Overfull \hbox – A line could not be broken and sticks out into the right margin.
- All LaTeX errors and warnings – The full list, grouped by cause
Frequently Asked Questions
How do I force LaTeX to place all pending figures?
\clearpage ends the page and puts every waiting float on following pages. \FloatBarrier from the placeins package does the same without forcing a page break when there are none waiting.
Should I use [H] from the float package to avoid this?
[H] places the figure exactly here, so it never queues, which avoids the error. The cost is large white gaps when the figure does not fit on the current page; [htbp] with an occasional \clearpage usually looks better.
Does the morefloats package still help?
Current LaTeX already has more float storage and provides \extrafloats{n} to add more, which is what morefloats did. It only helps when you really have many floats waiting legitimately; if one float is blocked, the queue grows until it overflows again.
Paste your document into Octree — compile errors get a Fix with AI button
When a compile fails, Octree shows the error next to the line that caused it and offers a one-click fix that you can review before applying. Free, nothing to install.
Fix it in Octree →