TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 5 down vote accepted

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 not use the minimal class)

share|improve this answer
In preview, \PreviewBorder=<length>\relax is the replacement for the border=<length> of standalone document class. – kiss my armpit Jul 18 '12 at 9:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.