When I try to fit the page size to my tikz image, too much is cropped. No matter whether I use \documentclass{standalone}, \documentclass[preview=true]{standalone} or \usepackage[active,tightpage]{preview}\PreviewEnvironment{tikzpicture}. The complete source:




        \draw (-8,0) -- (8,0);
        \filldraw[shift={(8,0)},scale=0.25] +(-210:1) -- +(210:1) -- +(0:1) -- cycle;
        \draw (0,-8) -- (0,8);
        \filldraw[shift={(0,8)},scale=0.25,rotate=90] +(-210:1) -- +(210:1) -- +(0:1) -- cycle;
    \newcommand\hyper[4][]{\draw[mark=*,mark options={fill=black}] plot [#1] ({#2*exp(#4)+#3*exp(-#4)}, {#2*exp(#4)-#3*exp(-#4)})}
    \newcommand\hyperline[6]{\draw ({#1*exp(#3)+#2*exp(-#3)}, {#1*exp(#3)-#2*exp(-#3)}) -- ({#4*exp(#6)+#5*exp(-#6)}, {#4*exp(#6)-#5*exp(-#6)})}
    \foreach \a in {-1, 1}{%
        \foreach \b in {-1, 1}{%
            \begin{scope}[very thin, color=gray]
        \foreach \k in {0,...,2}{%


This looks like this:

enter image description here

After reading Transparency in tikz, preview package and xelatex, I tried to set the size manually:


But this gives me the error message:

! Package geometry Error: \paperwidth (0.0pt) too short.

1 Answer 1


Ok, solved the problem with standalone. It was the empty line after the tikzpicture environment. Like meantioned here: Standalone package creates a page with a fixed width

And the following makes it work with preview. Notice that it is loaded after tikz:




The last problem is because the minimal class does not work with geometry. Simply using the article class made that work too. (See also Why should the minimal class be avoided?)

  • In preview, \PreviewBorder=<length>\relax is the replacement for the border=<length> of standalone document class. Commented Jul 18, 2012 at 9:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .