Skip to content

Instantly share code, notes, and snippets.

@pianomanfrazier
Created September 27, 2017 01:16
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 pianomanfrazier/515a4c370791caf4428ccba615663eb5 to your computer and use it in GitHub Desktop.
Save pianomanfrazier/515a4c370791caf4428ccba615663eb5 to your computer and use it in GitHub Desktop.
Some Tikz and tikz-er2 doodles for Latex
\documentclass[12pt, letterpaper]{article}
\usepackage{fontspec}
\usepackage{tikz-er2}
\usetikzlibrary{positioning}
\begin{document}
\begin{figure}[h!]
\begin{center}
\begin{tikzpicture}[node distance=2cm]
\node[entity] (emp) {Employee};
\node[attribute] (ename) [above=0.2cm of emp] {Name} edge (emp);
\node[attribute] (enum) [left=1cm of emp] {\key{Number}} edge (emp);
\node[isa] (isa) [below of=emp] {\discriminator{ISA}} edge (emp);
\node[total] (tot) [below right=0.7cm and 1cm of emp] {TOTAL} edge (emp);
\node[entity] (car) [right=4cm of emp] {Car};
\draw[help lines, dashed,color=gray] (0.1,0.1) grid(3.9,3.9);
\draw [thick, dotted,color=blue] (0,2) to (2,4);
\draw[->,>=diamond,thick,color=red] (2,4) -- (4,2) |- (2,0);
\end{tikzpicture}
\caption{Example graphic made with tikz.}
\end{center}
\end{figure}
\begin{figure}[htpb]
\centering
\begin{tikzpicture}[scale=2.5]
\tikzstyle{every node}=[draw,shape=circle];
\path (0,0) node (v0) {$v_0$};
\path (1,1) node (v1) {$v_1$};
\path (2,0) node (v2) {$v_2$};
\draw (v0) -- (v1) -- (v2) -- (v0);
\end{tikzpicture}
\caption{Another tikz tree struction}
\label{fig:tikzTree}
\end{figure}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment