# QuickLaTeX: Hackenbush diagram

Today I stumbled across Tikz Diagrams in Math Mode topic on tex.SE. Here is how QuickLaTeX solves the task (example is taken from one of the answers in the thread): Since we want to display several TikZ drawings on one image, we need to use $...$ tags to mark raw region with LaTeX commands:

$[+preamble] \usepackage{tikz} \usetikzlibrary{calc} \tikzstyle{hackennode}=[draw,circle,fill=white,inner sep=0,minimum size=4pt] \tikzstyle{hackenline}=[line width=3pt] [/preamble] {\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\}$$     (4 votes, average: 4.75) Loading...