I'd like to generate a standalone pdf containing a pgf/tikz image and a tabular.
I'm almost getting the desired result but there is a paragraph between the image and the tabular that breaks my layout (I guess it is due to the fact that the empty paragraph takes the full textwidth).
What I do to get such result is the following:
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgf}
\begin{document}
\begin{tikzpicture}
...
\end{tikzpicture}
%This empty line creates the undesired paragraph
\begin{tabular}
...
\end{tabular}
\end{document}
Best Answer
Update 2011/12/21
I now release
standalone
v1.0 which comes with avarwidth
option to allow for vertical content with variable width. It uses thevarwidth
environment (and package) internally which is based onminipage
. Using this option you can use a paragraph break (i.e. an empty line) to stack both things. If you want more vertical space try a\vspace{..}
between them.Original answer:
You need to stack the two elements manually without using a line break or new paragraph. You can use a TikZ picture like Ignasi suggested, wrap both into a
tabular
or use\shortstack{...\\...}
. It is also possible to stack it using plainTeX commands:\vbox{\hbox{..}\hbox{..}}
.Examples:
and
With the optional argument of
\shortstack
you can select the horizontal alignment of the blocks.I reused the example code from Ignasi to allow for easy comparison.