LaTeX forum ⇒ Graphics, Figures & Tablessubfig | 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

Postby EBo » Mon Apr 09, 2012 4:14 pm

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

  1. \documentclass[12pt,twoside,a4paper]{report}
  2.  
  3. \usepackage{setspace}
  4. \usepackage[inner=3cm, outer=3cm, top=1.0in, bottom=1.0in]{geometry} %
  5. \geometry{bindingoffset=0.5cm}
  6.  
  7. \usepackage{graphicx}
  8. \usepackage[]{subfig}
  9. \usepackage{float}
  10. \usepackage[font=small,labelfont=bf]{caption}
  11.  
  12.  
  13. \begin{document}
  14.  
  15. \begin{figure}[H]
  16. \centering
  17. \subfloat[]{\includegraphics[width=14cm]{...figue code...}}
  18. \caption[]{figure1}\label{figure1}
  19. \end{figure}
  20. \begin{figure}[H]
  21. \ContinuedFloat
  22. \centering
  23. \subfloat[]{\includegraphics[width=12cm]{...figue code...}}
  24. \caption[figure1]{figure1}
  25. \end{figure}
  26.  
  27.  
  28.  
  29. \begin{figure}[H]
  30. \centering
  31. \subfloat[]{\includegraphics[width=14cm]{...figue code...}}\\
  32. \subfloat[]{\includegraphics[width=10cm]{...figue code...}}\\
  33. \caption{[]figure2}\label{figure2}
  34. \end{figure}
  35. \begin{figure}[H]
  36. \ContinuedFloat
  37. \centering
  38. \subfloat[]{\includegraphics[width=10cm]{...figue code...}}
  39. \caption[figure3]{figure3} \label{figure3}
  40. \end{figure}
  41.  
  42. \begin{figure}[H]
  43. \centering
  44. \subfloat[]{\includegraphics[width=10cm]{...figue code...}}
  45. \caption[figure3]{figure3}
  46. \end{figure}
  47.  
  48. \begin{figure}[H]
  49. \centering
  50. \subfloat[]{\includegraphics[width=10cm]{...figue code...}}
  51. \caption[figure4]{figure4}\label{figure4}
  52. \end{figure}
  53.  
  54. \end{document}
Last edited by localghost on Mon Apr 09, 2012 4:25 pm, edited 2 times in total.
Reason: code marked

User avatar
Stefan Kottwitz
Site Admin
Posts: 9406
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Apr 09, 2012 4:24 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
Site admin

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Mon Apr 09, 2012 5:03 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
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


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

User avatar
sommerfee
Posts: 495
Joined: Mon Apr 09, 2007 4:20 pm

Postby sommerfee » Mon Apr 09, 2012 5:06 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

Postby EBo » Mon Apr 09, 2012 5:12 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

  1. \documentclass[12pt,twoside,a4paper]{report}
  2.  
  3. \usepackage{setspace}
  4. \usepackage[inner=3cm, outer=3cm, top=1.0in, bottom=1.0in]{geometry} %
  5. \geometry{bindingoffset=0.5cm}
  6. \usepackage[font=small,labelfont=bf]{caption}
  7. \usepackage[demo]{graphicx}
  8. \usepackage[]{subfig}
  9. \begin{document}
  10. \begin{figure}[!htbp]
  11. \centering
  12. \subfloat[]{\includegraphics[width=14cm]{...figure code...}}
  13. \caption[]{figure1}\label{figure1}
  14. \end{figure}
  15. \begin{figure}[!htbp]
  16. \ContinuedFloat
  17. \centering
  18. \subfloat[]{\includegraphics[width=12cm]{...figure code...}}
  19. \caption[figure1]{figure1}
  20. \end{figure}
  21.  
  22. \begin{figure}[!htbp]
  23. \centering
  24. \subfloat[]{\includegraphics[width=14cm]{...figure code...}}\\
  25. \subfloat[]{\includegraphics[width=10cm]{...figure code...}}\\
  26. \caption{[]figure2}\label{figure2}
  27. \end{figure}
  28. \begin{figure}[!htbp]
  29. \ContinuedFloat
  30. \centering
  31. \subfloat[]{\includegraphics[width=10cm]{...figure code...}}
  32. \caption[figure3]{figure3} \label{figure3}
  33. \end{figure}
  34.  
  35. \begin{figure}[!htbp]
  36. \centering
  37. \subfloat[]{\includegraphics[width=10cm]{...figure code...}}
  38. \caption[figure3]{figure3}
  39. \end{figure}
  40.  
  41. \begin{figure}[!htbp]
  42. \centering
  43. \subfloat[]{\includegraphics[width=10cm]{...figure code...}}
  44. \caption[figure4]{figure4}\label{figure4}
  45. \end{figure}
  46.  
  47. \end{document}

User avatar
Stefan Kottwitz
Site Admin
Posts: 9406
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Apr 09, 2012 5:20 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.
  1. \documentclass{report}
  2. \usepackage{subfig}
  3. \usepackage[font=small,labelfont=bf]{caption}
  4. \begin{document}
  5. \end{document}


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

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


Stefan
Site admin

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

Postby EBo » Mon Apr 09, 2012 5:26 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


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 3 guests