Split a figure automatically

pdf

I have a long table as a PDF file about two or three pages. Is there a way to automatically have this PDF continuously shown on pages? I want also to have a caption for that. I prefer to use include figure instead of include pdf unless you have a better suggestion to make it nicer. It might be very simple. I want to show this pdf file continuously with a nice caption at the end. What I do is:

\begin{figure}
        \centering
        \includegraphics{a.pdf}
        \caption{Caption}
        \label{fig:enter-label}
 \end{figure}

But it only prints on the first page where it appears.

Best Answer

"automatic" is a bit tricky as typically you need to trim parts of the original, at least losing the page numbers.

Here I include a two page table from the longtable package into another document. Scale it slightly so it will fit while adding new page numbers and caption, and trim out the original caption and page head/foot, and some text from a following section.

The longtable manual looks like:

enter image description here

And the first table included into another document, and re-captioned at the end:

enter image description here

\documentclass[a4paper]{article}

\usepackage{graphicx}

\begin{document}

This is a new main document

\begin{figure}[p]
  \centering
   % /usr/local/texlive/2024/texmf-dist/doc/latex/tools/longtable.pdf
   \fbox{\includegraphics[page=2,scale=0.9,trim=4cm 4cm 4cm 5cm,clip]{longtable.pdf}}
\end{figure}
\begin{figure}[p]
  \centering
   % /usr/local/texlive/2024/texmf-dist/doc/latex/tools/longtable.pdf
  \fbox{\includegraphics[page=3,scale=0.9,trim=4cm 10cm 4cm 5cm,clip]{longtable.pdf}}
  \caption{more normal to caption multi-page tables at the start
           so people know what they are about before reading them}
\end{figure}


\clearpage

and more text
\end{document}
Related Question