[Tex/LaTex] ContinuedFloat, and Subfloat

captionsnumberingsubfloats

In my thesis I have a lot of figures with a common caption and multiple subfigures (a,b,c..etc). I wanted to split them between the pages because I don't want to fit them all in one page, therefore I used the commands \subfloat and \ContinuedFloat. It helped, BUT:

  1. The numbering of the figures started from 0, i.e. Fig.1.0 which it shouldn't.
  2. The numbering was not in sequence, it started like that: Fig.1.0, Fig.1.1, Fig.1.2, then went back Fig.1.1, then Fig.1.2….etc and even in the subfigures the numbering was not in sequence, it was like: Fig.1.0 (a) and Fig.1.1 (b) instead of Fig.1.0 (b)….

This is the code I used:

%\clearpage
\begin{figure}[h!]
%\subfigure[]{
\centering
\subfloat{\includegraphics[width=1.0\columnwidth]{fig1.eps} } \, 
\label{int1}}%
\end{figure}
%\clearpage
\begin{figure}[h!]
\ContinuedFloat
%\subfigure[]{
\centering
\subfloat{\includegraphics[width=1.0\columnwidth]{fig2.eps} } \, 
\label{int2}}%
\caption{my figures (a) and (b).}
\label{int}
\end{figure}

Then it was a matter of copying and pasting for the other figures (and subfigures).

Best Answer

Unfortunately the algorithm of \ContinuedFloat offered by the subfig package is based on the assumption that every figure has a \caption. For that reason the caption package offers a command called \phantomcaption (without any arguments) since version 3.2 which does not typeset a caption but will fulfill the needs of \ContinuedFloat.

For usage with version 3.1 of the caption package one can define \phantomcaption as:

\makeatletter
\providecommand\phantomcaption{\caption@refstepcounter\@captype}
\makeatother

Since this uses \providecommand it will not break with future versions of the caption package.

BTW: The current version 3.3 of the caption package offers a \ContinuedFloat without the need of a \caption, but since the subfig package comes with its own definition of \ContinuedFloat (overriding the one defined by the caption package) you'll still need \phantomcaption when using the subfig package.

MWE:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subfig}

\begin{document}

\begin{figure}
\centering
\subfloat[]{\includegraphics[width=1.0\columnwidth]{fig1.eps} \, 
\label{int1}}
\phantomcaption  % <=== This line added to compensate for the missing \caption
\end{figure}

\begin{figure}
\ContinuedFloat
\centering
\subfloat[]{\includegraphics[width=1.0\columnwidth]{fig2.eps} \, 
\label{int2}}%
\caption{my figures (a) and (b).}
\label{int}
\end{figure}

\end{document}
Related Question