Graphics, Figures & Tablessubfig | Sub-figure Numbering and continued Float

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

subfig | Sub-figure Numbering and continued Float

Post by EBo »

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

Code: Select all

\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.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

subfig | Sub-figure Numbering and continued Float

Post by Stefan Kottwitz »

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
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

subfig | Sub-figure Numbering and continued Float

Post by localghost »

Just for information to other users for awareness of possibly already existing solutions. The question has also been posted to {TeX} SX.
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Re: subfig | Sub-figure Numbering and continued Float

Post by sommerfee »

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

subfig | Sub-figure Numbering and continued Float

Post by EBo »

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

Code: Select all

\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}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

subfig | Sub-figure Numbering and continued Float

Post by Stefan Kottwitz »

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.

Code: Select all

\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:

Code: Select all

\usepackage{subfig}
\captionsetup{font=small,labelfont=bf}
Stefan
LaTeX.org admin
EBo
Posts: 3
Joined: Mon Apr 09, 2012 4:08 pm

Re: subfig | Sub-figure Numbering and continued Float

Post by EBo »

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
Post Reply