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 am new to TikZ and I can't explain the following behavior when I compile this (with pdflatex or lualatex):




\tikz \shade[ 
            inner color=black, 
            outer color=yellow
        ]  circle (2.5cm);



enter image description here

The generated circle clearly overlaps with the "lipsum" paragraph above it. I have read (TikZ/PGF manual) that I can set a bounding box. Setting one solves the problem but this is not clean : if I add something to the picture, I have to manually resize the bounding box... Furthermore, this is not needed in other TikZ code. Can you explain this behavior? Do you have an idea to solve this problem automatically?

Thanks in advance!

share|improve this question
Remove the second \tikz and you are good to go. It starts a new tikzpicture inside another tikzpicture hence the bounding box calculation gets confused. –  percusse Jun 4 '12 at 17:02

1 Answer 1

up vote 7 down vote accepted

You currently have


which is causing the problem. If you just use

            inner color=black, 
            outer color=yellow
        ]  circle (2.5cm);

or else

\tikz \shade[ inner color=black, outer color=yellow]  circle (2.5cm);

then you'll see that it works as expected.

share|improve this answer
You have to finish your post with \fi :) –  percusse Jun 4 '12 at 17:04
So stupid of me. I should have read the manual more carefully instead of just jumping from place to place! Thanks percusse and cmhughes for your answers. –  Gael Jun 5 '12 at 7:56

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.