18

How do I make figure captions span multiple pages?

I have a very long caption for a figure and would like it to carry on to the next page.

EDIT: I would like this to work in both one sided and two sided modes

Lucas
  • 928
  • 3
  • 11
  • 20

4 Answers4

7

Instead of using a floating environment which can't handle page breaks you can use a simple list environment. To set a caption you can use the command \captionof. The command is provided by

Here an example

\documentclass{article}
\usepackage{kantlipsum}

\usepackage{capt-of}
\begin{document}
\kant[1-2]

\noindent\hrulefill

\begin{center}
\rule{3cm}{3cm}

\captionof{figure}[short caption]{%
\kant[4-6]}
\end{center}

\noindent\hrulefill

\kant[1]
\end{document}

enter image description here

Marco Daniel
  • 95,681
  • 1
    I am able to compile your example, but lengthening the caption further (e.g., by changing \kant[4-6] to \kant[3-6]) results in a ! Dimension too large error. Do you know of a solution? – user001 Aug 01 '20 at 04:07
  • Tthis solution does not work as expected if you use the caption package or the scrartcl class: the page break is always between the figure and the caption, and not inside the caption itself. – Stefano M Oct 10 '20 at 13:01
6

Well, @Marco Daniel answer did not work for me.

Searching google, though, I found this thread with the same issue (I reproduce the working code below): http://www.latex-community.org/forum/viewtopic.php?t=5881&f=45

The working answer to the thread is here: http://www.latex-community.org/forum/viewtopic.php?t=5881&f=45#p22785

Only to clarify, in this thread one wants to use subfigures in the same figure, using package subfig. However, it also worked for me when skipping all the subfig related features.

By the way, I am not using any latex standard documentclass. I am using elsarticle documentclass, in which the package caption also worked fine.

Enjoy.

CODE (replace <YOUR FIGURE>, <YOUR CAPTION> and <FIGURE LABEL> with the file name, figure caption and figure label, respectively):

\documentclass{article}

%...

\usepackage{caption}
% the following format will be used to emulate the captions produced by fltpage
\DeclareCaptionLabelFormat{adja-page}{\hrulefill\\#1 #2 \emph{(previous page)}}

%...

\begin{document}

%...

\begin{figure}
    \captionsetup{labelformat=empty}
    \centering
    \includegraphics[width=10cm]{<YOUR FIGURE>}
    \caption{}
\end{figure}
\clearpage
\begin{figure}
    \captionsetup{labelformat=adja-page}
    \ContinuedFloat
    \caption{<YOUR CAPTION>}
    \label{<FIGURE LABEL>}
\end{figure}

%...

\end{document}
Girardi
  • 233
  • Good to make sure stuff works for that environment. It is very a common one to use! – Lucas Aug 09 '13 at 00:56
  • I get an error with this method if the caption text is long enough to require more than one page. The specific error message is: ! Dimension too large. \caption@slc ...ke {#1}{#2}}\ifdim \wd \@tempboxa ... >\captionwidth \endgroup \.... Compilation was attempted with pdflatex (pdfTeX 3.14159265-2.6-1.40.19). – user001 Aug 01 '20 at 03:54
2

If you need two pages, e.g., figure on one page and a caption on the next, this works:

\begin{figure*}
\includegraphics{turtle.pdf}
\end{figure*}

\begin{figure*}
\caption{
   \label{turtle}
Here is a turtle.
}
\end{figure*}
Werner
  • 603,163
1

I managed it in this way:

\documentclass{article}
%
\usepackage{caption}
\usepackage{graphicx}
\DeclareCaptionLabelFormat{adja-page}{\hrulefill\\#1 #2 \emph{(previous page)}}
%
\begin{figure} [b!]
    \centering
    \includegraphics[width=\textwidth]{2.png}
    \caption[]{\textit{(see next page)}}
\end{figure}
\begin{figure} [t!]
    \captionsetup{labelformat=adja-page}
    \ContinuedFloat
    \caption[Figure]{Description}
    \label{<FIGURE LABEL>}
\end{figure}
%
\end{document}