I use this manual for help with the drawing of game trees using TikZ (http://www.sfu.ca/~haiyunc/notes/Game_Trees_with_TikZ.pdf).
However, I have a challenge I cannot seem to overcome. Some of my end-nodes require line breaks in the labels. In the concrete example below, in the end node on the left in the second branch (after "Not Resist"), I would like the equation after the two vertical lines (||) to be placed below the first equation. In other words split the line between the X and the U_S.
I have tried by specifying "align=centre
" and using \\
but it did not work. Similarly, I tried specifying an equation environment within the label, but it did not work either.
Any help would be most appreciated.
An MWE:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\begin{document}
\tikzset{
solid node/.style={circle,draw,inner sep=1.5,fill=black},
hollow node/.style={circle,draw,inner sep=1.5}
}
\begin{tikzpicture}[scale=1.5,font=\footnotesize]
\tikzstyle{level 1}=[level distance=15mm, sibling distance=20mm]
\tikzstyle{level 2}=[level distance=15mm, sibling distance=20mm]
\node(0)[solid node,label=above:{\textbf{Sender}}]{}
child{node(1)[hollow node, label=below:{$U_S(SQ)$}]{}
edge from parent node[left,xshift=-3,yshift=5]{\textit{Not Threaten}}
}
child{node(2)[solid node, label=above right:{\textbf{Target}}]{}
child{node[hollow node, label=below:{$U_S(TS)=X$ \\ $||U_T(TS)=Y$}]{} edge from parent node[left,xshift=-3,yshift=0]{\textit{Not Resist}}}
child{node[hollow node, label=below:{$TF$}]{} edge from parent node[right,xshift=3,yshift=0]{\textit{Resist}}}
edge from parent node[right,xshift=3,yshift=5]{\textit{Threaten}}
};
\end{tikzpicture}
\end{document}