Possible Duplicate:
Unknown error using tikz matrix of nodes in beamer
I'm trying to write a beamer document with tikz math diagrams. This code how gives me a " Single ampersand used with wrong catcode." error.
\documentclass{beamer}
\usepackage{tikz}\usetikzlibrary{arrows,matrix,shapes,snakes}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\matrix (m) [matrix of math nodes]
{X & Y \\ A & B \\};
\end{tikzpicture}
\end{frame}
\end{document}
Any clues why?
(by the way, the reason I'm writing this document is for personal notes to prepare a talk. I'm only interested in the fact that text is big and the formatting is designed for a schematic text. As I don't really care about the individual slides (i.e. the frame commands), do you have any tips for good alternatives?)
\begin{frame}[fragile]– Alain Matthes Jul 01 '12 at 16:31ampersand replacement=\&in matrix and use\&instead of&– Ignasi Jul 01 '12 at 16:34fragilebut in this special case with tikz and a matrix,ampersand replacement=\&is the common method. I think you need to memorize the two methods. – Alain Matthes Jul 01 '12 at 17:26