I am having trouble getting a basic example of a matrix of notes to show up in my beamer presentation. I am using the code copied from the pgf manual. Here is a complete working example. The error I get upon compilation is:
"Package pgfbasematrix Error: Single ampersand used with wrong catcode."
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,fit,petri,positioning,matrix}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\matrix (magic) [matrix of nodes]
{
8 & 1 & 6 \\
3 & 5 & 7 \\
4 & 9 & 2 \\
};
\draw[thick,red,->] (magic-1-1) |- (magic-2-3);
\end{tikzpicture}
\end{frame}
\end{document}
Best Answer
Beamer messes around with catcodes a lot. From the TkiZ manual:
For your example this means: