# How shoud I manage captions and sub captions with float and non float items?

I am currently writing my PhD thesis and I am using this code to put some figures or tables on the left page. So, I have two kinds of figures, some are in a float, some are not. In both cases, I often use sub floats (with subfigure package for floats, and \captionof{subfigure} for left pages figures).

The issue is about sub caption labelling. For example, I have a left page figure with two subfigures, let's say 1.A and 1.B.

If I put a regular floating figure after this and let's say 2 subs, I get 2.C and 2.D like if figure number is correctly increased and subfigure letter is continuous.

My question is the following:

How do you "strongly" delimit figures and subfigures so that referencing is correct ?

I tried to define a new environment, to move labels and captions commands, etc. without success. What is the general way to proceed ?

EDIT : Here is my general syntax

for left page figures I use the command provided in the link above :

\addfig{
*subfigure contents*
\captionof{subfigure}
\label{subfigure}

*subfigure contents*
\captionof{subfigure}
\label{subfigure}
}


and then a floating one

\begin{figure}
\subfloat[title]{
*subfigure contents*
\label{subfigure}
}
\subfloat[title]{
*subfigure contents*
\label{subfigure}
\end{figure}.


Subfigures labels are continued between the two figures.

-
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. – lockstep Oct 1 '12 at 8:21
HelloYes I was working on it, but I cannot reproduce the error outside my thesis. No labelling issues with the MWE I've been making. – Flyingbike Oct 1 '12 at 9:53
the only way in standard latex is to put a \clearpage before and after your non-floating figure to stop floats floating past it and get out of sequence. A slightly less intrusive variant is the \FloatBarrier command from the placeins package which essentially just adds \clearpage if it is needed because there are pending floats, otherwise the forced page break is avoided. – David Carlisle Oct 1 '12 at 10:20
My previous comment was about the floats themselves getting out of sequence.If you are getting 2.C it means that you are not resetting the subfigure counter when figure counter is incremented (which should be automatic) would need to see the example code – David Carlisle Oct 1 '12 at 10:23
Hello and thanks for your help. I'm gonna try \FloatBarrier, but I don't think this will help. I edited my post to put in code I use. – Flyingbike Oct 1 '12 at 11:42

In the preamble:

\usepackage{float}


In the document:

\begin{figure}[H]
*subfigure contents*
\captionof{subfigure}
\label{subfigure}

*subfigure contents*
\captionof{subfigure}
\label{subfigure}
}
\end{figure}

-
Hello Thiago, I don't get it. Could you add a word to explain ? – Flyingbike Oct 1 '12 at 12:48
The float package allows the insertion of a figure exactly where it is placed using [H], so instead of directly inserting pictures like a "character" (without figure environment), fits it into the figure environment giving continuity to the reference counters. – tecepe Oct 1 '12 at 12:57
Ok thank you, but I can't use it. When I place figures on left pages, they can NOT be included in a floating environment. But your idea is very good and I learned the use of 'H' that could be useful elsewhere. – Flyingbike Oct 1 '12 at 13:08
May I ask you why not? – tecepe Oct 1 '12 at 13:16