tikz fit around everything

  • Follow


Hi all,
I'm trying to make some changes to the TIKZ example
http://www.texample.net/tikz/examples/state-machine/

Namely, I'd like a circle to surround everything, so I add this:
\begin{pgfonlayer}{background}
    \node[surround] (background) [fit = (A) (B)(C)(D)(E)] {};
\end{pgfonlayer}

But eventually the number of states will not be A-E, and I'm wondering
if there's a way to do this without explicitly listing all objects I
want to surround
0
Reply rpanderson (1) 5/26/2010 7:03:33 PM

� (at) Wed, 26 May 2010 12:03:33 -0700 (PDT),
jamesproctor <rpanderson@gmail.com> �crivait (wrote):

> I'm trying to make some changes to the TIKZ example
> http://www.texample.net/tikz/examples/state-machine/
>
> Namely, I'd like a circle to surround everything, so I add this:
> \begin{pgfonlayer}{background}
>     \node[surround] (background) [fit = (A) (B)(C)(D)(E)] {};
> \end{pgfonlayer}
>
> But eventually the number of states will not be A-E, and I'm wondering
> if there's a way to do this without explicitly listing all objects I
> want to surround

If you want surround *all* objects (states, labels, links, etc.), you
may use special node 'current bounding box':

\begin{pgfonlayer}{background}
    \node[surround] (background)
     [fit = (current bounding box)] {};
\end{pgfonlayer}


-- 
Paul Gaborit - <http://perso.mines-albi.fr/~gaborit/>
0
Reply Paul 5/27/2010 7:30:21 AM


1 Replies
419 Views

(page loaded in 0.06 seconds)

Similiar Articles:

7/30/2012 10:29:18 AM


Reply: