# Multi-page Figure with subcaption package

I have a figure with subfigures defined using the subcaption package (*not the deprecated subfig or subfigure). I need the parent figure to span two pages with two subfigs on each page. I have achieved this using the \ContinuedFloat command, however my subfigure numberings are resetting between pages instead of resuming.

Below is a minimal example:

\usepackage{graphicx,subcaption}

\begin{figure}[H]
\caption{My Figure}
\begin{subfigure}{\textwidth}
\caption{Fig 1}
\includegraphics[...]{something.jpg}
\end{subfigure}
\begin{subfigure}{\textwidth}
\caption{Fig 2}
\includegraphics[...]{something.jpg}
\end{subfigure}
\end{figure}
% allow break
\begin{figure}[H]
\ContinuedFloat % continue from previous page
\begin{subfigure}{\textwidth}
\caption{Fig 3}
\includegraphics[...]{something.jpg}
\end{subfigure}
\begin{subfigure}{\textwidth}
\caption{Fig 4}
\includegraphics[...]{something.jpg}
\end{subfigure}
\end{figure}


In this example 'Fig 3' and 'Fig 4' are incorrectly labelled (a) and (b) instead of (c) and (d).

How can I resume the subfig numbering correctly?

-
Welcome to TeX.sx! Don't use [H], it's that simple. There are very good reasons not to use it. – egreg Apr 22 '13 at 22:17
@egreg, I know it's been a while since you posted, but could you elaborate on why one shouldn't use it? – user1717828 Apr 11 at 17:07
@user1717828 The only thing guaranteed by [H] is bad pagination; if there's not enough space for the object, it will go to the next page, leaving the other one with a big space to fill up. – egreg Apr 11 at 17:41

It works for me (once I make your example compilable)

subcaption.sty    2013/02/03 v1.1-62 Sub-captions (AR)
caption.sty    2013/02/03 v3.3-65 Customizing captions (AR)
caption3.sty    2013/02/03 v1.5-62 caption3 kernel (AR)


\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subcaption}
\listfiles
\begin{document}
\begin{figure}[H]
\caption{My Figure}
\begin{subfigure}{\textwidth}
\caption{Fig 1}
\includegraphics[]{something.jpg}
\end{subfigure}
\begin{subfigure}{\textwidth}
\caption{Fig 2}
\includegraphics[]{something.jpg}
\end{subfigure}
\end{figure}
\clearpage
\begin{figure}[H]
\ContinuedFloat % continue from previous page
\begin{subfigure}{\textwidth}
\caption{Fig 3}
\includegraphics[]{something.jpg}
\end{subfigure}
\begin{subfigure}{\textwidth}
\caption{Fig 4}
\includegraphics[]{something.jpg}
\end{subfigure}
\end{figure}

\end{document}

-
It works for me, too, trying both the very latest version from CTAN and the latest version offered by TeXlive 2012 (the one David has used). So Fred, what version of the caption package and what version of the subcaption package are you using? – Axel Sommerfeldt Apr 23 '13 at 5:30
Strange! I have caption v3.3 installed via tlmgr I can't see a version for my subcaption.sty file - what should it be? – Fred Apr 23 '13 at 8:10
Hmm, I've just tried your example and it works fine for me too - I guess that must point the finger to a conflict in the project I'm working on? – Fred Apr 23 '13 at 8:13
@Fred If you add \listfiles as in my answer you get a listing in the log at the end of all packages and their versions – David Carlisle Apr 23 '13 at 8:16
@Fred Usual technique for making a minimal working example start with the project that has the problem and remove stuff until the problem goes away (in which case the last thing you removed is at fault) or the document is small enough to post here. – David Carlisle Apr 23 '13 at 8:17

According to http://tex.stackexchange.com/a/15693/44458, \phantomcaption can be necessary under certain circumstances. In my case of TexLive 2012 in Xubuntu 12.04 it helped to solve the problem:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subcaption}
\listfiles
\begin{document}
\begin{figure}[H]
\caption{My Figure}
\begin{subfigure}{\textwidth}
\caption{Fig 1}
\includegraphics[]{something.jpg}
\end{subfigure}
\begin{subfigure}{\textwidth}
\caption{Fig 2}
\includegraphics[]{something.jpg}
\end{subfigure}
\phantomcaption % new inserted command
\end{figure}
\clearpage
\begin{figure}[H]
\ContinuedFloat % continue from previous page
\begin{subfigure}{\textwidth}
\caption{Fig 3}
\includegraphics[]{something.jpg}
\end{subfigure}
\begin{subfigure}{\textwidth}
\caption{Fig 4}
\includegraphics[]{something.jpg}
\end{subfigure}
\end{figure}

\end{document}

-
Sure, but that probably means that you don't have a float that is considered "continued" (i.e., having the same number). I think this should rather be a comment. – Werner Jan 20 '14 at 15:10
This fixed this issue for me too, under Debian Wheezy. Perhaps it's something to do with out of date .deb installers, or a bug in the debian fork of TeX. – tehwalrus Sep 28 '14 at 21:36