# Wrong numbering in the List of Figures with subfigure package

I get a wrong numbering of subfigures in the List of Figures with the following MWE.

If I remove the FIGTOPCAP option or if I put the \caption on the top, the problem is solved, but I'd like keep them. Any idea?

\documentclass{book}
\usepackage[tight,FIGTOPCAP]{subfigure}
\setcounter{lofdepth}{2}

\begin{document}
\listoffigures

\begin{figure}
\frame{
\begin{minipage}[t]{0.4\textwidth}
PIC 1
\end{minipage}
}
\caption[Short Caption]{Long Caption}
\end{figure}

\begin{figure}
\subfigure[Sub-caption A]{\label{LabelA}%
\frame{
\begin{minipage}[t]{0.4\textwidth}
PIC 2A
\end{minipage}
}%
}
\hfill
\subfigure[Sub-caption B]{\label{labelB}%
\frame{
\begin{minipage}[t]{0.4\textwidth}
PIC 2B
\end{minipage}
}%
}%
\caption[General Short Caption]{General Long Caption\label{GenLabel}}
\end{figure}
\end{document}

-
Do you get the desired output with \usepackage[tight]{subfigure} \subfiguretopcaptrue in the preamble? – Qrrbrbirlbel Dec 19 '12 at 2:49
Thanks! That is the trick. – Gitano Dec 19 '12 at 3:29
@Qrrbrbirlbel please either post an answer, or vote to close TL – cmhughes Dec 19 '12 at 4:24

The subfigure package has long be declared obsolete. You get correct output with the successor package subfig (notice that you must use \subfloat instead of \subfigure and \subtable); the \captionsetup is drawn from the documentation to emulate the old options.

\documentclass{book}

\usepackage{subfig}
\captionsetup[subfloat]{position=top,
nearskip=10pt,margin=10pt}

\setcounter{lofdepth}{2}

\begin{document}
\listoffigures

\begin{figure}
\framebox[0.4\textwidth]{PIC 1}
\caption[Short Caption]{Long Caption}
\end{figure}

\begin{figure}
\subfloat[Sub-caption A]{\label{LabelA}%
\framebox[0.4\textwidth]{PIC 2A}%
}%
\hfill
\subfloat[Sub-caption B]{\label{labelB}%
\framebox[0.4\textwidth]{PIC 2A}%
}

\caption[General Short Caption]{General Long Caption\label{GenLabel}}
\end{figure}
\end{document}


Here is the "List of figures"

and here's the part with the subfloats

-
Thanks! I didn't know I was working with an obsolete package. Definitely I am goning to use this code. – Gitano Dec 20 '12 at 3:56
There is one small mistake I can't resolve. When you add 'hyperref' package and '\chapter{Chap. 1}' after '\listoffigures' entry, you get a bad numbering in LOF, actually there are two warning about that. Do you know how resolve it? I appreciate any idea... – Gitano Dec 21 '12 at 14:40
@Gitano I'm afraid that subfig is no longer compatible with hyperref and switching to subcaption is the best thing you can do. See here and here – egreg Dec 21 '12 at 15:11

The options FIGTOPCAP (and FIGBOTCAP) controls the settings for the normal caption as well as the subfigure’s caption. In your example, the subfigure’s caption were allocated to the first figure because they appeared after the first and before the second \caption.

The subfigure package offers three so called “flags” (→ subfigure manual, 4.5 “Aligning Captions Above the Figure”, pp. 23f.):

• \subfiguretopcaptrue
• \subfiguretopcapfalse
• \figuretopcaptrue

Admittedly, I can’t fully follow the explanations and examples from the manual; the solution is to drop the FIGTOPCAP option and use \subfiguretopcaptrue (preferably in the preamble), as it does exactly what it says on the tin.

## Code

\documentclass{book}
\usepackage[tight]{subfigure}
\subfiguretopcaptrue
\setcounter{lofdepth}{2}

\begin{document}
\listoffigures

\begin{figure}
\frame{
\begin{minipage}[t]{0.4\textwidth}
PIC 1
\end{minipage}
}
\caption[Short Caption]{Long Caption}
\end{figure}

\begin{figure}
\subfigure[Sub-caption A]{\label{LabelA}%
\frame{
\begin{minipage}[t]{0.4\textwidth}
PIC 2A
\end{minipage}
}%
}
\hfill
\subfigure[Sub-caption B]{\label{labelB}%
\frame{
\begin{minipage}[t]{0.4\textwidth}
PIC 2B
\end{minipage}
}%
}%
\caption[General Short Caption]{General Long Caption\label{GenLabel}}
\end{figure}
\end{document}


-