From what I can see, \matrix
was a TeX command, but I cannot seem to find documentation on it.
It works in MathJax, so I wonder if it can be used in LaTeX.
ie this is valid MathJax:
$$
\left[
\matrix
{
newx.x&newy.x&newz.x \\
newx.y&newy.y&newz.y \\
newx.z&newy.z&newz.z
}
\right]
$$
As can be seen on math.stackexchange.
In my LaTeX editor (which uses MiKTeX underneath), I have to use \begin{matrix} .. \end{matrix}
, so I'm wondering what happened to the \matrix
command.
Best Answer
In addition to some already provided, here are a number of ways of creating matrices in LaTeX. Using
array
structure to place items in a rigid row/column environment;\begin{matrix}...\end{matrix}
from theamsmath
package, which allows you to specify the matrix delimiters yourself (using\left
and\right
);pmatrix
,bmatrix
,Bmatrix
,vmatrix
andVmatrix
variations to the above (also fromamsmath
) to fix the delimiters to( )
,[ ]
,{ }
,| |
, and|| ||
, respectively;\bordermatrix{...}
which is a TeX command and will specify row and column indicies;\kbordermatrix{...}
which is similar to the above, but provides more flexibility;blkarray
package and the associatedblockarray
andblock
environments to construct your matrix.Here is an example file showing some of the different styles: