Skip to content

Instantly share code, notes, and snippets.

@lukasschwab
Created February 19, 2021 00:45
Show Gist options
  • Select an option

  • Save lukasschwab/6a3e2cdd78075e8923a9057f7609a898 to your computer and use it in GitHub Desktop.

Select an option

Save lukasschwab/6a3e2cdd78075e8923a9057f7609a898 to your computer and use it in GitHub Desktop.
Example input file for tikz2svg
\documentclass{standalone}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{automata, positioning, arrows}
\tikzstyle{defaults}=[
->,
>=stealth',
every state/.style={thick, fill=gray!10},
initial text=$ $,
]
\begin{document}
\nopagecolor
% https://www3.nd.edu/~kogge/courses/cse30151-fa17/Public/other/tikz_tutorial.pdf
\begin{tikzpicture}
[node distance=3cm]
\node[state, initial] (q1) {$q_1$};
\node[state, accepting, right of=q1] (q2) {$q_2$};
\node[state, right of=q2] (q3) {$q_3$};
\draw (q1) edge[loop above] node{0} (q1)
(q1) edge[above] node{1} (q2)
(q2) edge[loop above] node{1} (q2)
(q2) edge[bend left, above] node{0} (q3)
(q3) edge[bend left, below] node{0, 1} (q2);
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment