Skip to content

Instantly share code, notes, and snippets.

@MasWag
Created December 6, 2022 01:51
Show Gist options
  • Save MasWag/940c9a732a39a7be78ea006fb1988b60 to your computer and use it in GitHub Desktop.
Save MasWag/940c9a732a39a7be78ea006fb1988b60 to your computer and use it in GitHub Desktop.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{automata, positioning}
\begin{document}
\begin{tikzpicture}
\node[state,initial,accepting] (q0) {$q_0$};
\node[state] (q1) at (1,2) {$q_1$};
\node[state] (q2) [below right=of q0] {$q_2$};
\path[->]
(q0) edge node[above left] {hoge} (q1)
(q1) edge[loop right] node[right] {hoge} (q1)
(q1) edge[bend right=5] node[below left] {1 to 2} (q2)
(q2) edge[bend right=5] node[right] {2 to 1} (q1)
;
\path[->]
(q2) edge[bend left=60] node[below left] {hoge} (q0)
;
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment