Matrix Editor
A matrix is a useful way to represent and
manipulate linear transformations They are also
used to represent systems of linear equations
and many other mathematical structures
MathLive can display and edit matrices in a variety of ways
Creating a Matrix
There are several methods to create a matrix in a mathfield
Using Keyboard Shortcuts
To create a matrix using the keyboard
Type a parenthesis square bracket or curly brace
Type the first element of the matrix
Type the ALT/OPTION TAB key to move to the next column this will
automatically transform the expression into a matrix
Type the ALT/OPTION RETURN key to move to the next row
Using the Context Menu
The MathLive context menu provides a convenient way to create a matrix
To access the context menu right click or CTRL click on the mathfield The
menu is also available by typing ALT SPACE or by tapping on the menu button in
the mathfield
To insert a matrix using the context menu select the Insert Matrix menu item
then select the number of rows and columsn of the matrix
Matrix Borders
The borders of a matrix are parentheses by default They can be changed to
square brackets curly braces vertical bars or none
To change the border of a matrix right click or CTRL click on the matrix then
select the desired border from the Matrix Border menu item
In LaTeX matrices are represented using the \begin{}""...\end{} syntax The
argument to the begin command determines the type of matrix and is called the
environment
Inside the environment the matrix is specified using the & character to separate
columns and the \\ character to separate rows
The following environments are supported
Environment Description
matrix A matrix with no delimiters
pmatrix A matrix surrounded by parentheses
bmatrix A matrix surrounded by square brackets
Bmatrix A matrix surrounded by curly braces
vmatrix A matrix surrounded by vertical bars
Vmatrix A matrix surrounded by double vertical bars
smallmatrix A matrix with no delimiters in a smaller font
array A matrix with no delimiters with control over column alignment
\begin{matrix} \end{matrix}
a & b \\ a b
c & d c d
\begin{pmatrix} \end{pmatrix}
a & b \\
( )
a b
c & d c d
\begin{bmatrix} \end{bmatrix}
a & b \\
[ ]
a b
c & d c d
\begin{Bmatrix} \end{Bmatrix}
a & b \\
{ }
a b
c & d c d
\begin{vmatrix} \end{vmatrix}
a & b \\ ∣a b ∣
∣ ∣
c & d ∣ c d∣
∣ ∣
\begin{Vmatrix} \end{Vmatrix}
a & b \\ ∥a b ∥
∥ ∥
c & d ∥ c d∥
∥ ∥
\begin{smallmatrix} \end{smallmatrix}
a & b \\ a b
c & d c d
\begin{array}{cc} \end{array}
a & b \\ a b
c & d c d
Changing the Shape of a Matrix
To add or remove rows or columns right click or CTRL click on the matrix then
select the desired action from the menu Rows and columns get added or
removed relative to the cell the cursor is in
Spacing
Changing the spacing of an individual row
The spacing between rows can be adjusted by setting an optional argument to the
\\ command The argument is a length and can be positive or negative
For example the following matrix has no space between columns and a double
space between rows
⎛a b⎞
\begin{pmatrix}
a & b \\[1.5em]
⎝c d⎠
c & d
\end{pmatrix}
Units can be specified using the following abbreviations
em the width of the letter M in the current font
mu math unit / em
ex the height of the letter x in the current font
pt a point / inch
pc a pica points
px a pixel / inch
cm a centimeter
mm a millimeter
in an inch
bp a big point / inch
dd a didot point / mm
cc a cicero didot points
sp a scaled point sp pt
Changing the spacing of all rows
The spacing between rows can be controlled by setting the arraystretch register
The default value is 1.0
The value of a register can also be modified by using the \renewcommand
command In general modifying registers using [Link] is preferred but
using \renewcommand might be handy for example when rendering static LaTeX
[Link] = 2.5
⎝ ⎠
\renewcommand{\arraystretch}{2.5}
\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}
⎛ ⎞
⎜a b ⎟
⎜ ⎟
⎜ ⎟
⎜ ⎟
⎝ c d⎠
\renewcommand{\arraystretch}{0.5} c & d
\begin{pmatrix} \end{pmatrix}
a & b \\ (ac db )
Updated November
Problem? Feedback? File a report at githubcom/cortexjs/cortexjsio