Skip to content

Instantly share code, notes, and snippets.

@PHPirates
Last active May 20, 2018 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PHPirates/d423f674e8cba0b31f46353025e3e563 to your computer and use it in GitHub Desktop.
Save PHPirates/d423f674e8cba0b31f46353025e3e563 to your computer and use it in GitHub Desktop.
Simple tikz block schemas
%%
%% Author: Thomas Schouten
%% 05-03-2018
%%
% Preamble
\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{positioning, arrows.meta, shapes.geometric}
% Default arrow length: (length right, length up)
\newcommand{\standardlength}{1,0}
% Default arrowhead.
\newcommand{\standardarrow}{-{Latex[length=2mm,width=2mm]}}
% Document
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\node[left] (one) { One };
\draw[\standardarrow] (one.east) -- ++(\standardlength)
node[right] (two) { Twoooooooooooooo };
\draw[\standardarrow] (two.east) -- ++(\standardlength)
node[right] (three) { Three };
\draw[\standardarrow] (three.east) -- ++(\standardlength)
node[right] (four) { Four };
\end{tikzpicture}
\caption{ cap }
\label{fig:one}
\end{figure}
\begin{figure}
\centering
\begin{tikzpicture}
\node[left] (one) { One };
\draw[\standardarrow] (one.east) -- ++(1.5,0) node[above, pos=0.5] { asdf }
node[right] (two) { Two };
\draw[\standardarrow] (two.east) -- ++(\standardlength)
node[right] (three) { Three };
\draw[\standardarrow] (three.east) -- ++(\standardlength)
node[right] (four) { Four };
\end{tikzpicture}
\caption{ cap }
\label{fig:two}
\end{figure}
\begin{figure}
\centering
\begin{tikzpicture}
\node (one) { UpOne };
\node[below of=one] (two) { DownOne };
\draw[\standardarrow] (two.east) -- ++(\standardlength)
node[right] (three) { Twoooo };
\draw[\standardarrow] (one) -- (three);
\draw[\standardarrow] (three.east) -- ++(\standardlength)
node[right] (four) { Threeeeeee };
\draw[\standardarrow] (four.east) to [bend left=30] ++(\standardlength)
node[right] (five) { Four };
\end{tikzpicture}
\caption{ More levels}
\end{figure}
\newcommand{\standardbend}{30}
\begin{figure}
\centering
\begin{tikzpicture}[every node/.style={draw, circle}]
\node (g) { G };
\draw[\standardarrow] (g) to [bend left=\standardbend] ++(\standardlength)
node[right] (m) { M };
\draw[\standardarrow] (m) to [bend left=\standardbend] (g);
\end{tikzpicture}
\caption{ Circles }
\end{figure}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment