我需要制作一个自动机,看起来像这样:
我只能做以下几点:
\usepackage{tikz}
\usetikzlibrary{arrows, automata,
quotes,
positioning
}
\begin{tikzpicture}[>=latex, >=stealth', auto, node distance=0.5cm and 1.5cm, semithick, initial text=]
\node[state, initial] (q0) {$q_{0}$};
\node[state, accepting] (q1) [right = of q0] {$q_{1}$};
\path[->, shorten >=1pt]
(q0) edge node {$a^n$} (q1)
;
\end{tikzpicture}
我如何获得波浪边缘?
答案1
感谢@Qrrbrbirlbel,解决方案如下:
\begin{tikzpicture}[>=latex, >=stealth', auto, node distance=0.5cm and 1.5cm, semithick, initial text=]
\node[state, initial] (q0) {$q_{0}$};
\node[state, accepting] (q1) [right = of q0] {$q_{1}$};
\path[->, shorten >=1pt]
(q0) edge [decorate, decoration={snake,amplitude=.6mm,segment length=3mm,post length=2mm}] node {$a^n$} (q1)
;
\end{tikzpicture}