6

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?

2
  • 5
    Perhaps you should start with using a modern package like »subcaption« and not an obsolete one like »subfigure«. Nov 15, 2013 at 18:58
  • Use a \parbox inside the caption. Nov 18, 2013 at 3:12

1 Answer 1

8

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.

3
  • This gives me a different error: The most probable cause is an omitted \item command in a list-making environment. It is also caused by forgetting the argument of a thebibliography environment. Do you have any idea why?
    – xuhdev
    Jan 28, 2017 at 18:35
  • @xuhdev No, sorry.
    – egreg
    Jan 28, 2017 at 18:36
  • @SoftTimur .I think you could accept this answer. Or is something still unclear?
    – Bobyandbob
    Sep 1, 2017 at 15:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .