documentclass{article}
usepackage{pgf}
usepackage{tikz}
usetikzlibrary{arrows,automata}
usepackage[latin1]{inputenc}
egin{document}
egin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2.8cm,
semithick]
ikzstyle{every state}=[fill=red,draw=none,text=white]
ode[initial,state] (A) {$q_a$};
ode[state] (B) [above right of=A] {$q_b$};
ode[state] (D) [below right of=A] {$q_d$};
ode[state] (C) [below right of=B] {$q_c$};
ode[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);
end{tikzpicture}
end{document}
填充
ode[state] (S4) [fill=red ,right of= S2] {$S_4$};
字符紧贴着线
(S3) edge node[sloped,below] {V=1 XOR H=1} (S5)
标注在线中间 上面 紧贴着线
[sloped,midway,above]
- tikz node 中的文字换行
选项中加align=center,并用换行,例如:
ode at (-0.5,1)[draw, align=center]{example \ example example};