I want to make a document out of a single table, for inclusion into PowerPoint, etc., as a PDF just the size of the table, with a small customizable margin. Which document class should I use, and how do I set the margins?
Asked
Active
Viewed 1,128 times
5
-
See Compile a latex document into a png image that's as short as possible. – Martin Scharrer Apr 06 '11 at 15:01
1 Answers
5
standalone would be a good choice.
\documentclass[border=1em]{standalone}
\begin{document}
\begin{tabular}{cc}
a & b \\
c & d
\end{tabular}
\end{document}
Note that you don't need the \begin{table}\centering or the \end{table} that normally accompanies a table in a standard document. This is because what these commands do is irrelevant for a standalone table. You don't need to put the table in a float, since there's no surrounding text it needs to fit into. You don't need to center it, because there's nothing to center it against. If it's standing alone, it will take up all the space: centering doesn't mean anything in this context...
David Carlisle
- 757,742
Seamus
- 73,242
-
2The upcoming version of
standalonealso supports the direct conversion to PNG or other image formats (using an external SW like Image Magick or Ghostscript). – Martin Scharrer Apr 06 '11 at 15:05 -
I tried with a \begin{table}\centering ..., but was getting: ! LaTeX Error: Not in outer par mode. -- on the \centering. Switching to \article, \pagenumering{gobble} and pdfcrop solved it for now. How standalone can be made to work for tables? – Alexy Apr 06 '11 at 22:29
-
@Alexy if you're just using standalone for a table, you don't need to center it: center it with respect to what!? You don't need the table either, just the inner tabular. There's no point making a float if you want to use standalone. It's not going to float anywhere... – Seamus Apr 06 '11 at 22:31
-
-
@Seamus: It's mostly done, but still needs some work and testing. I hope I get it out in the next few weeks. – Martin Scharrer Apr 08 '11 at 13:02