Skip to content

Instantly share code, notes, and snippets.

@brianckeegan
Created March 28, 2019 17:04
Show Gist options
  • Save brianckeegan/abb6ffc1f22b58bacc2ffd5f2a975c7f to your computer and use it in GitHub Desktop.
Save brianckeegan/abb6ffc1f22b58bacc2ffd5f2a975c7f to your computer and use it in GitHub Desktop.
Making a table in LaTeX using TikZ of a triad census for directed graphs
\begin{figure*}[!tb]
\centering
\footnotesize
\begin{tabular}{cccc}
% First row of triad census
\begin{tikzpicture}
[user/.style={circle,draw=black,fill=black!60,thick,text=white,inner sep=0pt,minimum size=.5cm},
->,-stealth,line width = 2, black,
font=\boldmath]
\node [user] (a) at (0,1.2) {};
\node [user] (b) at (.8,0) {};
\node [user] (c) at (-.8,0) {};
\path;
\end{tikzpicture} &
\begin{tikzpicture}
[user/.style={circle,draw=black,fill=black!60,thick,text=white,inner sep=0pt,minimum size=.5cm},
->,-stealth,line width = 2, black,
font=\boldmath]
\node [user] (a) at (0,1.2) {};
\node [user] (b) at (.8,0) {};
\node [user] (c) at (-.8,0) {};
\path
(c) edge (a);
\end{tikzpicture} &
\begin{tikzpicture}
[user/.style={circle,draw=black,fill=black!60,thick,text=white,inner sep=0pt,minimum size=.5cm},
->,-stealth,line width = 2, black,
font=\boldmath]
\node [user] (a) at (0,1.2) {};
\node [user] (b) at (.8,0) {};
\node [user] (c) at (-.8,0) {};
\path
(c) edge (a)
(a) edge (c);
\end{tikzpicture} &
\begin{tikzpicture}
[user/.style={circle,draw=black,fill=black!60,thick,text=white,inner sep=0pt,minimum size=.5cm},
->,-stealth,line width = 2, black,
font=\boldmath]
\node [user] (a) at (0,1.2) {};
\node [user] (b) at (.8,0) {};
\node [user] (c) at (-.8,0) {};
\path
(a) edge (b)
(a) edge (c);
\end{tikzpicture} \\
003 & 012 & 102 & 021D \\ \\
% Second row
\begin{tikzpicture}
[user/.style={circle,draw=black,fill=black!60,thick,text=white,inner sep=0pt,minimum size=.5cm},
->,-stealth,line width = 2, black,
font=\boldmath]
\node [user] (a) at (0,1.2) {};
\node [user] (b) at (.8,0) {};
\node [user] (c) at (-.8,0) {};
\path
(c) edge (a)
(b) edge (a);
\end{tikzpicture} &
\begin{tikzpicture}
[user/.style={circle,draw=black,fill=black!60,thick,text=white,inner sep=0pt,minimum size=.5cm},
->,-stealth,line width = 2, black,
font=\boldmath]
\node [user] (a) at (0,1.2) {};
\node [user] (b) at (.8,0) {};
\node [user] (c) at (-.8,0) {};
\path
(c) edge (a)
(a) edge (b);
\end{tikzpicture} &
\begin{tikzpicture}
[user/.style={circle,draw=black,fill=black!60,thick,text=white,inner sep=0pt,minimum size=.5cm},
->,-stealth,line width = 2, black,
font=\boldmath]
\node [user] (a) at (0,1.2) {};
\node [user] (b) at (.8,0) {};
\node [user] (c) at (-.8,0) {};
\path
(a) edge (b)
(b) edge (c)
(c) edge (b);
\end{tikzpicture} &
\begin{tikzpicture}
[user/.style={circle,draw=black,fill=black!60,thick,text=white,inner sep=0pt,minimum size=.5cm},
->,-stealth,line width = 2, black,
font=\boldmath]
\node [user] (a) at (0,1.2) {};
\node [user] (b) at (.8,0) {};
\node [user] (c) at (-.8,0) {};
\path
(b) edge (a)
(b) edge (c)
(c) edge (b);
\end{tikzpicture} \\
021U & 021C & 111D & 111U \\ \\
% Third row
\begin{tikzpicture}
[user/.style={circle,draw=black,fill=black!60,thick,text=white,inner sep=0pt,minimum size=.5cm},
->,-stealth,line width = 2, black,
font=\boldmath]
\node [user] (a) at (0,1.2) {};
\node [user] (b) at (.8,0) {};
\node [user] (c) at (-.8,0) {};
\path
(c) edge (a)
(b) edge (a)
(c) edge (b);
\end{tikzpicture} &
\begin{tikzpicture}
[user/.style={circle,draw=black,fill=black!60,thick,text=white,inner sep=0pt,minimum size=.5cm},
->,-stealth,line width = 2, black,
font=\boldmath]
\node [user] (a) at (0,1.2) {};
\node [user] (b) at (.8,0) {};
\node [user] (c) at (-.8,0) {};
\path
(a) edge (c)
(c) edge (b)
(b) edge (a);
\end{tikzpicture} &
\begin{tikzpicture}
[user/.style={circle,draw=black,fill=black!60,thick,text=white,inner sep=0pt,minimum size=.5cm},
->,-stealth,line width = 2, black,
font=\boldmath]
\node [user] (a) at (0,1.2) {};
\node [user] (b) at (.8,0) {};
\node [user] (c) at (-.8,0) {};
\path
(a) edge (c)
(c) edge (a)
(b) edge (c)
(c) edge (b)
\end{tikzpicture} &
\begin{tikzpicture}
[user/.style={circle,draw=black,fill=black!60,thick,text=white,inner sep=0pt,minimum size=.5cm},
->,-stealth,line width = 2, black,
font=\boldmath]
\node [user] (a) at (0,1.2) {};
\node [user] (b) at (.8,0) {};
\node [user] (c) at (-.8,0) {};
\path
(a) edge (b)
(a) edge (c)
(b) edge (c)
(c) edge (b);
\end{tikzpicture} \\
030T & 030C & 201 & 120D \\ \\
% Fourth row
\begin{tikzpicture}
[user/.style={circle,draw=black,fill=black!60,thick,text=white,inner sep=0pt,minimum size=.5cm},
->,-stealth,line width = 2, black,
font=\boldmath]
\node [user] (a) at (0,1.2) {};
\node [user] (b) at (.8,0) {};
\node [user] (c) at (-.8,0) {};
\path
(b) edge (a)
(c) edge (a)
(b) edge (c)
(c) edge (b);
\end{tikzpicture} &
\begin{tikzpicture}
[user/.style={circle,draw=black,fill=black!60,thick,text=white,inner sep=0pt,minimum size=.5cm},
->,-stealth,line width = 2, black,
font=\boldmath]
\node [user] (a) at (0,1.2) {};
\node [user] (b) at (.8,0) {};
\node [user] (c) at (-.8,0) {};
\path
(a) edge (b)
(c) edge (a)
(b) edge (c)
(c) edge (b);
\end{tikzpicture} &
\begin{tikzpicture}
[user/.style={circle,draw=black,fill=black!60,thick,text=white,inner sep=0pt,minimum size=.5cm},
->,-stealth,line width = 2, black,
font=\boldmath]
\node [user] (a) at (0,1.2) {};
\node [user] (b) at (.8,0) {};
\node [user] (c) at (-.8,0) {};
\path
(a) edge (b)
(b) edge (a)
(c) edge (a)
(b) edge (c)
(c) edge (b);
\end{tikzpicture} &
\begin{tikzpicture}
[user/.style={circle,draw=black,fill=black!60,thick,text=white,inner sep=0pt,minimum size=.5cm},
->,-stealth,line width = 2, black,
font=\boldmath]
\node [user] (a) at (0,1.2) {};
\node [user] (b) at (.8,0) {};
\node [user] (c) at (-.8,0) {};
\path
(a) edge (b)
(b) edge (a)
(a) edge (c)
(c) edge (a)
(b) edge (c)
(c) edge (b);
\end{tikzpicture} \\
120U & 120C & 210 & 300
\end{tabular}
\caption{Configurations of a triad census.}
\label{fig:triad_census}
\end{figure*}
@stepazar
Copy link

stepazar commented Jun 2, 2021

Thanks for the script. To work out properly there should be an additional semicolon in the end of line 143.

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