I'm trying to reproduce the state machine example with some minor changes. In particular, I'd like to draw a background circle encapsulating all elements of the picture. Here is a start:
Code: Select all
\usepackage{tikz}
\usetikzlibrary{arrows,automata,backgrounds,fit,decorations.pathreplacing}
%....
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2.8cm,
semithick]
\tikzstyle{every state}=[fill=white,draw=black,text=black]
\tikzstyle{matrix}=[circle,thick,draw=gray!80,fill=gray!20]
\tikzstyle{surround} = [circle,fill=blue!10,thick,draw=black,rounded corners=2mm]
\node[state] (A) {$q_a$};
\node[state] (B) [above right of=A] {$q_b$};
\node[state] (D) [below right of=A] {$q_d$};
\node[state] (C) [below right of=B] {$q_c$};
\node[state] (E) [below of=D] {$q_e$};
\path (A) edge node {0,1,L} (B)
edge node {1,1,R} (C)
(B) edge [loop above] node {1,1,L} (B)
edge node {0,1,L} (C)
(C) edge node {0,1,L} (D)
edge [bend left] node {1,0,R} (E)
(D) edge [loop below] node {1,1,R} (D)
edge node {0,1,R} (A)
(E) edge [bend left] node {1,0,R} (A);
\begin{pgfonlayer}{background}
\node[surround] (background) [fit = (A) (B)(C)(D)(E)] {};
\end{pgfonlayer}
%
\end{tikzpicture}
Suggestions?