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

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);
share|improve this question
up vote 8 down vote accepted

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);
share|improve this answer
I've added a simple example. I hope you don't mind. – percusse Jun 29 '12 at 22:54
@percusse: Sure, thanks! :) – Count Zero Jun 29 '12 at 22:56
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. – ashkan Jun 30 '12 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.
share|improve this answer

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.