1

This has been asked before but none of them solve my problem. I have a three-page pdf which includes a Table, so I would like to have it captioned Table. To include it in my thesis I have tried the followings:

  1. With the following what I get is only first page of the pdf, I have tried pages=[3] and pages=[1,2,3], pages={-} and pages={1-}. did not work
\begin{table}[h]
 \centering
 \caption{caption.}
 \label{tbl:table}
 \includegraphics[width=\textwidth,pages={1-}]{fig/table.pdf}
\end{table}
  1. The following put the tables on tope of the text! so it overlaps with the the page. I have tried \newpage. did not work.
\begin{table}[h]
\centering
    \caption{caption.}
\includepdf[pages={-},  width=\textwidth, 
  height=\textheight, pagecommand={\label{tbl:table}}, 
]{fig/table.pdf}
\end{table}
  1. the one that works fine is the following. however I cannot place properly the caption. It appears on the first row of the table.
\includepdf[pages={1-},  width=\textwidth, 
  height=\textheight, pagecommand={\label{table} ,\captionof{s}{caption}}, 
]{fig/table.pdf}

Please help if you know how to make it right. thanks in advanced.

  • 1
    A float like table cannot contain material that spans multiple pages. Includegraphics can only include one page at a time. Includepdf creates full pages so too large for a float. Perhaps you should give more detail as to what your data is, then perhaps there are better alternatives – daleif Jul 09 '21 at 09:28
  • the pdf contains a table that is three pages long. – user246035 Jul 09 '21 at 09:33
  • 1
    Moreover, with \includegraphics is page (singular) and obviously, just one number (e.g. page=1) and of course repeat the command for the other pages. With \includepdf is not pages=[1,2,3] but pages={1,2,3} and {-} and {1-} should work too, but without a MWE like this is impossible to assure what is failing in your case. – Fran Jul 09 '21 at 09:33
  • Then you cannot use a float like table. Why do you have the table as a pdf in the first place? Latex is fully capable of typesetting multipage tables using, say, longtable – daleif Jul 09 '21 at 09:34
  • yes includepdf works, just that I cannot position the caption right. do you have any idea? It is easier for me to draw the table with word! – user246035 Jul 09 '21 at 09:35
  • As said, a float in not the place for a multipage PDF. – Fran Jul 09 '21 at 09:36
  • ok. so what would you do that? – user246035 Jul 09 '21 at 09:37
  • Just remove the \begin{table} and \end{table} lines. BTW, include a Word table in a PDF in LaTeX is like go to a five stars restaurant to ask a burger :( – Fran Jul 09 '21 at 09:41
  • then it is going the be third option in the question text, which i have trouble with the caption. – user246035 Jul 09 '21 at 09:43
  • See the caption package a f the \captionof command, but as said, this is going to look bad – daleif Jul 09 '21 at 10:18

0 Answers0