LaTeX error · Environments, lists and tables

LaTeX Error: Not in outer par mode.

Quick answer

Floats (figure and table) and margin notes can only be placed in the main text flow, which LaTeX calls outer paragraph mode. Inside a minipage, \parbox, \fbox, a table cell, a footnote or another float they cannot float, so LaTeX refuses. Put the figure on the outside and the minipages inside it, or drop the float and use \captionof from the caption package for the caption.

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: Not in outer par mode.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.5     \centering

Why it happens

  • \begin{figure} or \begin{table} inside a minipage, often while trying to put two figures side by side.
  • A float inside a \parbox, \fbox, \colorbox, a tcolorbox, a table cell or a footnote.
  • A float nested in another float, such as a table inside a figure.
  • \marginpar or \todo (todonotes) used inside a box, a float or a footnote.

How to fix it

Reverse the nesting: one figure on the outside, minipages (or subfigures) inside it, with a \caption in each minipage.

If the content must stay in a box, drop the float environment and caption it with \captionof{figure}{...} from the caption package. For todonotes inside boxes use \todo[inline]{...}.

Broken: reproduces the error

\documentclass{article}
\begin{document}
\begin{minipage}{0.45\textwidth}
  \begin{figure}
    \centering
    \rule{3cm}{2cm}
    \caption{Left plot}
  \end{figure}
\end{minipage}
\end{document}

Try this in Octree — free LaTeX editor with AI, compiles in your browser

Fixed: compiles cleanly

\documentclass{article}
\begin{document}
\begin{figure}
  \centering
  \begin{minipage}{0.45\textwidth}
    \centering
    \rule{3cm}{2cm}
    \caption{Left plot}
  \end{minipage}
\end{figure}
\end{document}

Related errors

Frequently Asked Questions

How do I put two figures side by side without this error?

Use one figure environment containing two minipages of width 0.48\textwidth, each with its own image and \caption. Or load subcaption and use subfigure environments inside the figure.

How do I add a caption to an image inside a minipage or box?

Load the caption package and write \captionof{figure}{Your caption} after the image. It numbers and lists the caption like a figure without creating a float.

Why does \todo give "Not in outer par mode"?

todonotes puts notes in the margin with \marginpar, which is not allowed in floats, footnotes, tables or boxes. Use \todo[inline]{...} in those places.

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 →