How do we add a matrix to a LaTeX document?
|
migrated from stackoverflow.com Sep 15 '11 at 22:00
|
Ash's answer typesets the matrix inline with the text. A (perhaps) nicer way to do this is to use the smallmatrix environment in the amsmath package. Add to the document preamble:
And then you can do:
If you want to bracket the matrix you can also do:
The
This info is found in "The LaTeX Companion", and the |
|||||||||
|
|
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 To quote the document,
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. |
|||
|
|
For a matrix of the form:
use the LaTeX code:
|
|||||
|
|
For flexible typesetting of matrices with color, lines and justification done by formatting parameters see An extension to amsmath matrix environments. |
||||
|
|
|
|||
|
|

