%-*-tex-*- \ifundefined{writestatus} \input status \relax \fi % \chcode{mateq} \def\cqu{\cquote{Having got our equations, we must proceed to carry out such operatins as we have neglected, taking care never to multiply when we can divide}{Rules for the Direction of the Mind, Rule XX, Ren\'e~Descartes (1596-1650)}} \chapterhead{mateq}{MATHEMATICS:\cr EQUATION\cr SETUP} \tex\ makes the typesetting of the most difficult expressions relatively easy. This chapter lists and shows examples of the special forms supplied by {\it plain}. For the finer points of mathematic equation setup, the reader is referred to the \texbook~[\cite{[Knut84]}]. For more advanced mathematics macro and accenting capabilities, the AMS\tex~[\cite{[Amst84]}] package is recommended. \intex\ supplies all that is in {\it plain} plus \beginlist \li $\bullet$ an autonumbering feature, using |\aneq|, |\aneqtag|, or |\autoeqnum| for equations, \li $\bullet$ a |\math| and |\displaymath| for those who don't like |$|, \li $\bullet$ a |\leftequationnumbering| and |\rightequationnumbering| that will magically shift all the equation numbers from the side specified by the form, \li $\bullet$ and a |\mathopen| command that will cause aligned equations to increase their spacing. \endlist The two basic commands |\math| and |\displaymath| can be used to invoke either scriptstyle or displaystyle mathematics in running text. For instance |\math{\sum_0^n}| gives \math{\sum_0^n} while |\displaymath{\sum_0^n}| gives \displaymath{\sum_0^n}. In addition there is a tagging mechanism that enables the symbolic referencing of equations, both forward and backward. \shead{eqcoms}{Command List} \begintwocolumn \hfuzz = 20pt %temporary \pla|\abovewithdelims| \pla|\atop| \pla|\atopwithdelims| \ext|\aneq \aneqtag| \ext|\autoeqnum| \pla|\bordermatrix| \pla|\cases| \pla|\cdot| \pla|\cdots| \pla|\choose| \pla|\ddots| \ext|\displaymath| \pla|\eqalign| \pla|\eqalignno| \pla|\eqno| \pla|\ldots| \ext|\leftequationnumbering| \pla|\leqno| \pla|\leqalignno| \ext|\math| \ext|\mathopen| \pla|\matrix| \pri|\noalign| \pla|\openup| \pla|\over| \pla|\overbrace| \pla|\overline| \pla|\overwithdelims| \pla|\phantom| \pla|\pmatrix| \ext|\rightequationnumbering| \pla|\smash| \ext|\sphantom| \pla|\sqrt| \pla|\underbrace| \pla|\underline| \pla|\vphantom| \endthreecolumn \shead{eqbasics}{Mathematic Equation Basics} To put some mathematics, either symbols or expressions, in running text you must surround them by a pair of single |$| like |$$|. An example is |$x^y$| gives $x^y$. Mathematics in running text will be broken at the end of line at spaces in the expression. To prevent a break but preserve a space insert the tie |~| into the expression. Thus |$x~=~y+1$|, giving $x~=~y+1$ will prevent a break around the $=$ sign. To obtain display equations use form \begintt $$ $$ \endtt There should be {\bf no} blank lines or |\par| within ||. Mysterious errors will result. To have a display expression end a sentence, the last character before the equation number should be a period. Superscripting and subscripting can occur only in mathematics mode. The |\@| is the superscript character and |_| is the subscript character. The braces |{}| are necessary to tell \tex\ what material goes where. The example below shows the result of different use of braces. $$ 2^xyz_uvw : 2^{xyz}_{uvw} : 2^{xyz_uvw} : 2^{xyz_{uvw}}. $$ is given by \begintt $$ 2^xyz_uvw : 2^{xyz}_{uvw} : 2^{xyz_uvw} : 2^{xyz_{uvw}}. $$ \endtt Finally, in commands that produce alignments, the |&| is used to separate items and the |\cr| to end a line. Examples of their use will be found in such commands as |\matrix| and |\eqalign|. Equation numbers are put in using either the automatic numbering commands |\aneq|, |\aneqtag|, |\autoeqnum|, or the normal manual numbering forms |\eqno| for right hand numbers or |\leqno| for lefthand numbers. \shead{mateqcomforms}{Command Forms} This is a list of commands that are given in {\it plain}, along with some examples and the form of the parameters for their use. \beginblockmode \mbr \pla\@|\above.. \atop.. \over.. functions { \atop } { \choose } { \over } { \atopwithdelims } { \overwithdelims } { \abovewithdelims }| \nbr These forms are all used for putting || on top of || as might happen in a fraction. The difference between them is that |\atop| puts no line or bar between the || while |\over| does, and |\choose| puts in no bar but does enclose the || in large parens as is normally done in a binomial coefficient. The forms |\...delims| allow for the specifcation of delimiters around the || that may be different than parens. Finally the || in the |\abovewithdelims| allows for the thickness of the line or bar between the || to be a specified ||. As an example $$ {37 \over 45} : {n \atop \alpha} : {10 \choose r} : {f(x) \overwithdelims\{\} g(y)} : {\alpha \atopwithdelims][ \beta} : {209 \abovewithdelims\langle\rangle 2pt h(y)} $$ is given by \begintt $$ {37 \over 45} : {n \atop \alpha} : {10 \choose r} : {f(x) \overwithdelims\{\} g(y)} : {\alpha \atopwithdelims][ \beta} : {209 \abovewithdelims\langle\rangle 2pt h(y)} $$ \endtt \mbr \ext|\aneq \aneqtag{}| \nbr \ext|\autoeqnum{}| \nbr When |autonumbering| is on these commands will automatically number equations. |\aneq| and |\aneqtag{}| inserts a bracketed equation number in the correct place in the equation depending on whether it is an |\eqalign|, |\eqalignno|, or |\leqalignno|. The |\autonumeq{}| inserts a number without brackets. The || allows for references to the equation. If |autonumbering| is off, the |\aneq| results in nothing and the two forms with || insert the || --- without the |< >| of course. For example, |autonumbering| is on, $$ x \equiv y \aneq $$ is given by \begintt $$ x \equiv y \aneq $$ \endtt and $$ \eqalignno{ f(x)&\approx K x^{-3/2} & (\autoeqnum{eqfx}.a) \cr &\approx 0 \qquad x \gg 0 & (\ref{eqfx}.b) \cr} $$ is given by \begintt $$ \eqalignno{ f(x)&\approx K x^{-3/2} & (\autoeqnum{eqfx}.a) \cr &\approx 0 \qquad x \gg 0 & (\ref{eqfx}.b) \cr} $$ \endtt The |eqfx| is the equation tag. However, the tag for |eqfx| does not make it to the margin! A better way to do this, and one that guarantees that the tag for |eqfx| makes it to the margin is as follows: \begintt {\silenttrue \autoeqnum{eqfx}} $$ \eqalignno{ f(x)&\approx K x^{-3/2} & (\ref{eqfx}.a) \cr &\approx 0 \qquad x \gg 0 & (\ref{eqfx}.b) \cr} $$ \endtt The \@|\silenttrue| turns on a switch in |\autoeqnum{<...>}| that prevents it from writing out its value. In this case, the |\autoeqnum{<...>}| is in vertical mode so that the tag for |eqfx| will now make it to the margin. The command |\ref{eqfx}| will produce the (equation) number corresponding to |eqfx|. This construction allows both lines of the equation to have the same main equation number. \mbr \pla\@|\bordermatrix{&&&...&\cr &\cr ... &\cr}| \nbr The |\bordermatrix| places parens around the || in the same way as |\pmatrix| and then places the || items above and the || items to the left hand side outside the parens. Thus $$ \bordermatrix{ R\backslash C& Col 1 & Col 2 & Col 3 \cr Row 1 & a & b & c \cr Row 2 &\sum_{\ell=1}^n & & \alpha \cr Row 3 & v=0 &\gamma & 1000.0\cr} $$ is given by \begintt $$ \bordermatrix{ R\backslash C& Col 1 & Col 2 & Col 3 \cr Row 1 & a & b & c \cr Row 2 &\sum_{\ell=1}^n & & \alpha \cr Row 3 & v=0 &\gamma & 1000.0\cr} $$ \endtt \mbr \pla\@|\cases{&\cr ... &\cr}| \nbr This allows for a very simple way of stacking a set of possibilities in an equation and putting a large brace on the left hand side. The |<...math>| is the mathematics, and is in display math mode, and the |<...condition>| is the condition and is in internal horizontal mode \dots\ not math mode. Thus $$ G(x) = \cases{\vert x\vert & for $x<0$ \cr x^2 & for $x\ge 0$ \cr} $$ is given by \begintt $$ G(x) = \cases{\vert x\vert & for $x<0$ \cr x^2 & for $x\ge 0$ \cr} $$ \endtt \mbr \pla\@|\eqalign ... \eqalign{ &\cr ... &\cr} \eqalignno{ &&\cr ... &&\cr} \leqalignno{&&\cr ... &&\cr}| \nbr All three of these commands allow for a list of equations, or expressions to be aligned on a {\bf single} point within the expression. This is usually a relation such as $=$ or $\gg$ although any point is possible. The |\eqalignno| and |\leqalignno| have an extra field at the end of each row for an equation number, which will be printed on the right for the former and on the left for the latter. Note that in both cases the actual || field appears on the right. Any of the || or || or |<... eq.no.>| may be omitted. A major difference between |\eqalign| and |\eqalignno| is that the latter always is as wide as the page while the former is its natural width. |\openup|, immediately after the opening |$$|, is used to increase the spacing between the lines of an |\eqalign| or its relatives by ||. A font relative || such as |ex| is recommended with |1ex| to start. To obtain a lefthand equation number with |\eqalign|, or ordinary display mathematics, use |\leqno|. \intex\ supplies automatic equation numbering and ways of having a document change from left to right hand equation numbering or vice versa. See |\lefhandequationnumbering| and |\righthandequationnumbering|. For automatic equation numbering use |\autoeqnum{tag}|, |\aneq| and |\aneqtag|. An example of an |\eqalign| is $$ \eqalign{F(x) &=\int_{-\infty}^x H(y)dy \cr &=x^{3/2} \cr G(z) &\ll 1 \cr} \eqno (12) $$ which is given by \begintt $$ \eqalign{F(x) &=\int_{-\infty}^x H(y)dy \cr &=x^{3/2} \cr G(z) &\ll 1 \cr} \eqno (12) $$ \endtt Notice the equation number is centered on the right hand side. An example for |\eqalignno| is $$ \openup 1ex \eqalignno{F(x) &=\int_{-\infty}^x H(y)dy \cr &=x^{3/2} &(2.i)\cr \noalign{and} G(z) &\ll 1 &(2.ii)\cr} $$ is given by \begintt $$ \openup 1ex \eqalignno{F(x) &=\int_{-\infty}^x H(y)dy \cr &=x^{3/2} &(2.i)\cr \noalign{and} G(z) &\ll 1 &(2.ii)\cr} $$ \endtt The use of |\noalign {}| places the |and| at the margin and maintains the alignment of the $=$ and $\ll$. This technique will not work with |\eqalign| because it does not necessarily take up the full width of the page. Note again the placement of the equation numbers. \mbr \pri\@|\eqno \leqno | \nbr |\eqno| and |\leqno| are used to put an equation ||, usually a number, at the right or left hand side, respectively, of an equation. It can be used with any display mathematics except |\[l]eqalignno|. \mbr \ext\@|\leftequationnumbering \rightequationnumbering| \nbr These commands when used with the auto equation numbering commands |\aneq|, |\aneqtag{}| or |\autoeqnum{}| will result in completely left or right hand equation numbers whether |\eqalignno| or |\leqalignno| is used. However |\eqno| and |\leqno| still result in right and left hand equation numbers respectively.\footnote{\dagger}{These defaults are subject to negotiation and change. It is quite easy to make the equation sides independent of |\eqno| and |\leqno|.} \mbr \pri\@|\noalign {}| \nbr This is used in mathematics to insert text that you want at the left hand margin between lines in an |\eqalignno| or |\leqalignno|. See the |\eqalignno| example. \mbr \pla\@|\openup | \nbr This is used in display mathematics |$$\openup ... $$| to increase spacing between lines in an |\eqalign|, |\eqalignno|, or |\leqalignno|. The dimension should be |ex| for font size independence. It does not work with |\cases| or |\matrix|. \mbr \pri\@|\over ... \under ... \overline{} \underline{} \overbrace{} \underbrace{}| \nbr These commands put lines and braces on top or under the || expressions. Thus $$ \overline{\alpha\beta\gamma} : \underline{2^x_y} : \underbrace{\overbrace{H(x)=u+g(x,y)}} $$ is given by \begintt $$ \overline{\alpha\beta\gamma} : \underline{2^x_y} : \underbrace{\overbrace{H(x)=u+g(x,y)}} $$ \endtt \mbr \pla\@|\dots ... \cdot \cdots \ldots \ddots| \nbr These produce dots of various flavours. Thus $$ [\cdot] : [\cdots] : [\ldots] : [\ddots] $$ are given by \begintt $$ [\cdot] : [\cdots] : [\ldots] : [\ddots] $$ \endtt \mbr \ext\@|\mathopen{}| \nbr This will cause all of the horizontal alignments, such as |\eqalign|, |\eqalignno|, |\halign|, |\cases|, |\matrix|, |\bordermatrix|, |\pmatrix|, and the table macros within the {\bf group} to be spread apart by ||. Its effect on tables with rules or lines is probably undesirable. {\bf It should be used only within a group such as that implied by |$$ ... $$|.} \mbr \mbr \pla\@|\matrix{&&...&\cr \cr ... \cr} \pmatrix{\cr}| \nbr The |\matrix| entry allows for the production of matrices or arrays with an arbitrary number of rows and columns. Thus $$ \left\{ \matrix{ a & b & c \cr \sum_{\ell=1}^n & & \alpha \cr v=0 &\gamma & 1000.0\cr} \right\} $$ is given by \begintt $$ \left\{ \matrix{ a & b & c \cr \sum_{\ell=1}^n & & \alpha \cr v=0 &\gamma & 1000.0\cr} \right\} $$ \endtt Note that the braces |{..}| were in addition to the rows generated by |\matrix|. |\pmatrix| is identical to |\left( \matrix{\cr} \right)|. This just saves the placement of the braces. \mbr \pla\@|\phantom{} \vphantom{} \sphantom{}| \nbr |\phantom| builds a box the same size as || but prints a blank. |\vphantom| is a box of the same height and depth as || but of zero width \dots\ a custom made strut. |\sphantom| is used when strange expansions such as messages create errors using a |\vphantom|. All three are used for controlling spacing. \mbr \pla\@|\sqrt{}| \nbr This puts a square root sign around a || expression. Thus |$\sqrt{2}$| gives $\sqrt{2}$. \mbr \pla\@|\smash{}| \nbr This leaves the || expression in a box of height and depth zero. It is useful for certain kinds of superposition. \endblockmode \ejectpage \done