## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ subfig | Sub-figure Numbering and continued Float Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
EBo
Posts: 3
Joined: Mon Apr 09, 2012 4:08 pm

### subfig | Sub-figure Numbering and continued Float

I am using the subfig package for including subfigures into my thesis. That a lone 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 labeling (e.g. 4a).

I have tried changing the document class to report, but that didn't help.

This is a minimal working example: Any ideas???

Thank you for your help! Eva

\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}
Last edited by localghost on Mon Apr 09, 2012 4:25 pm, edited 2 times in total.
Reason: code marked

Stefan Kottwitz
Posts: 9406
Joined: Mon Mar 10, 2008 9:44 pm
Hi Eva,

welcome to the board!

This may be caused by loading the float package, specifically when using the [H] option. Try one time without it. Of cause you have to change the [H] option for this, try [!htbp].

Btw. the example cannot really be tested because we don't have your images. This can be fixed by using the demo option for the graphicx package. Furthermore, there's an option clash regarding your caption package options, so it's not compilable.

Stefan

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
Just for information to other users for awareness of possibly already existing solutions. The question has also been posted to {TeX} SX.
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

sommerfee
Posts: 495
Joined: Mon Apr 09, 2007 4:20 pm
It's a (known) incompatibility of the subfig package with the H-feature of the float package. (Unfortunately the subfig package wasn't maintained for the last 6 years and its license is LPPL-"author-maintained")
Last edited by sommerfee on Tue Apr 10, 2012 7:45 am, edited 4 times in total.

EBo
Posts: 3
Joined: Mon Apr 09, 2012 4:08 pm
Hi Stefan,

thank you very much!
Leaving out the float package helped the case and I don't need it any more anyway as I worked out how to do it properly now, without the H feature.

I don't quite get your point regarding the caption package though. Does it clash with the subfig package? I don't get any warning messages regarding this...
I just only realised, that I should of course load the caption package first.

Also, thanks sommerfee for the hint!

Thanks again,
Eva

\documentclass[12pt,twoside,a4paper]{report} \usepackage{setspace} \usepackage[inner=3cm, outer=3cm, top=1.0in, bottom=1.0in]{geometry} %\geometry{bindingoffset=0.5cm}\usepackage[font=small,labelfont=bf]{caption}\usepackage[demo]{graphicx}\usepackage[]{subfig}\begin{document}\begin{figure}[!htbp]\centering\subfloat[]{\includegraphics[width=14cm]{...figure code...}}\caption[]{figure1}\label{figure1}\end{figure}\begin{figure}[!htbp]\ContinuedFloat\centering\subfloat[]{\includegraphics[width=12cm]{...figure code...}}\caption[figure1]{figure1}\end{figure} \begin{figure}[!htbp]\centering\subfloat[]{\includegraphics[width=14cm]{...figure code...}}\\\subfloat[]{\includegraphics[width=10cm]{...figure code...}}\\\caption{[]figure2}\label{figure2}\end{figure}\begin{figure}[!htbp]\ContinuedFloat\centering\subfloat[]{\includegraphics[width=10cm]{...figure code...}}\caption[figure3]{figure3} \label{figure3}\end{figure} \begin{figure}[!htbp]\centering\subfloat[]{\includegraphics[width=10cm]{...figure code...}}\caption[figure3]{figure3}\end{figure} \begin{figure}[!htbp]\centering\subfloat[]{\includegraphics[width=10cm]{...figure code...}}\caption[figure4]{figure4}\label{figure4}\end{figure} \end{document}

Stefan Kottwitz
Posts: 9406
Joined: Mon Mar 10, 2008 9:44 pm
EBo wrote:I don't quite get your point regarding the caption package though. Does it clash with the subfig package? I don't get any warning messages regarding this...

Actually, subfig loads the caption package. Loading it again with different (new) options causes the clash. Already this small example produces ! LaTeX Error: Option clash for package caption.
\documentclass{report}\usepackage{subfig}\usepackage[font=small,labelfont=bf]{caption}\begin{document}\end{document}

As you noticed, loading caption earlier would work. But also this is possible, because caption is implicitely loaded:

\usepackage{subfig}\captionsetup{font=small,labelfont=bf}

Stefan

EBo
Posts: 3
Joined: Mon Apr 09, 2012 4:08 pm
Thank you Stefan,
I'll leave out the caption package then, to avoid any more clashes and use your suggestion with the \captionsetup command. Sound a bit more neat.

That's my thesis nearly done! Wohoo!
Eva