summaryrefslogtreecommitdiff
path: root/graphics/dot2tex/examples/tikzautomata.dot
blob: 1e0937ff450826c1ca212ac3a8aa2191bca26c8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*

:Title: Automata
:Tags: TikZ, topath, tikzedgelabels

An example of how to use TikZ' automata libray and to paths to
create a pretty state machine. 

Generated with::

	$ neato -Txdot tikzautomata.dot | dot2tex.py -ftikz > tikzautomata.tex

*/
digraph G {
    d2ttikzedgelabels = true;
    d2tstyleonly = true;
    d2tdocpreamble = "\usetikzlibrary{automata}";
    d2tfigpreamble = "\tikzstyle{every state}= \
    [draw=blue!50,very thick,fill=blue!20]";
    node [style="state"];
    edge [lblstyle="auto",topath="bend left"];
    A [style="state, initial"];
    A -> B [label=2];
    A -> D [label=7];
    B -> A [label=1];
    B -> B [label=3,topath="loop above"];
    B -> C [label=4];
    C -> F [label=5];
    F -> B [label=8];
    F -> D [label=7];
    D -> E [label=2];
    E -> A [label="1,6"];
    F [style="state,accepting"];
}