Skip to content

Instantly share code, notes, and snippets.

@ponte-vecchio
Created July 3, 2022 03:17
Show Gist options
  • Select an option

  • Save ponte-vecchio/09f14cbb19e6d61ec946495eebd4a1a1 to your computer and use it in GitHub Desktop.

Select an option

Save ponte-vecchio/09f14cbb19e6d61ec946495eebd4a1a1 to your computer and use it in GitHub Desktop.
Basic Boxes using TikZ arrows and rectangles.
\documentclass{article}
\usepackage{tikz, xcolor}
\definecolor{green}{RGB}{123, 202, 136}
\usetikzlibrary{shapes, arrows, positioning, calc}
\tikzstyle{foo} = [rectangle, minimum height=1em, text centered, draw=black, fill=green]
\tikzstyle{arrow} = [->, >=stealth]
\begin{document}
\begin{tikzpicture}
\node (c) [foo] {ABC};
\node (c top) [foo, above of = c, yshift = 2.5em] {ABC};
\node (c bot) [foo, below of = c, yshift = -2.5em] {ABC};
\node (r) [foo, right of = c, xshift = 3em] {ABC};
\node (r top) [foo, right of = c top, xshift = 3em] {ABC};
\node (r bot) [foo, right of = c bot, xshift = 3em] {ABC};
\node (l) [foo, left of = c, xshift = -3em] {ABC};
\node (l top) [foo, left of = c top, xshift = -3em] {ABC};
\node (l bot) [foo, left of = c bot, xshift = -3em] {ABC};
\draw [arrow] (c top) -- (r top);
\draw [arrow] (c top) -- (l top);
\draw [arrow] (c top) -- (c);
\draw [arrow] (c top) -- (l);
\draw [arrow] (c) -- (c bot);
\draw [arrow] (l) -- (c);
\draw [arrow] (c) -- (r);
\draw [arrow] (l bot) -- (c bot);
\draw [arrow] (r bot) -- (c bot);
\draw [arrow] (r top) -- (r);
\draw [arrow] (r) -- (r bot);
\draw [arrow] (l) -- (c bot);
\draw [arrow] (r) -- (c bot);
\draw [<->, dashed, >=stealth] (l top) -- (c);
\draw [<->, dashed, >=stealth] (l top) -- (l);
\draw [arrow, thick] (l) -- (l bot);
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment