Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!betelgeuse!halvers From: halvers@betelgeuse.crd.ge.com (Pete Halverson) Newsgroups: comp.text.tex Subject: Re: Equations in LaTeX question Summary: use eqnarray or array Message-ID: <18436@crdgw1.crd.ge.com> Date: 11 Apr 91 12:31:59 GMT References: <31808@usc> Sender: news@crdgw1.crd.ge.com Reply-To: halverson@crd.ge.com (Pete Halverson) Organization: General Electric Corporate R&D Center Lines: 31 In article <31808@usc> ajayshah@alhena.usc.edu (Ajay Shah) writes: > >I'd like to typeset equations like: > > z = (x+y)^2 > = x^2 + 2xy + y^2 > >The \TeX book has a nice concept called \eqalign which lines up >equations so the = comes vertically aligned. It doesn't work in >LaTeX. > >Any ideas on how it's done? The simplest way is to use the eqnarray* environment, separating the LH, the equals sign, and the RH with "&" and separating lines with "\\": \begin{eqnarray*} z & = & (x+y)^2 \\ & = & x^2 + 2xy + y^2 \end{eqnarray*} If you need to do more interesting alignment, or embed these equations within higher-level math constructs, you should look at the documentation for the "array" environment, which is what eqnarray* is based on. -- =============================================================================== Pete Halverson INET: halverson@crd.ge.com GE Corporate R&D Center UUCP: uunet!crd.ge.com!halverson Schenectady, NY