For
those following this discussion note that there is a version of
display_matrix() that should be used within math mode; it is called
display_matrix_mm(). Here's the documentation from within
PGmatrixmacros.pl
Arnie
display_matrix produces a matrix for display purposes. It checks whether it is producing LaTeX output, or if it is displaying on a web page in one of the various modes. The input can either be of type Matrix, or a reference to an array.
Entries can be numbers, Fraction objects, bits of math mode, or answer boxes. An entire row can be replaced by the string 'hline' to produce a horizontal line in the matrix.
display_matrix_mm functions similarly, except that it should be inside math mode. display_matrix_mm cannot contain answer boxes in its entries. Entries to display_matrix_mm should assume that they are already in math mode.
Both functions take an optional alignment string, similar to ones in LaTeX tabulars and arrays. Here c for centered columns, l for left flushed columns, and r for right flushed columns.
The alignment string can also specify vertical rules to be placed in the matrix. Here s or | denote a solid line, d is a dashed line, and v requests the default vertical line. This can be set on a system-wide or course-wide basis via the variable $defaultDisplayMatrixStyle, and it can default to solid, dashed, or no vertical line (n for none).
The matrix has left and right delimiters also specified by $defaultDisplayMatrixStyle. They can be parentheses, square brackets, braces, vertical bars, or none. The default can be overridden in an individual problem with optional arguments such as left=>"|", or right=>"]".
You can specify an optional argument of 'top_labels'=> ['a', 'b', 'c']. These are placed above the columns of the matrix (as is typical for linear programming tableau, for example). The entries will be typeset in math mode.
Top labels require a bit of care. For image modes, they look better with display_matrix_mm where it is all one big image, but they work with display_matrix. With tth, you pretty much have to use display_matrix since tth can't handle the TeX tricks used to get the column headers up there if it gets the whole matrix at once.
<| Post or View Comments |> |