Graphics, Figures & TablesSubfigures over more than 2 pages

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Heleen
Posts: 2
Joined: Mon Mar 16, 2009 9:10 pm

Subfigures over more than 2 pages

Post by Heleen »

Hello,

I've been using LaTeX for a while and I'm doing a project at the moment which has a lot of testing figures (characters A-Z, a-z, numbers 0-9). I've put them all as subfloats in a figure and I've used \ContinuedFloat to make them span over 5 pages. However, when it gets to the 2nd \ContinuedFloat it starts numbering the subfigure's Figure number backwards, even though it should still be the same figure (it counts from Figure 1 to Figure 0, Figure -1, Figure -2, Figure -3). After this figure there are more figures and those then count up again (Figure -2, Figure -1, Figure 0, Figure 1, Figure 2).
The subfigure numbers of the subfigures, are correctly numbered.
I've added an example image to show what's happening.

I'll add a part of the code from somewhere in the middle to show how I've inserted all the subfigures:

Code: Select all

		\subfloat[\label{fig:test-15}]{\includegraphics[height=28mm, keepaspectratio=true]{testimages/test-character-15.jpg}}%
	\end{center}
\end{figure}

\begin{figure}[!hbtp]
	\ContinuedFloat 
	\begin{center}
		\subfloat[\label{fig:test-16}]{\includegraphics[height=28mm, keepaspectratio=true]{testimages/test-character-16.jpg}}%
            	\qquad
My project is due in soon so I really hope someone can help me.
Thanks in advance!
Heleen
Attachments
Subfigure over more than 2 pages: wrong figure numbers.
Subfigure over more than 2 pages: wrong figure numbers.
subfig.png (87.98 KiB) Viewed 14233 times

Recommended reading 2024:

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

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

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

Re: Subfigures over more than 2 pages

Post by sommerfee »

\ContinuedFloat only works really well when each (partly) figure has a \caption command, and if the position= setting was setup right: Usually \caption resets the subfigure counter, so you need \ContinuedFloat to prevent this. If there is no \caption, you usually don't need \ContinuedFloat. But getting the right figure and subfigure numbers can sometimes be a pain in such situations.

So I would suggest removing \ContinuedFloat in figures without a \caption. If the numbering is still not right afterwards, this needs to be adjusted manually with \setcounter{subfigure}{<value>} inside the affected figures.
Heleen
Posts: 2
Joined: Mon Mar 16, 2009 9:10 pm

Subfigures over more than 2 pages

Post by Heleen »

Thank you very much!
Removing the \ContinuedFloat didn't work. It would just go on counting on the next page where it shouldn't.
What does work is: instead of having just the same label at the end of each figure, I put an empty caption around it: \caption[\label{label}]{}. So like this:

Code: Select all

		\subfloat[\label{fig:test-33}]{\includegraphics[height=28mm, keepaspectratio=true]{testimages/test-character-33.jpg}}%
		\caption[\label{fig:test-charimgs}]{}
	\end{center}
\end{figure}

\begin{figure}[]
	\ContinuedFloat
	\begin{center}
		\subfloat[\label{fig:test-34}]{\includegraphics[height=28mm, keepaspectratio=true]{testimages/test-character-34.jpg}}%
	            \qquad
That did the trick.
Again, thanks very much!

Edit: What I didn't realise, was that the empty captions do show up in the List of Figures.

Code: Select all

B.1 Test Results of 95 Images . . . . . . . . . . . . . . . . . . . . . . 67
B.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
B.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
B.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
B.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
B.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
B.2 Thick Stroke Testing. . . . . . . . . . . . . . . . . . . . . . . . . 72
I don't really find that a big problem, just something I thought I should mention. I don't think there's a way around that other than manually setting the counter.
Edit2: Sorry for all the edits, but I found a solution for the problem on these forums :). Just put \captionsetup{list=no} at the beginning of the captions you don't want to end up in the List of Figures, and \captionsetup{list=yes} after these captions. The following figures will show up in the List of Figures :D.
Post Reply