planilhas e matriz tikz

planilhas e matriz tikz

Qual é o problema com este arquivo?

\documentclass{article}
\usepackage{exsheets}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}

\begin{question}
\begin{tikzpicture}
\matrix (magic) [matrix of nodes]
  {
    8 & 1 & 6 \\
    3 & 5 & 7 \\
    4 & 9 & 2 \\
  };
\end{tikzpicture}
\end{question}

\end{document}

O compilador diz

./mini.tex:16: Undefined control sequence.
<argument> \pgf@matrix@last@nextcell@options 

Responder1

exsheetslê o corpo do questionambiente como argumento, portanto você não pode usar &, mas pode usar ampersand replacement=\&.

\documentclass{article}
\pagestyle{empty}% for cropping
\usepackage{exsheets}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{question}
\begin{tikzpicture}
\matrix (magic) [ampersand replacement=\&,matrix of nodes]
  {
    8 \& 1 \& 6 \\
    3 \& 5 \& 7 \\
    4 \& 9 \& 2 \\
  };
\end{tikzpicture}
\end{question}
\end{document}

insira a descrição da imagem aqui

informação relacionada