Possible Duplicate:
Unknown error using tikz matrix of nodes in beamer
I have the following tikzpicture environment from my TeX document but I cannot make it work in Beamer. I get the error:
! Package pgf Error: No shape named m-1-3 is known.
! Package pgf Error: No shape named m-1-4 is known.
Here is the code
\begin{frame}[fragile]
\frametitle{Data set-up}
\begin{tikzpicture}[description/.style={fill=white,inner sep=2pt}]
\matrix (m) [matrix of math nodes, row sep=3em,
column sep=2.5em, text height=1.5ex, text depth=0.25ex]
{\&\&Z_{1}\&Z_{2}\&\& \\
R \& \& \& \& \& Y \\ };
\path[->,font=\scriptsize]
(m-1-3) edge node[description]{$ \alpha_{1} $} (m-2-1)
(m-1-4) edge node[description] {$ \alpha_{2} $}(m-2-1)
(m-1-3) edge node[description]{$ \beta_{1} $} (m-2-6)
(m-1-4) edge node[description] {$ \beta_{2} $}(m-2-6);
\path[->,loosely dashed, font=\scriptsize]
(m-2-1) edge node[auto, swap] {$(MAR)$}(m-2-6);
\end{tikzpicture}
\end{frame}

ampersand replacement=\&andfragileare the two methods. – Alain Matthes Jul 04 '12 at 11:00