[texhax] matrices

Joe Corneli jcorneli at math.utexas.edu
Tue Sep 9 15:19:33 CEST 2003


I'm new to this list, and new to TeX hacking, though I've been using
LaTeX to typeset math for about 4 or 5 years.  One thing that I haven't
been able to get satisfied with is the way one has to enter matrices,

$\left ( \begin{array}{ccc} 
a & b & c \\ d & e & f \\ g & h & i
\end{array} \right )$

I would like to compress all of this into a macro like 
the following:

$\matrix{a & b & c \\ d & e & f \\ g & h & i}$

The trick is detecting the number of columns dynamically, since I'd like
the same macro to work in this setting too:

$\matrix{a & b \\ c & d \\ f & g}$

Is it possible to do something like this?  And can anyone suggest a way
to get started on it?  Maybe there is already something built-in that I
just don't know about, I'd love to hear about that too.


More information about the texhax mailing list