I usually save my tables as standalone PDFs, generated by compiling a standalone
document and then include them in the main file via \includegraphics{pdf.name}
However, I now have a two-pages table made with longtable
and I would like to include it with the same method, saving it as a separate PDF and then including it with includegraphics
.
This does not seem to work and has many issues:
standalone
class do not work withlongtable
s- If I save the table as a normal
article
then it can't be included withincludegraphics
So my question is: How should I proceed to include a multi-page table from an external file? Is it even possible?
Best Answer
This would be a perfect application of the
standalone
bundle.You can store your
longtable
table
in (say),mytablefile.tex
, and theninput
it into your main file usinginput
.Here are two files that demonstrate the idea- note that
mytablefile.tex
uses thestandalone
documentclass whilemainfile.tex
usesstandalone
package. This is a very simple demonstration, but you can do some more sophisticated things- explore themanual
and this site for more details.Note that with your current approach your table will not inherit the font style of your main document- furthermore, it will likely be scaled and may look out of place- the technique I have demonstrated does not have this problem.
mainfile.tex
mytablefile.tex