Graphics, Figures & Tables ⇒ How to allow caption break into two pages
How to allow caption break into two pages
I have a big figure with a very long caption. Together they require more than one page.
Then, Latex only shows part of the caption, and the figure + caption together are pushed to the end of the chapter.
Is it possible to break the caption into multiple pages? If not, is it at least possible to have the figure and caption at adjacent pages?
Anyone has an idea?
Thanks,
Tamar.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
How to allow caption break into two pages
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
How to allow caption break into two pages
I have 3 subfigures inside the figure environment (see code below).
Before, they were typeset one above the other.
Now with the fltpage they are typeset side by side, so the first one appears fully, the second one is truncated and the third does not appear at all.
I've searched the forum and found a related old post, suggesting the usage of \afterpage - which didn't work either (see http://www.latex-community.org/forum/vi ... page#p8076).
Then I received the error message "if\@captype
topcap
1.258 \begin{align}
?"
Here is a sample of my original code:
Code: Select all
\begin{figure}[t!]
\centering
\subfigure[]{
\includegraphics[width=10cm]{subfig1.eps}
\label{fig:subfig1} }
\subfigure[]{
\includegraphics[width=10cm]{subfig2.eps}
\label{fig:subfig2} }
\subfigure[]{
\includegraphics[width=10cm]{subfig3.eps}
\label{fig:subfig3} }
\caption [blah]
{ \label{fig:fullfig} blah blah blah \subref{fig:subfig1}
blah blah \subref{fig:subfig2} blah blah
}
\end{figure}
Thanks a lot,
Tamar.
How to allow caption break into two pages
in the example code below I show one possibility. The idea is to use some of the features provided by the subfig and caption packages (by the way, I noticed from your code that you are using the obsolete subfigure package; you should use subfig instead).
Now, to the code: the idea is to use a "continued float": the first part of the float will contain the three subfigures and the second part, the caption.
The three subfigures are placed inside a standard figure environment whose label format is declared empty to suppress the label produced by the corresponding \caption command; then a second figure environment is used to continue the previous one and to typeset the caption. A new type of caption label was defined also, in order to emulate the style produced by the fltpage package.
Remarks: 1) I used the demo option for the graphicx package to make the code compilable for everyone (figures will be replaced by black rectangles). Please delete that option in your actual code.
2) Feel free to adapt my example according to your needs.
3) Please make sure that you have installed a recent version of the caption package.
Code: Select all
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
% the following format will be used to emulate the captions produced by fltpage
\DeclareCaptionLabelFormat{adja-page}{\hrulefill\\#1 #2 \emph{(previous page)}}
\usepackage{subfig}
\begin{document}
\begin{figure}
\captionsetup{labelformat=empty}
\centering
\subfloat[][]{\includegraphics[width=10cm]{subfig1.eps}}\\
\subfloat[][]{\includegraphics[width=10cm]{subfig1.eps}}\\
\subfloat[][]{\includegraphics[width=10cm]{subfig1.eps}}
\caption{}
\end{figure}
\clearpage
\begin{figure}
\captionsetup{labelformat=adja-page}
\ContinuedFloat
\caption{three subfigures text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text text text text}
\label{fig:test}
\end{figure}
\clearpage
\end{document}
How to allow caption break into two pages
Just one more thing: I'd like to refer to the subfigures in this caption, but if I use \subref it produces the error message
"! Argument of \@caption has an extra }"
I can use \ref, but then the label I get is "1a", rather than "a".
Here is the code I used (adapted from yours):
Code: Select all
\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
% the following format will be used to emulate the captions produced by fltpage
\DeclareCaptionLabelFormat{adja-page}{\hrulefill\\#1 #2 \emph{(previous page)}}
\usepackage{subfig}
\begin{document}
\begin{figure}
\captionsetup{labelformat=empty}
\centering
\subfloat[][]{\includegraphics[width=10cm]{subfig1.eps}\label{fig:sub1}}\qquad
\subfloat[][]{\includegraphics[width=10cm]{subfig2.eps}\label{fig:sub2}}\qquad
\subfloat[][]{\includegraphics[width=10cm]{subfig3.eps}\label{fig:sub3}}
\caption{}
\end{figure}
\clearpage
\begin{figure}
\captionsetup{labelformat=adja-page}
\ContinuedFloat
\caption{three subfigures \subref{fig:sub1} text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text text text text text text text text text text}
\label{fig:test}
\end{figure}
\clearpage
\end{document}
How to allow caption break into two pages
Code: Select all
\makeatletter
\DeclareRobustCommand*\subref{\@ifstar\sf@@subref\sf@subref}
\makeatother
Re: How to allow caption break into two pages
