[Tex/LaTex] Block quote in figure caption

captionsfloatsquoting

I need to put a multi-line quote in a figure caption. I've put code together that does this correctly if I override several errors, but I'd like the document to compile without errors.

The code:

\begin{figure}
  \begin{center}
     \includegraphics[width = 6in]{myfigure.png} 
  \end{center}
   \caption[Reproduced from foo.]{text. 
     \begin{quote}
       Quoted text from reproduction
     \end{quote}
     No really this is important.}\label{mylabel}
\end{figure}

The error I get is:

./chap1.tex:166: LaTeX Error: Something's wrong--perhaps a missing \item.

Thanks for the help.

Best Answer

Please always post complete documents showing the class used.

In the standard classes the caption is set twice once as a single line to see if it fits, and then as a paragraph if not, the single line trial generates the error if you use a display environment.

You can turn this off with the caption package:

\documentclass{article}
\usepackage{caption}
\captionsetup{singlelinecheck=false}
\begin{document}
\begin{figure}
  \begin{center}
     XXXX%\includegraphics[width = 6in]{myfigure.png} 
  \end{center}
   \caption[Reproduced from foo.]{text. 
     \begin{quote}
       Quoted text from reproduction
     \end{quote}
     No really this is important.}\label{mylabel}
\end{figure}

\end{document}
Related Question