Created
February 28, 2020 11:25
-
-
Save marcofavorito/941a380924456e8613baabcc5478ec99 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[12pt]{article} | |
\usepackage[english]{babel} | |
\usepackage[utf8x]{inputenc} | |
\usepackage{amsmath} | |
\usepackage{tikz} | |
\usetikzlibrary{arrows,automata} | |
\begin{document} | |
\begin{tikzpicture} | |
\tikzset{vertex/.style = {shape=circle,draw,minimum size=1.5em}} | |
\tikzset{edge/.style = {->,> = latex'}} | |
% vertices | |
\node[vertex] (1) at (0,0) {$q_0$}; | |
\node[vertex] (2) at (2,0) {$q_1$}; | |
\node[vertex] (3) at (0,-2) {$q_2$}; | |
\node[vertex] (4) at (2,-2) {$q_3$}; | |
%edges | |
\draw[edge] (1.10) -- (2.170) node[midway, above] {$1$}; | |
\draw[edge] (2.190) -- (1.350) node[midway, below] {$1$}; | |
\draw[edge] (2.280) -- (4.80) node[midway, right] {$0$}; | |
\draw[edge] (4.100) -- (2.260) node[midway, left] {$0$}; | |
\draw[edge] (3.10) -- (4.170) node[midway, above] {$1$}; | |
\draw[edge] (4.190) -- (3.350) node[midway, below] {$1$}; | |
\draw[edge] (1.280) -- (3.80) node[midway, right] {$0$}; | |
\draw[edge] (3.100) -- (1.260) node[midway, left] {$0$}; | |
\end{tikzpicture} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use it in combination with the
standalone
document class! https://tex.stackexchange.com/a/51766/170682