Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
1  
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

2 Answers 2

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

 
discard

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.