Mathematics/Matrices

Unofficial ConTeXt Wiki mirror

Last modified: 2025-01-12

Defining with \definemathmatrix

In order to type matrices in math formulas, there is the command \definemathmatrix. Once a certain type of matrix is defined, one can also add a simple command in order to type matrices in a Matlab or Scilab format.

Here are a few examples.

Formatting delimiters with left and right

It is possible to have different delimiters on the left and on the right. For instance:

Block matrices with vertical and/or horizontal lines

In ConTeXt LMTX beginning version 2020-11-27, it is possible to create « block » matrices where the blocks are separated by vertical or horizontal lines (respectively \VL and \HL). For instance the above example can be typeset more easily by the following :

Formatting lines

The two commands \VL and \HL take an optional parameter which defines the thickness of the rule and its color. So \HL[3,red] will produce a red horizontal rule three times thicker than the default matrix rule. The rule thickness for a specific matrix is defined with the [rulethickness=] parameter of \definemathmatrix.

Other formatting example

Border matrices with \startbordermatrix

Use \startbordermatrix for a bracketed version: