I have a PDF document, which contains a table over multiple pages. I need to include this PDF as a single long/multipage table in the PDF document.
I tried:
\begin{table}[]
\includegraphics[clip, trim=2cm 2cm 2cm 2cm, page=1, width=\textwidth]{table.pdf}
\includegraphics[clip, trim=2cm 2cm 2cm 2cm, page=2, width=\textwidth]{table.pdf}
\caption{Example}
\end{table}
The result looks as follows:
The 2nd page of the PDF goes into the footer of the page.
A solution for multipage figures can be seen here: https://stackoverflow.com/a/1089881/605890
You can find a mwe here: https://github.com/boldt/latex-table
Best Answer
There are many ways.
\includegraphics
with\captionof
The table document is trimmed via
pdfcrop table.pdf
.The caption is added by
\captionof
. The continued caption uses an empty optional argument of\captionof
to avoid another entry in the list of tables.Package
pdfpages
Multiple documents can also be included via package
pdfpages
:But the placement of the caption is not so easy.
CSV data
If you are the creator of the table, then you can save it as
.csv
file and import it in LaTeX. Example with packagecsvsimple
andlongtable
:And the data file
test-table.csv
:Advantages are more control over the table layout, page breaks, ...