I have lots of subfigures that I want to split across multiple pages. These subfigures are of different sizes. I'm still editing my document so figures are being pushed around. I don't want to hard-wire where the page-break between the subfigures occurs.
How can I:
- Automatically get a subfigure to start a new page when the current page is full?
- ONLY add a caption when a new page is started?
- Prevent other contents from going between the subfigures?
Here is an example of my current document. As you can see \ContinueFloat is hard-wired. Other contents are going between the first and last 5 subfigures.
\begin{figure}
\centering
\subfloat[]{\label{fig:1}\includegraphics[width=0.43\textwidth]{fig1}}
\qquad
\subfloat[]{\label{fig:2}\includegraphics[width=0.43\textwidth]{fig2}}
\subfloat[]{\label{fig:1}\includegraphics[width=0.43\textwidth]{fig1}}
\qquad
\subfloat[]{\label{fig:2}\includegraphics[width=0.43\textwidth]{fig2}}
\qquad
\subfloat[]{\label{fig:1}\includegraphics[width=0.43\textwidth]{fig1}}
\qquad
\caption{Here are the first 5 figures of a continued figure.}
\label{fig:cont}
\end{figure}
\begin{figure}
\ContinuedFloat
\centering
\subfloat[]{\label{fig:1}\includegraphics[width=0.43\textwidth]{fig1}}
\qquad
\subfloat[]{\label{fig:2}\includegraphics[width=0.43\textwidth]{fig2}}
\qquad
\subfloat[]{\label{fig:1}\includegraphics[width=0.43\textwidth]{fig1}}
\qquad
\subfloat[]{\label{fig:2}\includegraphics[width=0.43\textwidth]{fig2}}
\qquad
\subfloat[]{\label{fig:1}\includegraphics[width=0.43\textwidth]{fig1}}
\caption{Here are the last 5 figures of a continued figure.}
\label{fig:cont}
\end{figure}
Best Answer
Interestingly,
\subfloat
seems to end with\ignorespaces
, so you either need a blank line,\allowbreak
or something else which allows a linebreak. All the subfloats are formatted in one go, so\ContinuedFloat
is not needed.I can turn this into an environment using udbox (see https://tex.stackexchange.com/questions/563109/render-captions-above-figures-with-caption-below-includegraphics-while-using-e/563241?r=SearchResults&s=2|22.2526#563241).