diff options
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex')
-rw-r--r-- | Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex index a0e73700ff7..452ee9a6aa7 100644 --- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex +++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-automata.tex @@ -18,7 +18,7 @@ \subsection{Drawing Automata} -The automata drawing library is intended to make it easy to draw finite +The |automata| (drawing) library is intended to make it easy to draw finite automata and Turing machines. It does not cover every situation imaginable, but most finite automata and Turing machines found in text books can be drawn in a nice and convenient fashion using this library. @@ -43,7 +43,7 @@ Let us now see how this works for a real example. Let us consider a nondeterministic four state automaton that checks whether an input contains the sequence $0^*1$ or the sequence $1^*0$. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{automata,positioning}}] \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto] \draw[help lines] (0,0) grid (3,2); @@ -82,7 +82,7 @@ By default, the following state styles are defined: output, use the command |\nodepart{lower}| inside the node. This style also calls |every state|. % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{automata}}] \begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); @@ -97,7 +97,8 @@ By default, the following state styles are defined: \begin{stylekey}{/tikz/state (initially state without output)} You should redefine it to something else, if you wish to use states of a different nature. -\begin{codeexample}[] + % +\begin{codeexample}[preamble={\usetikzlibrary{automata}}] \begin{tikzpicture}[state/.style=state with output] \node[state] {$q_0$ \nodepart{lower} $11$}; \node[state] at (2,0) {$q_1$ \nodepart{lower} $00$}; @@ -111,8 +112,8 @@ By default, the following state styles are defined: |state without output|. By default, it does nothing, but you can use it to make your state look more fancy: % -\begin{codeexample}[] -\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,>=stealth', +\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,automata,positioning}}] +\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,>={Stealth[round]}, every state/.style={draw=blue!50,very thick,fill=blue!20}] \node[state,initial] (q_0) {$q_0$}; @@ -166,7 +167,7 @@ Let us start with the initial states. whatever. \end{stylekey} % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{automata}}] \begin{tikzpicture}[every initial by arrow/.style={text=red,->>}] \node[state,initial,initial distance=2cm] {$q_0$}; \end{tikzpicture} @@ -236,9 +237,9 @@ now two options: First, |accepting by arrow|, which works the same way as text. \end{stylekey} % -\begin{codeexample}[] +\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,automata,positioning}}] \begin{tikzpicture} - [shorten >=1pt,node distance=2cm,on grid,>=stealth',initial text=, + [shorten >=1pt,node distance=2cm,on grid,>={Stealth[round]},initial text=, every state/.style={draw=blue!50,very thick,fill=blue!20}, accepting/.style=accepting by arrow] @@ -282,8 +283,8 @@ previous sections. This time, we use the following rule for accepting/initial state: Initial states are red, accepting states are green, and normal states are orange. Then, we must find a path from a red state to a green state. % -\begin{codeexample}[] -\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,>=stealth',thick, +\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,automata,positioning,shadows}}] +\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,>={Stealth[round]},thick, every state/.style={fill,draw=none,orange,text=white,circular drop shadow}, accepting/.style ={green!50!black,text=white}, initial/.style ={red,text=white}] @@ -304,8 +305,8 @@ are orange. Then, we must find a path from a red state to a green state. The next example is the current candidate for the five-state busiest beaver: % -\begin{codeexample}[] -\begin{tikzpicture}[->,>=stealth',shorten >=1pt,% +\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta,automata,positioning}}] +\begin{tikzpicture}[->,>={Stealth[round]},shorten >=1pt,% auto,node distance=2cm,on grid,semithick, inner sep=2pt,bend angle=45] \node[initial,state] (A) {$q_a$}; |