I have a figure with several subfigures. The figure has a \caption, which is messy in the List of Figures. I'd prefer to put \captions on each of the \subfigures. The code I'm using at the moment is:
\begin{figure}[htpb]
\centering
\subfigure[]{
\includegraphics[width=.45\columnwidth]{../Images/GloveOfDoom/RFIDTag_Testing_Side_s}
}
\caption{My caption!}
\end{figure}
This works. However, when I put a \caption in any of the \subfigures, using this example as a reference, I'm getting errors:
\begin{figure}[htpb]
\centering
\subfigure[]{
\caption{Subfloat caption dies with error.}
\includegraphics[width=.45\columnwidth]{../Images/GloveOfDoom/RFIDTag_Testing_Side_s}
}
\caption{My caption!}
\end{figure}
The errors I'm getting:
<../Images/GloveOfDoom/RFIDTag_Testing_Side_s.jpg, id=4, 520.94624pt x 347.2975
pt> <use ../Images/GloveOfDoom/RFIDTag_Testing_Side_s.jpg>
Overfull \hbox (7.1944pt too wide) in paragraph at lines 51--51
[]\OT1/cmr/m/n/9 ()
! Extra }, or forgotten \endgroup.
\@subfloat ...use {c@\@captype }\m@ne \fi \egroup
l.51 }
! Extra }, or forgotten \endgroup.
\@endfloatbox ...pagefalse \outer@nobreak \egroup
\color@endbox
l.53 \end{figure}
! Too many }'s.
\color@endbox ->\color@endgroup \egroup
l.53 \end{figure}
! LaTeX Error: \begin{document} ended by \end{figure}.
When I comment out the line containing the added \caption, everything compiles and looks fine. How can I fix this? I have no idea where to look or why this is occurring.
A minimal example which shows this error is:
% !TEX TS-program = pdflatex
% !TEX encoding = UTF-8 Unicode
\documentclass[11pt]{report} % use larger type; default would be 10pt
%\usepackage{refcheck}
\usepackage[pdftex]{graphicx}
\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)
\usepackage{array} % for better arrays (eg matrices) in maths
\usepackage{color} % Colorize code listings
\usepackage{fixltx2e}
\usepackage{geometry} % to change the page dimensions
\usepackage{hyperref}
\usepackage{listings} % Code listings
\usepackage{mathtools} % Math Equations
\usepackage{mdwlist}
\usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)
\usepackage{rotating}
\usepackage{setspace}
\usepackage{subfigure}
\geometry{a4paper} % or letterpaper (US) or a5paper or....
\linespread{1.5}
\begin{document}
\begin{figure}[htpb]
\centering
\subfigure[]{
\caption{Subfloat caption dies with error.}
\includegraphics[width=.45\columnwidth]{../Images/GloveOfDoom/RFIDTag_Testing_Side_s}
}
\caption{My caption!}
\end{figure}
}
\end{document}
! Extra }, or forgotten \endgroup.\@endfloatboxusually means you have a float package designed for latex2.09 (ie before 1993) that doesn't work properly with latex2e. But you haven't posted a complete document showing your preamble so hard to guess – David Carlisle Dec 21 '12 at 08:53smallmatrixfor example? They don't work well with the list of figures, you should give 2 caoptions (thats even better, if your caption is bloated):\caption[short for list of figures]{long caption containing your math 'n' stuff}– Ronny Dec 21 '12 at 08:59\caption[short]{long}- I think that solves what I'm trying to do without the use of anysubfigure\captions. – simont Dec 21 '12 at 09:20