Float Used in Non-Outer-Par Mode
! LaTeX Error: Not in outer par mode.
What this error means
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.
Common causes
- A figure or table environment inside a minipage
- A float inside \parbox{} or \makebox{}
- Nested floating environments
How to fix it
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.
Code examples
\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}Related errors
Overfull \hbox (Line Too Wide)
Overfull \hbox (Xpt too wide) in paragraph at lines N--M.
No Line Here to End (Misplaced \\)
! LaTeX Error: There's no line here to end.
Underfull \hbox (Poor Word Spacing)
Underfull \hbox (badness 10000) in paragraph at lines N--M.
Illegal Unit of Measure
! Illegal unit of measure (pt inserted).
Test the fix live
Paste your LaTeX into the playground and compile instantly.

