7

I am having an issues with the subfig and \ContinuedFloat command. I have a figure that has 4 subfigures. They are too large to fit on one page. I have tried using the \ContinuedFloat command to split it over two pages. It makes the images look correct and do what I want, but it is changing the figure number. I.e. the figure is supposed to be 3.4 (when I don't use the \ContinuedFloat command it is, but consequently runs off the page) but when I use the \ContinuedFloat command, it changes the figure number to 3.3 So now the figure looks right, but I have two figure 3.3. I am at a loss. Here is how I am coding it (I realize you don't have my images so it can't be run by someone else). If there is an issue with the coding, I would greatly appreciate if someone could point it out.

\documentclass[botnum, fleqn]{unmeethesis}

\usepackage{float}
\usepackage{subfig}
\usepackage{subfloat}
\begin{document}
\listoffigures

\begin{figure}[!htpb]
\centering
\subfigure[a]{
\includegraphics[width=4.5in]{figures1/ML_cycle_1_load}
}\\
\subfigure[b]{
\includegraphics[width=4.5in]{figures1/ML_cycle_1_unload}
}\\
\subfigure[c]{
\includegraphics[width=4.5in]{figures1/ML_cycle_2_load}
}\\
\end{figure}
\begin{figure}
\centering
\ContinuedFloat
\subfigure[d]{
\includegraphics[width=4.5in]{figures1/ML_cycle_2_unload}
}
\caption{This is my caption}
\label{ML_contour_2}
\end{figure}

\end{document}
5
  • 1
    Welcome to TeX.sx! Please add a minimal working example (MWE) that includes the needed preamble.
    – Caramdir
    Jun 5, 2012 at 0:32
  • A tip: If you indent lines by 4 spaces or enclose words in backticks `, they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it).
    – Caramdir
    Jun 5, 2012 at 0:32
  • Note that an MWE actually means that community members can copy-and-paste your code into their editor, press compile and immediately view the document. This is not the case with your code snippet. It doesn't have a preamble, \documentclass or a document environment. You may think those are elementary changes to the existing snippet, but it just helps others in starting with a working piece of code.
    – Werner
    Jun 5, 2012 at 2:01
  • Sorry! I am new to this. I hope the new edit helps.
    – Caroline
    Jun 5, 2012 at 2:14
  • 2
    This question seems to be a duplicate of this one: tex.stackexchange.com/questions/15647/…
    – user2574
    Jun 5, 2012 at 6:05

1 Answer 1

9

Your code snippet does not include a caption for the first figure environment, and therefore you technically don't need a \ContinuedFloat. Or, in a more general setting, a call to \ContinuedFloat is only needed when you have a caption on all the pages of the broken up float.

If you don't want a caption for the first figure, then don't include \caption and also drop \ContinuedFloat from the second.

I'm therefore guessing you must be after:

enter image description here

\documentclass{article}
\usepackage[demo]{graphicx}% http://ctan.org/pkg/geometry
\usepackage{subfig}% http://ctan.org/pkg/subfig
%\newsubfloat{figure}

\begin{document}
\begin{figure}[!htpb]
  \centering
  \subfloat[a]{%
    \includegraphics[width=4.5in]{figures1/ML_cycle_1_load}%
  }\\
  \subfloat[b]{%
    \includegraphics[width=4.5in]{figures1/ML_cycle_1_unload}%
  }\\
  \subfloat[c]{%
    \includegraphics[width=4.5in]{figures1/ML_cycle_2_load}%
  }
  \caption{This is my caption}
\end{figure}

\begin{figure}
  \centering
  \ContinuedFloat
  \subfloat[d]{%
    \includegraphics[width=4.5in]{figures1/ML_cycle_2_unload}%
  }
  \caption{(continued) This is my caption}
  \label{ML_contour_2}
\end{figure}
\end{document}

You didn't mention anything about hyperref compatibility, or List of Figure entries, although these can be compensated for/incorporated.

2
  • That isn't exactly what I am looking for. I want all four of the subfigures to have the same caption, so I only want the caption showing once and one fig #. In the caption, I reference a, b, c, and d. I have no idea what the hyperref compatibility is. I do have a List of Figures, and the entries are messed up when I use the \ContinuedFloat. Sorry if this confuses it more. I am new to using Latex. Using the fixed code, I am now getting body text between the \end{figure} and the \begin{figure}
    – Caroline
    Jun 5, 2012 at 2:05
  • 1
    Which of the two figures should carry the \caption then? Do you want only one caption to show up in the List of Figures? Do you want any of the subfigures to show up in the List of Figures? Since figures are floats, they'll move around, so it's possible that body text will end up between the two figures. I assume you don't want this. Read Keeping tables/figures close to where they are mentioned and How to influence the position of float environments like figure and table in LaTeX?
    – Werner
    Jun 5, 2012 at 5:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .