{matrices} is about matrices in {equations} and {diagrams}.
matrices is about matrices in equations and diagrams.
Using AMS-LaTeX (package amsmath
, the AMS document classes, etc.), there are several commands to create matrices in math mode. For example,
I_2 = \begin{bmatrix}
1 & 0 \\
0 & 1
\end{bmatrix}
typesets:
There are many other commands available to typeset matrices:
- The
bmatrix
environment, shown above, typesets a matrix in braces.matrix
typesets a matrix with no delimiters;pmatrix
uses parentheses,Bmatrix
uses braces,vmatrix
uses vertical lines, andVmatrix
uses double vertical lines. - The
matrix*
environment allows one to specify the alignment of the matrix elements: for example,\begin{matrix*}[r]
...\end{matrix*}
right-aligns all of the columns. There's alsopmatrix*
,bmatrix*
, etc. - The
smallmatrix
environment typesets a matrix in line, and is small enough to look good in text-style math. In addition, themathtools
package providespsmallmatrix
,bsmallmatrix
, etc., which also add delimiters on each side. - The bordermatrix command allows one to annotate the rows or columns of a matrix (also see the
kbordermatrix
package). - TikZ has a
matrix
library which allows extensive customization. If your question is about this library, use the tikz-matrix tag.