I have been looking for this answer EVERYWHERE. Nobody ever talked about \usepackage{amsmath}. As a complete latex n00b, I hadn't knnown about it before, either. Thank you thank you thank you
– inspectorG4dgetFeb 12 '11 at 9:16

7

Just to add some info, with mathtools package you have the environments bsmallmatrix, psmallmatrix, …
– ManuelFeb 7 '13 at 13:18

First: if you intend to do math in LaTeX, you SHOULD learn and use AMS LaTeX. The best reference is the Short Math Guide for LaTeX. In this guide, you will learn that there are many different matrix macros available when you use the amsmath package (e.g., \usepackage{amsmath} ).

To quote the document,

4.4. Matrices The environments pmatrix, bmatrix, Bmatrix, vmatrix and Vmatrix have (respectively) ( ), [ ], { }, | |, and || || delimiters built in. There is also a matrix environment sans delimiters, and an array environment that can be used to obtain left alignment or other variations in the column specs. [ed. To produce a matrix with parenthesis around it, use:]

To produce a small matrix suitable for use in text, there is a smallmatrix environment
[ed. here was a matrix appropriate for text mode] that comes closer to fitting within a single text line than a normal matrix.
This example was produced by

\bigl( \begin{smallmatrix}
a & b\\
c & d
\end{smallmatrix} \bigr)

To produce a row of dots in a matrix spanning a given number of columns, use \hdotsfor.
For example, \hdotsfor{3} in the second column of a four-column matrix will print a row
of dots across the final three columns.

Note. The plain TeX form \matrix{...\cr...\cr} and the related commands \pmatrix, \cases should be
avoided in LaTeX (and when the amsmath package is loaded they are disabled).

Finally, I'd like to mention that, while it is possible to set matrices without AMS LaTeX, just use it. It offers so many benefits that until you get the hang of LaTeX, it's the best single macro package for math.

I agree with Ashwin's simple approach. Sometimes you can't rely on amsmath being available, so if you're after straightforward matrices, then use straightforward Latex commands. See more at andy-roberts.net/misc/latex/latextutorial9.html for how to wrap your 'array' in brackets.
– arooarooMay 5 '09 at 19:28