[Tex/LaTex] Multi-page subfigures using the subfigure package

floatssubfloats

I'm trying to create figure that contains many subfigures and I want it to span multiple pages. I'm using the subfigure package to create my figure:

\usepackage{subfigure}

\begin{figure}[!hbp]
\begin{center}
    \subfigure[caption1]{\includegraphics[width = 12cm]{img/plot.png}}
   \subfigure[caption2]{\includegraphics[width = 12cm]{img/plot2.png}}
\end{center}
\end{figure}

After some googling I found a solution but using another package called subfig. However when I tried to use it, I get an error. I get the error just the moment I put the declaration to use \usepackage{subfig}.

Here is the error:

enter image description here

So I either need a solution to work with subfigure or a solution to work with subfig.

Best Answer

If you are going to stack these vertically, you might as well use a separate figure for each image. (I had to shrink it a little to fit 2 per page.)

\documentclass{article}
\usepackage{graphicx}
\usepackage{mwe}

\newcounter{subfig}[figure]
\newcommand{\subcap}[1]% caption
{\refstepcounter{subfig}(\alph{subfig}) {#1}\par\medskip}

\begin{document}
\begin{figure}[!htbp]
\centering\subcap{caption1}\includegraphics[width = 10cm]{example-image-a}
\end{figure}
\begin{figure}[!htbp]
\centering\subcap{caption2}\includegraphics[width = 10cm]{example-image-b}
\end{figure}
\end{document}

Here is a possible \contcaption, but for multipage figures with a single caption you really need a new environment (not figure).

\makeatletter
\newcommand{\contcaption}[0]% no arguments
{\@makecaption\fnum@figure{continued}}%
\makeatother