[Tex/LaTex] Line break in the caption of subfigure

captionsfloats

I would like to add a line break in the caption of a subfigure:

\begin{figure}
  \subfigure[a long line]{%
    \includegraphics[width=0.23\textwidth]{figures/cells_time.eps}
  }
\end{figure}

So I want to add a line break at a specific position inside a long line, does anyone know how to do it?

Best Answer

Lines break automatically; if you want to force a line break, use

\protect\\

Example:

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfigure}

\begin{document}

\begin{figure}

\subfigure[A long line\protect\\ and another]{%
  \includegraphics[width=0.23\textwidth]{example-image}%
}

\end{figure}

\end{document}

Note that subfigure has been obsolete for several years. Use its successor subfig or the more modern and powerful subcaption.

Related Question