Use \captionof in conjunction with \subfigure?
Since this seems like an out-of-the-ordinary setting for a figure, it may require some manual fiddling. The following example sets a list-like environment containing the "figure", and it allows your caption to break across the page boundary.
\documentclass{scrartcl}
\usepackage{graphicx,lipsum,afterpage,subcaption}
\usepackage{enumitem}
\begin{document}
\lipsum[1-5]
\makeatletter
\afterpage{\begin{center}
\def\@captype{figure}% Fake a figure environment
\subcaptionbox{Sub1}{\includegraphics[width=.2\linewidth]{example-image-a}} \qquad
\subcaptionbox{Sub2}{\includegraphics[width=.2\linewidth]{example-image-a}} \qquad
\subcaptionbox{Sub3}{\includegraphics[width=.2\linewidth]{example-image-a}} \par\bigskip
\subcaptionbox{Sub4}{\includegraphics[width=.2\linewidth]{example-image-a}} \qquad
\subcaptionbox{Sub5}{\includegraphics[width=.2\linewidth]{example-image-a}} \qquad
\subcaptionbox{Sub6}{\includegraphics[width=.2\linewidth]{example-image-a}}
\end{center}
\addcontentsline{lof}{figure}{\protect\numberline{\thefigure}A length figure}% LoF entry
\settowidth{\@tempdima}{Figure~\thefigure: }%
\begin{itemize}[labelindent=\parindent,labelwidth=\@tempdima,rightmargin=\parindent,leftmargin=\dimexpr\@tempdima+\parindent]
\item[Figure~\thefigure:]
\lipsum[6-10]
\end{itemize}
}
\makeatother
\lipsum[6-12]
\end{document}
The sub-figures are set using subcaption
using the regular interface inside a center
environment. A faked figure
is initiated by defining the caption type \@captype
. Setting of the caption is inside a regular list itemize
with appropriate width settings (to match your other figures).
A short LoF-entry is set manually via \addcontentsline{lof}{figure}{<short entry>}
. This is displayed with the inclusion of \listoffigures
.
All of the above is passed to \afterpage
(supplied by afterpage
) in order to provide a seemless transition from page-to-page. One may play around with the spacing following the "figure". For example, adding something like \addvspace{\textfloatsep}
.
The page layout was added via \usepackage{showframe}
in the preamble; removed in the above code.
This solution is based on three ideas:
- We use a
center
environment instead of afigure
since the content of afigure
is limited to one page only. (This idea was stolen from Werner.) We use\setcaptiontype{figure}
(or\captionsetup{type=figure}
) to make this environment known to the (sub)caption package asfigure
. BTW: Please don't use\def\@captype{figure}
when using thecaption
package. When doing so this solution won't work correctly withhyperref
, caption settings for figures would not apply etc. - We use
\afterpage
to let this thing start on a page. (This idea was stolen from Werner, too.) - We use
\captionsetup{box=none,parbox=none}
to avoid the usage of boxes when typesetting the caption since boxes would limit the caption to one page only. (Finally a idea from myself ;-))
Example code, shamelessly stolen from Werner and modified:
\documentclass{scrartcl}
\usepackage{graphicx,lipsum,afterpage,subcaption}
\begin{document}
\lipsum[1-5]
\afterpage{\begin{center}
\setcaptiontype{figure}% Fake a figure environment
\subcaptionbox{Sub1}{\includegraphics[width=.2\linewidth]{example-image-a}} \qquad
\subcaptionbox{Sub2}{\includegraphics[width=.2\linewidth]{example-image-a}} \qquad
\subcaptionbox{Sub3}{\includegraphics[width=.2\linewidth]{example-image-a}} \par\bigskip
\subcaptionbox{Sub4}{\includegraphics[width=.2\linewidth]{example-image-a}} \qquad
\subcaptionbox{Sub5}{\includegraphics[width=.2\linewidth]{example-image-a}} \qquad
\subcaptionbox{Sub6}{\includegraphics[width=.2\linewidth]{example-image-a}}
\captionsetup{box=none,parbox=none}
\caption[A length figure]{%
\lipsum[6-10]}
\end{center}
}
\lipsum[6-12]
\end{document}
There is no need to switch to the subcaption
package since this solution works with the subfigure
package, too:
\documentclass{scrartcl}
\usepackage{graphicx,lipsum,afterpage,caption,subfigure}
\begin{document}
\lipsum[1-5]
\afterpage{\begin{center}
\setcaptiontype{figure}% Fake a figure environment
\subfigure[Sub1]{\includegraphics[width=.2\linewidth]{example-image-a}} \qquad
\subfigure[Sub2]{\includegraphics[width=.2\linewidth]{example-image-a}} \qquad
\subfigure[Sub3]{\includegraphics[width=.2\linewidth]{example-image-a}} \par\bigskip
\subfigure[Sub4]{\includegraphics[width=.2\linewidth]{example-image-a}} \qquad
\subfigure[Sub5]{\includegraphics[width=.2\linewidth]{example-image-a}} \qquad
\subfigure[Sub6]{\includegraphics[width=.2\linewidth]{example-image-a}}
\captionsetup{box=none,parbox=none}
\caption[A length figure]{%
\lipsum[6-10]}
\end{center}
}
\lipsum[6-12]
\end{document}