LaTeX Matrix Macro


If you use LaTeX you know how hard it is to type matrices and similar structures since it requires setting up an environment. This is especially a problem for me since I keep notes in Mori using my LaTeX plugin. With the use of the below command, though, my life is much easier:

\newcommand{\mat}[2][rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr]{\left(\begin{array}{#1}#2 \\ \end{array} \right)}

This works for up to 50 rows, if I typed as many "r"s as I think I did. If you're using Mori Math, you'll probably want to add this line to your LaTeX template so the column spacing will look right:

\setlength{\arraycolsep}{2mm}

Posted: Friday - August 25, 2006 at 11:58 AM