[tex-eplain] multiple alignment within a math display

Stepan Kasal kasal at ucw.cz
Sat Jan 14 17:49:33 CET 2006


Hello,

On Fri, Jan 13, 2006 at 12:46:49PM +0100, Helmut Jarausch wrote:
> I wonder how all of you handle the problem
> of multiple alignments within a math display.

in a journal format based on plain, we use variants of the
AMSTeX macros \align, \alignat, and such.  If you want to align
equations in two columns, you write:

\alignat2
x&=1 & a&=5 \cr
y&=2 & b&=3 \cr
\endalignat

(\alignat n  uses 2*n columns)

The macros are taken from amstex.tex or its predecessor vanilla.sty.

Here is an example:
\def\align#1\endalign{\def\tag{&}\vspace@\allowdisplaybreak@\displaybreak@
  \iftagsleft@\lalign@#1\endalign\else
   \ralign@#1\endalign\fi}
\def\ralign@#1\endalign{\displ at y\Let@\tabskip\centering\halign to\displaywidth
     {\hfil$\displaystyle##{}$\tabskip=\z@&$\displaystyle{}##$\hfil
       \tabskip=\centering&\llap{\hbox{\rm(##\unskip)}}\tabskip\z@\crcr
             #1\crcr}}
\def\lalign@#1\endalign{\displ at y\Let@\tabskip\centering\halign to\displaywidth
   {\hfil$\displaystyle##{}$\tabskip=\z@&$\displaystyle{}##$\hfil
   \tabskip=\centering&\kern-\displaywidth
        \rlap{\hbox{\rm(##\unskip)}}\tabskip=\displaywidth\crcr
               #1\crcr}}

But current versions, including the definition of \alignat we use is much
longer.  I'm afraid you have to study amstex.tex.  You have to expand their
shortcats, like \RIfMIfI@, bot that's nothing impossible.

Have a nice day,
	Stepan Kasal



More information about the tex-eplain mailing list