# Simple flowchart

> Start, one step, one decision, and stop, with default styling to build on. A Flowcharts example with its complete LaTeX source, ready to copy or open in TeXeR.

A Flowcharts example in the TeXeR TikZ library: https://texer.org/library/flowcharts/simple-flowchart

Package: [Flowcharts](https://texer.org/library/flowcharts.md), on CTAN at https://ctan.org/pkg/pgf.

Tags: flowchart, process, decision

## Source

```latex
\usetikzlibrary{shapes.geometric, arrows.meta, positioning}

\begin{tikzpicture}[
  node distance=8mm,
  box/.style={draw, rounded corners, minimum width=24mm, minimum height=8mm},
  choice/.style={draw, diamond, aspect=2, inner sep=1pt},
  every edge/.style={draw, -{Stealth}},
]
  \node[box] (start) {Start};
  \node[box, below=of start] (step) {Do the work};
  \node[choice, below=of step] (check) {Done?};
  \node[box, below=of check] (stop) {Stop};

  \path (start) edge (step)
  (step) edge (check)
  (check) edge node[right] {yes} (stop);
  \draw[-{Stealth}] (check.east) -- ++(8mm,0) |- node[pos=0.25, right] {no} (step.east);
\end{tikzpicture}
```

## As a complete document

The same example in a document that compiles on its own with pdfLaTeX:

```latex
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}
\usetikzlibrary{shapes.geometric, arrows.meta, positioning}

\begin{document}

\begin{tikzpicture}[
  node distance=8mm,
  box/.style={draw, rounded corners, minimum width=24mm, minimum height=8mm},
  choice/.style={draw, diamond, aspect=2, inner sep=1pt},
  every edge/.style={draw, -{Stealth}},
]
  \node[box] (start) {Start};
  \node[box, below=of start] (step) {Do the work};
  \node[choice, below=of step] (check) {Done?};
  \node[box, below=of check] (stop) {Stop};

  \path (start) edge (step)
  (step) edge (check)
  (check) edge node[right] {yes} (stop);
  \draw[-{Stealth}] (check.east) -- ++(8mm,0) |- node[pos=0.25, right] {no} (step.east);
\end{tikzpicture}
\end{document}
```
