Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 11 down vote accepted

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}
share|improve this answer
1  
I'd also use \centering instead of \begin{center} ... \end{center}. –  lockstep Mar 1 '13 at 16:12
    
yes @Sevenless, center introduces additional vertical space which you often don't want in this context. –  David Carlisle Mar 1 '13 at 16:16
    
Thank you so much, also for the \centering advice. –  Sevenless Mar 1 '13 at 19:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.