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 have drawn a lattice in latex with tikz, successfully compiled it to a pdf and been able to include it in my document. However, the whole PDF (i.e. A4 page) is included and I only want to include the lattice I have drawn.

Is it possible to automatically only include that lattice and not all the "blank space" around it? (I know "crop" is an option, but if I want to change the lattice so that it changes size, it will be a bother to update the crop coordinates all the time.)

share|improve this question
In your original TikZ drawing, use standalone document class and it will crop the picture automatically. You can search this site for lots of examples. – percusse Sep 14 '12 at 12:29
Thanks! That is an answer to my question. Please post it (for points) and so that this thread can get an accepted answer. – The Unfun Cat Sep 14 '12 at 12:44
up vote 5 down vote accepted

In your original TikZ drawing, use standalone document class or preview and the picture will be cropped automatically.

Then you can include the resulting pdf to your main file.

share|improve this answer

If you don't want to use the solution by percusse, you can use pdfcrop. It's a perl script that removes all white borders of a pdf. Works with multiple pages too.

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.