Presumably the example worked at that time without generating error messages.
For an error-free run with a LaTeX program of a current TeX distribution, changes are needed.
If you only insert the variable with the index into a matrix cell, then a node name is created because of the
matrix of math nodes
option. The
\node
command, which is inserted into a cell in the example, does not assign a name.
If you then want to draw something using these node names, you would have to replace, for example,
by
or
Code: Select all
\node [node style sp]
(\tikzmatrixname-\the\pgfmatrixcurrentrow-\the\pgfmatrixcurrentcolumn) {a_{21}};
Of course, you could create a short command for the second variant, but why when the first variant already offers a short solution.
Yes, there is a third variant, but the reader would have to jump back and forth between the options and the content of the matrix to keep track of the context.
The option of the
\matrix
command in this case would be
Code: Select all
row 2 column 1/.style={nodes=node style sp}
while
a_{21}
is sufficient as cell content.