Buenas tardes, estoy haciendo una división usando el paquete tikz e interpretándola como una matriz. El problema es que necesito poner corchetes en algunos elementos de la matriz y no me deja salvo que haya delante del primer corchete algún carácter. El código es el siguiente:
\begin{center}
\begin{tikzpicture}
\matrix (a) [matrix of math nodes, column sep = 0 pt]
{
& x^5 & + & [2]x^4 & + & x^3 & + & x^2 & & & + & [2] & & x + 1 \\
& [2]x^5 & + & [2]x^4 & & & & & & & & & & x^4 + x^3 + x + [2] \\
& 0 & + & x^4 & + & x^3 & + & x^2 & & & + & [2] & & \\
& & & [2]x^4 & + & [2]x^3 & & & & & & & & \\
& & & & & 0 & + & x^2 & & & + & [2] & & \\
& & & & & & & [2]x^2 & + & [2]x & & & & \\
& & & & & & & 0 & + & [2]x & + & [2] & & \\
& & & & & & & & & x & + & 1 & & \\
& & & & & & & & & & & 0 & & \\
};
\draw (a-1-14.north west) |- (a-1-14.south east);
\draw (a-2-2.south west) -- (a-2-4.south east);
\draw (a-4-4.south west) -- (a-4-6.south east);
\draw (a-6-8.south west) -- (a-6-10.south east);
\draw (a-8-10.south west) -- (a-8-12.south east);
\end{tikzpicture}
\end{center}