8

I am using the subfig package for including subfigures into my thesis. That alone has been going without problem.

However, as soon as I use the \ContinuedFloat command in order to split a figure over a single page, the following figure, which also uses the \ContinuedFloat command, just carries on with the subfigure numbering (e.g. Figure 2c, 2d instead of 2a, 2b).

If a figure without the \ContinuedFloat command is inserted it also continues the numbering (e.g. 3f) and only the next figure without this command starts with the normal labelling (e.g. 4a).

This is a minimal working example.

\documentclass[12pt,twoside,a4paper]{report}

\usepackage{setspace} 
\usepackage[inner=3cm, outer=3cm, top=1.0in, bottom=1.0in]{geometry} %
\geometry{bindingoffset=0.5cm}

\usepackage{graphicx}
\usepackage[]{subfig}
\usepackage{float} 
\usepackage[font=small,labelfont=bf]{caption}


\begin{document}

\begin{figure}[H]
\centering
\subfloat[]{\includegraphics[width=14cm]{...figue code...}}
\caption[]{figure1}\label{figure1}
\end{figure}

\begin{figure}[H]
\ContinuedFloat
\centering
\subfloat[]{\includegraphics[width=12cm]{...figue code...}}
\caption[figure1]{figure1}
\end{figure}



\begin{figure}[H]
\centering
\subfloat[]{\includegraphics[width=14cm]{...figue code...}}\\
\subfloat[]{\includegraphics[width=10cm]{...figue code...}}\\
\caption{[]figure2}\label{figure2}
\end{figure}

\begin{figure}[H]
\ContinuedFloat
\centering
\subfloat[]{\includegraphics[width=10cm]{...figue code...}}
\caption[figure3]{figure3} \label{figure3}
\end{figure}

\begin{figure}[H]
\centering
\subfloat[]{\includegraphics[width=10cm]{...figue code...}}
\caption[figure3]{figure3}
\end{figure}

\begin{figure}[H]
\centering
\subfloat[]{\includegraphics[width=10cm]{...figue code...}}
\caption[figure4]{figure4}\label{figure4}
\end{figure}

\end{document}
3

This question has been cross-posted to LaTeX-Community.org and there's a possible solution.

The effect is caused by using the float package and the H option. Removing H and using !htbp instead (or less) fixed it for me.

5

The problem seems to go away if you don't use the [H] position specifier (you should also load caption before subfig). If you really must use [H], you can put this in your preamble and use \resetsubfigs after \begin{figure} to reset the subfigure labels.

\makeatletter
\newcommand\resetsubfigs{\setcounter{sub\@captype}{0}}
\makeatother

A fully automated solution may require a lot of hacking.

1

I have used \setcounter{subfigure}{number_initial} or \setcounter{figure}{number_initial} and I have solved my problems. The new problem in this case is that you need to know the number or your figure/subfigure, but if you edit the text where your figures are located, this is a good option.

0

Try to add \setcounter{subfigure}{0} in place where you want to reset the counter of subfig. In your case:

\documentclass[12pt,twoside,a4paper]{report}

(...)


\begin{figure}[H]
\ContinuedFloat
\centering
\subfloat[]{\includegraphics[width=12cm]{...figue code...}}
\caption[figure1]{figure1}
\end{figure}



\begin{figure}[H]
\centering
\setcounter{subfigure}{0}
\subfloat[]{\includegraphics[width=14cm]{...figue code...}}\\
\subfloat[]{\includegraphics[width=10cm]{...figue code...}}\\
\caption{[]figure2}\label{figure2}
\end{figure}

(...)

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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