Bug in mathmatrix and possible fix
Dear devs, It is currently not possible to have nested mathmatrices. The reason is that \popmacro\math_matrix_NC is done at an inner scope and a succeeding \endgroup will happily overwrite this again. A possible fix is to move \popmacro\math_matrix_NC to the very outer scope in \math_matrix_stop, see below. I don't know and have not tested whether this breaks something else. Cheers, Henri --- \unprotect \def\math_matrix_stop {\crcr % \ifgridsnapping \else \mathstrut\crcr \noalign{\vskip-\baselineskip}% % \fi \egroup %\popmacro\math_matrix_NC % Too early! \egroup \mathmatrixright \endgroup \popmacro\math_matrix_NC} % ungrouped! \protect \definemathmatrix[pmatrix][left={\left(}, right={\right)}, distance=2em] \def\matOne{\startmatrix\NC 1 \NC 0 \NR\NC 0 \NC 1\NR\stopmatrix} \def\matTwo{\startmatrix\NC a\NR\NC b\NR\stopmatrix} \def\matThree{\startmatrix\NC c \NC d\NR\stopmatrix} \starttext \startformula \startpmatrix \NC \matOne \NC \matTwo\NR \NC \matThree \NC e\NR \stoppmatrix \stopformula \startformula \startpmatrix \NC 1 \NC 0 \NC a \NR \NC 0 \NC 1 \NC b \NR \NC c \NC d \NC e\NR \stoppmatrix \stopformula \stoptext
participants (1)
-
Henri