Graphics, Figures & Tablessubfig | Figure Numbering changes

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
LaTex lover
Posts: 13
Joined: Wed Aug 10, 2011 11:15 am

subfig | Figure Numbering changes

Post by LaTex lover »

Hi all,

My question is regarding subfig, there is a problem in the output, the counter for the figure changes, for instance if the figure number should be 3.17 it appears as 3.15. I test it with another figure, a single figure and not subfig, it is OK. So I am guessing I am missing something in my code that cause this problem. My codes are:

Code: Select all

\begin{figure}[H]
\centering
\subfloat[Tap water]{\includegraphics[angle=90,width=0.7\textwidth]{TW}}
\end{figure}
\begin{figure}[H]
\ContinuedFloat
\centering
\subfloat[Salt1]{\includegraphics[angle=90,width=0.7\textwidth]{s1}}
\end{figure}
\begin{figure}[H]
\ContinuedFloat
\centering
\subfloat[Salt2]{\includegraphics[angle=90,width=0.7\textwidth]{s2}}
\caption{Efd (a) Tw, (b) S1 (c) S2, at 5 levels}
\end{figure}
I appreciate any help. Sorry if my question is trivial:)
Thank you.
Last edited by localghost on Fri Feb 03, 2012 6:29 pm, edited 1 time 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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

subfig | Figure Numbering changes

Post by localghost »

Please get used to always providing a proper minimal example that makes the problem instantly comprehensible. Otherwise help becomes very difficult (in other words impossible).

After supplementing your code snippet to a complete document, I get two error messages.

Code: Select all

! Package caption Error: Continued `figure' after `??'.

See the caption package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.16     \ContinuedFloat
                        

! Package caption Error: Continued `figure' after `??'.

See the caption package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.22     \ContinuedFloat
You can't use the \ContinuedFloat command after a float that has no caption. You should at least set an empty caption. But then you get "Figure 1" for the first two floats.


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

subfig | Figure Numbering changes

Post by sommerfee »

LaTex lover wrote:My question is regarding subfig, there is a problem in the output, the counter for the figure changes, for instance if the figure number should be 3.17 it appears as 3.15.
The \subfloat command provided by the subfig package always needs a \caption command within the same floating environment. This is not the case in your code snippet.
LaTex lover
Posts: 13
Joined: Wed Aug 10, 2011 11:15 am

Re: subfig | Figure Numbering changes

Post by LaTex lover »

Thanks for the suggestions !

This didn't work (but thanks for the help anyways) :D
Post Reply