Possible Duplicate:
Unknown error using tikz matrix of nodes in beamer
I would put the following figure in a beamer slide

I tried with [ampersand replacement=\&] but it does not work
\documentclass[11pt]{article}
%\documentclass{beamer}
\pagestyle{empty}
\usepackage{tikz}
\usetikzlibrary{positioning,calc,matrix}
\begin{document}
\centering
%\begin{frame}
\begin{figure}[H]\centering
\begin{tikzpicture}
\matrix[matrix of math nodes] (m1)
{|[font=\scriptsize,red]| rang &|[font=\scriptsize,red]| 5 &|[font=\scriptsize,red]| 4 &|[font=\scriptsize,red]| 3 &|[font=\scriptsize,red]| 2 &|[font=\scriptsize,red]| 1 &|[font=\scriptsize,red]| 0 & & & & &\\
& Bu & Ga& Zo &Meu& Ga& Bu & & & & & &\\
& & & & & & & 4^0 & \to &Bu\cdot 4^0 &=1\cdot 4^0 &= &1 \\
& & & & & & & 4^1 & \to &Ga\cdot 4^1 &=0\cdot 4^1 &= &0\\
& & & & & & & 4^2 & \to &Meu\cdot 4^2 &=3\cdot 4^2 &= &48\\
& & & & & & & 4^3 & \to &Zo\cdot 4^3 &=2\cdot 4^3 &= &128\\
& & & & & & & 4^4 & \to &Ga\cdot 4^4 &=0\cdot 4^4 &= &0\\
& & & & & & & 4^5 & \to &Bu\cdot 4^5 &=1\cdot 4^5 &= &1024\\
& & & & & & & & & & &+ &1201\\
};
\draw[-latex] (m1-2-7) |- (m1-3-8);
\draw[-latex] (m1-2-6) |- (m1-4-8);
\draw[-latex] (m1-2-5) |- (m1-5-8);
\draw[-latex] (m1-2-4) |- (m1-6-8);
\draw[-latex] (m1-2-3) |- (m1-7-8);
\draw[-latex] (m1-2-2) |- (m1-8-8);
\end{tikzpicture}
\caption{Transcodade base 4 (Shadok) $\to$ base 10}
\label{fig:base4tobase10}
\end{figure}
%\end{frame}
\end{document}
fragileto theframeenvironment. Related: this one and this one. – Claudio Fiandrino Aug 29 '12 at 13:59[ampersand replacement=\&]you have to change all your&to\&then it works. – percusse Aug 29 '12 at 14:11