[texhax] Matrix aligment

Morten Høgholm morten.hoegholm at gmail.com
Thu Mar 29 13:05:34 CEST 2007

On 3/29/07, Philip G. Ratcliffe <philip.ratcliffe at uninsubria.it> wrote:

> 3. Hack amsmath's matrix, my preferred solution ;-), thus
> \renewcommand\env at matrix[1][c]{\hskip -\arraycolsep
>  \let\@ifnextchar\new at ifnextchar
>  \array{*\c at MaxMatrixCols #1}}
> This should either be loaded as part of a style file or placed between a
> \makeatletter \makeatother pair in your preamble.  It defines an optional
> argument to all the amsmath matrix environments, thus allowing
> \begin{..matrix}[r] ... \end{..matrix}
> The default is "c", following the original definition, and you can obviously
> put l, c, or r.
> Cheers,  Phil
> P.S.  When I have time I may suggest this modification to the amsmath
> authors.

The mathtools package defines matrix environments "...matrix*" doing
just that. I doubt it'll be changed in amsmath as it may break
existing documents.

More information about the texhax mailing list