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

Is there a way to crop everything outside the bounding box?

I made some periodic pattern in TikZ but I wanna crop it outside some box. Just making a bounding box helps for the alignment but the pattern still repeats outside the box.

share|improve this question
up vote 12 down vote accepted

Simply use the \clip macro or \path [clip] and draw your bounding box, e.g. using \clip (lower left coordinate) rectangle (upper right coordinate). You can access the bounding box of everything drawn so far using the current bounding box shape: \clip (current bounding box.south west) rectangle (current bounding box.north east);. You need to do so before you apply the pattern, I think. If you already use \useasboundingbox or the equivalent \path [use as bounding box] then you can simply add the clip option to it.

If you only want to clip some drawing commands place them with the \clip into a scope environment. 

share|improve this answer
Thanks exactly what I needed. – Marcel Apr 12 '11 at 23:44

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.