🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #11022

Row vector times a matrix alignment, followup

#11022
From: Robert Mclean
Date: Thu, 07 Jan 1993 17:50
57 lines
1912 bytes
In article <1ifgo0INN20p@tamsun.tamu.edu> mclean@math.tamu.edu (Robert Mclean) writes:
>Howdy, (requisite Aggie salutation.) I have a question which I probably
>shouldn't be worrying about. TeX is good at making us worry about little
>texnicalities.
>
>I would like to have a row vector times a matrix to look like this:
>
>(x,y,z) (a1,a2,a3)
>        (a4,a5,a6)
>        (a7,a8,a9)
>
>rather than how TeX usually spits it out as:
>
>        (a1,a2,a3)
>(x,y,z) (a4,a5,a6)
>        (a7,a8,a9)
>
>Any, suggestions how to get it to align them at the top?
>
>T.I.A.
>
>robert mclean
>

I received two suggestions on how to do this: (1) Use LaTeX or AMS-LaTeX
where this is an option for the array environment. (I use AMS-TeX.)
(2) Look at the plain.tex file's \matrix command and change a \vcenter
to \vtop. Here's the modified code:

\catcode`@=11
\def\tmatrix#1{\null\,\vtop{\normalbaselines\m@th
    \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr
      \mathstrut\crcr\noalign{\kern-\baselineskip}
      #1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}\,}
\def\tpmatrix#1{\left(\tmatrix{#1}\right)}
\catcode`@=12
$$
\pmatrix{x & y & z}
\tpmatrix{a_1 & a_2 & a_3 \cr
          a_4  & a_5 & a_6 \cr
          a_7  & a_8 & a_9 \cr
}
$$
\bye

Unfortunately, this produces:

        (        )
        (        )
        (        )
(x,y,z) (a1,a2,a3)
        (a4,a5,a6)
        (a7,a8,a9)

Aack! Any suggestions.

robert mclean
Technical Details
Message-ID: <1ihqh2INNqd1@tamsun.tamu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!rpi!usc!cs.utexas.edu!tamsun.tamu.edu!mclean
References: <1ifgo0INN20p@tamsun.tamu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!rpi!usc!cs.utexas.edu!tamsun.tamu.edu!mclean
From: mclean@math.tamu.edu (Robert Mclean)
Newsgroups: comp.text.tex
Subject: Row vector times a matrix alignment, followup
Date: 7 Jan 1993 17:50:26 GMT
Organization: Dept of Mathematics, Texas A&M University
Lines: 57
Message-ID: <1ihqh2INNqd1@tamsun.tamu.edu>
References: <1ifgo0INN20p@tamsun.tamu.edu>
NNTP-Posting-Host: math.tamu.edu