I'm interested in drawing a logo with Tikz to embed either as a PDF or as a code snippet in other Tex documents. In order to do this, I'd like to draw the logo in a small PDF file, size 1 inch by 1 inch. I try the following code and curiously, it seems that geometry has additional parameters influencing the shape of the PDF. What must I "set to zero" so that drawing a 1inch diameter circle intersects all edges of the PDF as viewed?

\usepackage[paperwidth=1in, paperheight=1in, margin=0in]{geometry}

    \draw (0.5, 0.5) circle (1);

2 Answers 2


Rather use


Then you don't even need the geometry package. It automatically sets the size of the 'canvas' to the size of the bounding box.

Edit by percusse: Still, for the fun of it, you can get rid of the \hoffset and also you should make sure that the line width is also taken into account. Lastly, you need to use in instead of the default cm for the units.

\usepackage[paperwidth=1in, paperheight=1in, margin=0in]{geometry}
\noindent\tikz\draw (0.5in+0.5pt,0.5in) circle (0.5in-0.25pt);
  • 1
    I've added a simple example. I hope you don't mind.
    – percusse
    Commented Jun 29, 2012 at 22:54
  • Thank you. Wasn't aware of the "standalone" doc class which was clearly what I should've been using. Interesting example with the use of hoffset and noindent additionally.
    – AdamO
    Commented Jun 30, 2012 at 19:16

You can also get a tight vector image by using preview package as follow.

enter image description here


\PreviewBorder=12pt% you can set it to 0pt if you don't need a border.

\psset{unit=1in}% one unit equals to 1 inch.

You must log in to answer this question.

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