Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
1  
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

2 Answers 2

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)

enter image description here

\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}
share|improve this answer
1  
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
1  
@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}
share|improve this answer
    
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 at 15:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.