You can simply nest tikzpicture
s inside math environments. Basically, the only thing you have to consider is to add an appropriate baseline
to get vertical centering right. Here is the code, explanation will come afterwards.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\tikzstyle{hackennode}=[draw,circle,fill=white,inner sep=0,minimum size=4pt]
\tikzstyle{hackenline}=[line width=3pt]
{\Large
\[
\begin{tikzpicture}[baseline=-0.65ex,scale=0.5]
\draw[densely dashed] (-1,-1) -- (1,-1);
\node[hackennode] (middle) at ( 0, 0) {};
\node[hackennode] (left) at (-0.5,-1) {};
\node[hackennode] (right) at ( 0.5,-1) {};
\node[hackennode] (top) at ( 0, 1) {};
\draw[hackenline,blue]
(left) -- (middle) -- (right);
\draw[hackenline,red]
(middle) -- (top);
\end{tikzpicture}
=
\left\{
\begin{tikzpicture}[baseline=-0.65ex,scale=0.5]
\draw[densely dashed] (-0.5,-1) -- (1,-1);
\node[hackennode] (middle) at ( 0, 0) {};
\node[hackennode] (right) at ( 0.5,-1) {};
\node[hackennode] (top) at ( 0, 1) {};
\draw[hackenline,blue]
(middle) -- (right);
\draw[hackenline,red]
(middle) -- (top);
\end{tikzpicture}
\tikz[baseline=-0.65ex,scale=0.5] \node[inner sep=0] at (0,-1) {,\,};
\begin{tikzpicture}[baseline=-0.65ex,scale=0.5]
\draw[densely dashed] (-1,-1) -- (0.5,-1);
\node[hackennode] (middle) at ( 0, 0) {};
\node[hackennode] (left) at (-0.5,-1) {};
\node[hackennode] (top) at ( 0, 1) {};
\draw[hackenline,blue]
(middle) -- (left);
\draw[hackenline,red]
(middle) -- (top);
\end{tikzpicture}
\middle|
\begin{tikzpicture}[baseline=-0.65ex,scale=0.5]
\draw[densely dashed] (-1,-1) -- (1,-1);
\node[hackennode] (middle) at ( 0, 0) {};
\node[hackennode] (left) at (-0.5,-1) {};
\node[hackennode] (right) at ( 0.5,-1) {};
\draw[hackenline,blue]
(left) -- (middle) -- (right);
\end{tikzpicture}
\right\}
\]
}% End group with \Large
\end{document}

- The
baseline
option determines which height in the picture corresponds to the baseline in the surrounding text. We want the point (0,0)
to be at the height of the equality sign, which is about 0.65ex
above the baseline (in Computer Modern).
- The scale property (which doesn't affect line width and node size) is useful to get pictures in exactly the size you want them, without having to fiddle with the coordinates.
- The comma is set using TikZ to easily achieve the correct vertical position.
- I added
\Large
to get a larger equal sign and comma.
- Dashed lines are achieved with the option (surprise!)
dashed
. Now guess what densely dashed
means.
- In order to have the vertices overpaint the dashed line, I added a
fill=white
option to hackennode
.
- Martin's suggestion to wrap the
tikzpicture
s in \mathord
is a good one. You should do that to get better spacing.
Note, that in your picture the math symbols were actually produced with the graphics program and not with the text typesetting program (compare the braces and equal sign). This is of course possible to do with TikZ, but I don't see a good reason to do so.
hackennode
andhackenline
from my answer to your last question