[Tex/LaTex] Standalone package creates a page with a fixed width

paper-sizestandalone

Recently I found the standalone package. I am using it to create figures and such in external files. But everytime content is created the width of the page seems to be fixed, it does not shrink to the minimal width.

Here my example *.tex file:

\documentclass{standalone}
\usepackage{tikz}

\begin{document}

Test

\end{document}

And the produced content (the actual document is the white stuff with the Text 'Test' on it):
enter image description here

I am using pdflatex (MiKTeX 2.9).

Best Answer

Deleting (or commenting out) any blank lines between the material and \end{document} solves the problem:

\documentclass{standalone}

\begin{document}
%
Test
%
\end{document}

enter image description here

Related Question