I want to draw a matrix inside foreach but the compiling is aborted due to some errors. This is my code:
\documentclass{scrartcl}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\foreach \x in {0,1}{
\node[xshift=\x em,yshift=\x em]{\x};
\matrix[xshift=\x em,yshift=\x em]{
\node{A};&\node{B};\\
\node{C};&\node{D};\\
};
}
\end{tikzpicture}
\end{document}
What's wrong with this code? The node inside the foreach is no problem but the matrix is.
