What is the difference between the matrix and array environments?

2 Answers 2

  1. array is a default environment of LaTeX available to any document class, whilst matrix come with amsmath package or AMS classes (amsbook, amsart)

  2. The matrix environment mainly exist for naming consistency, because amsmath also provides several environments for matrices with delimiters (e.g. pmatrix, bmatrix, Bmatrix, vmatrix, and Vmatrix).

  3. In matrix there are not column specifications as {ccc}. By default, you can have up to ten centered columns (for another alignment you must stay with array). If you need more than ten columns you must modify the MaxMatrixCols counter.

  4. matrix is more economical with horizontal spacing (i.e., array is wider than matrix).


I'll add that mathtools defines a series of starred xmatrix* environments (x=p,b,B,v,V), and the parallel xsmallmatrix* environments, which accept a unique optional argument, [l], [c] or [r] for the set of columns, for the case where a different alignment is preferred, as in this example, borrowed from the mathtools documentation:

\[ \begin{pmatrix*}[r]
      -1 & 3 \\
       2 & -4
\end{pmatrix*} \]

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .