I'm trying to diagram an extensive form game using TikZ trees. The following code generates errors at compile time. Specifically, it complains about missing $'s and a bad math delimiter. I've been over the brackets with a fine-tooth comb and I can't find where the error is being generated.
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{trees}
\begin{document}
\begin{tikzpicture}[%
%%% Styles
player/.style={draw,circle},
level 2/.style={sibling distance=10mm}
%every node/.style={node distance=1cm}
]
%%% Nodes
\node [player] (root) {1}
child { node [player] (2a) {2}
child { node (aa) {
\[ \begin{array}{c}
1 \\ 2
\end{array} \]}
edge from parent
node [left] {A}
}
child { node (ab) {
\[ \begin{array}{c}
3 \\ 4
\end{array} \]}
edge from parent
node [right] {B}
}
edge from parent
node [left] {A}
}
child { node [player] (2b) {2}
child { node (ba) {
\[ \begin{array}{c}
5 \\ 6
\end{array} \]}
edge from parent
node [left] {A}
}
child { node (bb) {
\[ \begin{array}{c}
7 \\ 8
\end{array} \]}
edge from parent
node [right] {B}
}
edge from parent
node [right] {B}
};
\end{tikzpicture}
\end{document}
The relevant error log output looks like
! Missing $ inserted.
<inserted text>
$
l.48 };
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
! Missing $ inserted.
<inserted text>
$
l.48 };
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! LaTeX Error: Bad math environment delimiter.
Can anyone explain what is causing these errors? It usually wouldn't be a problem, but I use rubber to compile from org-mode, and these errors are tripping it up. (These errors also trip up texi2dvi, for those interested.)
s/\[|\]/$/gseems to fix things withrubber. Does anyone know whyarrayswouldn't play nice indisplaymathenvironments? – jrhorn424 Mar 03 '11 at 17:09arrayworks fine also indisplaymathenvironments, but the latter not in nodes. How should they be centered and what would be the spacing before and after if they stand alone in a node? Aparboxorminipagewould fix it. – Stefan Kottwitz Mar 03 '11 at 20:23