Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Creates a 2D-graphic of a coffee machine, which was realized as a deterministic finite state machine.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{automata,positioning,arrows}
\tikzset{node distance=4.5cm,
every state/.style={
semithick,
fill=gray!10},
initial text={},
double distance=4pt,
every edge/.style={
draw,
->,>=stealth',
auto,
semithick}}
\begin{document}
\begin{tikzpicture}[shorten >=1pt,node distance=6cm,on grid,auto]
\node[state, initial, accepting] (q1) {$\textrm{Bereitschaft}$};
\node[state, right of=q1] (q2) {$\textrm{Menüanzeige}$};
\node[state, right of=q2] (q3) {$\textrm{Geldeingabe}$};
\node[state, right of=q3] (q4) {$\textrm{Zahlung abschließen?}$};
\node[state, above of=q4] (q5) {$\textrm{Geldrückgabe}$};
\node[state, right of=q4] (q6) {$\textrm{Zubereitung}$};
\draw (q1) edge node{$\textrm{Start}$} (q2)
(q2) edge[bend left, below] node[anchor=south]{$\textrm{Abbruch}$} (q1)
(q2) edge node{$\textrm{Gewünschter Kaffee}$} (q3)
(q3) edge[bend left, below] node[anchor=south]{$\textrm{Zurück}$} (q2)
(q3) edge[bend left, below] node[anchor=south]{$\textrm{Abbruch}$} (q1)
(q3) edge node{$\textrm{Geld}$} (q4)
(q4) edge node{$\textrm{Abbruch}$} (q5)
(q4) edge node{$\textrm{Weiter}$} (q6)
(q5) edge[bend right, below] node[anchor=east]{$\textrm{Geldentnahme}$} (q1)
(q6) edge[bend left=60, below] node{$\textrm{Entnahme}$} (q1);
\end{tikzpicture}
\end{document}
@stefankuehnel

This comment has been minimized.

Copy link
Owner Author

@stefankuehnel stefankuehnel commented May 12, 2020

Usage

1. Download and install MiKTex:
Download here: https://miktex.org/download

2. Set system environment variables correctly:
To use the latex command in your command line, it is necessary to define the system environment variables correctly. To do this, copy the path to your MiKTex installation and paste it into the system environment variables configuration:

Note: The path may vary depending on your installation.

C:\Program Files\MiKTeX 2.9\miktex\bin\x64\

2. Check compiler version:
Run latex in your command prompt and check for the following output.

Note: The version number may be different depending on the version you're using.

> pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 2.9.7300 64-bit)

3. Run the following commands in the dfa.tex source directory:

$ latex dfa.tex
$ dvisvgm dfa.dvi

References:

License:

Copyright (c) 2020 Stefan Kühnel, licensed under the Academic Free License version 3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment