LaTeX Error: Not in outer par mode
A figure, table or \marginpar is inside a box, minipage, table cell or another float. Floats must be in the main text; put the box inside the float.
Help centre › LaTeX errors › Floats and layout · Error: the build stops or the output is wrong
What the log says
! LaTeX Error: Not in outer par mode.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.5 \begin{figure}What it means
Floats (figure, table and their starred forms) and margin notes can only be placed from the main flow of text, because LaTeX moves them to another place on the page. Inside a minipage, \parbox, table cell, another float or a margin note they have nowhere to go, and LaTeX stops.
Causes and fixes
Most common first. Each example is a complete document; the first fails with this message, the second is the same document fixed.
1. A figure or table inside a minipage or box
Turn it inside out: the float outside, the minipage (or box) inside it. For side-by-side panels, put two minipages inside one figure; for a caption without a float, use \captionof from the caption package.
\documentclass{article}
\begin{document}
\begin{minipage}{\linewidth}
\begin{figure}
\centering
\rule{3cm}{2cm}
\caption{A sample.}
\end{figure}
\end{minipage}
\end{document}\documentclass{article}
\begin{document}
\begin{figure}
\begin{minipage}{\linewidth}
\centering
\rule{3cm}{2cm}
\caption{A sample.}
\end{minipage}
\end{figure}
\end{document}2. A figure or table inside a tabular cell
Placing figures side by side with a tabular whose cells hold figure environments fails the same way. Put one figure environment around the whole tabular, or use subfigures from the subcaption package.
\documentclass{article}
\begin{document}
\begin{tabular}{cc}
\begin{figure}\rule{2cm}{1cm}\caption{Left.}\end{figure} & Right
\end{tabular}
\end{document}\documentclass{article}
\begin{document}
\begin{figure}
\centering
\begin{tabular}{cc}
\rule{2cm}{1cm} & \rule{2cm}{1cm}
\end{tabular}
\caption{Left and right.}
\end{figure}
\end{document}3. A \marginpar or \todo note inside a figure or table
A margin note is a float too, and cannot sit inside another float; depending on where it stands, LaTeX reports this error or "Float(s) lost". Move the note into the text next to the figure.
In Manulyx
The editor shows the error beside the float that cannot be placed, with an explanation.
Write in Manulyx for free · Journal templates
More in floats and layout
- LaTeX Error: There's no line here to endA line break (\\ or \newline) comes where no line has started, typically after a blank line. Use \vspace or \medskip for vertical space.
- LaTeX Error: Too many unprocessed floatsFigures and tables are queued faster than LaTeX can place them, often behind one that cannot be placed. Relax placements, shrink it, or add \clearpage.
- Overfull \hbox (<n>pt too wide) in paragraph at lines <a>--<b>A line sticks out into the margin because TeX found no acceptable place to break it: a long URL or word, or an image or equation wider than the column.
- Underfull \hbox (badness <n>) in paragraph at lines <a>--<b>A line had to be stretched more than TeX likes, leaving wide gaps between words. Usually caused by \\ or \linebreak in running text.
- LaTeX Warning: Float too large for page by <n>pt on input line <n>.A figure or table is taller than the text area, so it overprints the footer or runs off the page. Scale it to fit, or split a long table.
- Dimension too large.A length went past TeX's limit of about 16383pt (5.75 m). Usually a TikZ plot with large coordinates or a scale factor gone wrong.
Every example on this page was compiled with pdfLaTeX to check that it fails and is fixed as described. All LaTeX errors