<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%-*-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 |$&lt;expression&gt;$|. 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
$$
&lt;display mathematics forms&gt;
$$
\endtt
There should be {\bf no} blank lines or |\par| within 
|&lt;display mathematics&gt;|. 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
|{&lt;super,subscript characters&gt;}| 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 |&amp;| 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
     {&lt;parm1&gt; \atop &lt;parm2&gt;}
     {&lt;parm1&gt; \choose &lt;parm2&gt;}
     {&lt;parm1&gt; \over &lt;parm2&gt;}
     {&lt;parm1&gt; \atopwithdelims&lt;left delim&gt;&lt;right delim&gt;  &lt;parm2&gt;}
     {&lt;parm1&gt; \overwithdelims&lt;left delim&gt;&lt;right delim&gt; &lt;parm2&gt;}
     {&lt;parm1&gt; \abovewithdelims&lt;left delim&gt;&lt;right delim&gt;
            &lt;bar thickness&gt;  &lt;parm2&gt;}|
\nbr
These forms are all used for putting |&lt;parm1&gt;| on top of |&lt;parm2&gt;| as might
happen in a fraction. The difference between them is that |\atop| puts no
line or bar between the |&lt;parms&gt;| while |\over| does, and |\choose| puts in
no bar but does enclose the |&lt;parms&gt;| in large parens as is normally done in
a binomial coefficient. The forms |\...delims| allow for the specifcation of
delimiters around the |&lt;parms&gt;| that may be different than parens. Finally
the |&lt;bar thickness&gt;| in the |\abovewithdelims| allows for the thickness of
the line or bar between the |&lt;parms&gt;| to be a specified |&lt;dimen&gt;|. 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{&lt;tag&gt;}|  
\nbr
\ext|\autoeqnum{&lt;tag&gt;}|
\nbr
When |autonumbering| is on these commands will automatically number
equations. |\aneq| and |\aneqtag{&lt;tag&gt;}| inserts a bracketed equation number
in the correct place in the equation depending on whether it is an
|\eqalign|, |\eqalignno|, or |\leqalignno|. The |\autonumeq{&lt;tag&gt;}| inserts a
number without brackets. The |&lt;tag&gt;| allows for references to the equation.

If |autonumbering| is off, the |\aneq| results in nothing and the two forms
with |&lt;tag&gt;| insert the |&lt;tag&gt;| --- without the |&lt; &gt;| of course.

For example, |autonumbering| is on,
$$
x \equiv y      \aneq
$$
is given by
\begintt
$$
x \equiv y      \aneq
$$
\endtt
and 
$$
\eqalignno{ f(x)&amp;\approx K x^{-3/2}   &amp; (\autoeqnum{eqfx}.a) \cr
                &amp;\approx 0 \qquad x \gg 0   &amp; (\ref{eqfx}.b) \cr}
$$
is given by
\begintt
$$
\eqalignno{ f(x)&amp;\approx K x^{-3/2}   &amp; (\autoeqnum{eqfx}.a) \cr
                &amp;\approx 0 \qquad x \gg 0   &amp; (\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)&amp;\approx K x^{-3/2}   &amp; (\ref{eqfx}.a) \cr
                &amp;\approx 0 \qquad x \gg 0   &amp; (\ref{eqfx}.b) \cr}
$$
\endtt
The \@|\silenttrue| turns on a switch in |\autoeqnum{&lt;...&gt;}| that prevents it
from writing out its value. 
In this case, the |\autoeqnum{&lt;...&gt;}| 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{&lt;top 0&gt;&amp;&lt;top 1&gt;&amp;&lt;top 2&gt;&amp;...&amp;&lt;top n&gt;\cr
              &lt;side 1&gt;&amp;&lt;first row&gt;\cr
                  ...
              &lt;side m&gt;&amp;&lt;last row&gt;\cr}|
\nbr
The |\bordermatrix| places parens around the |&lt;rows&gt;| in the same way as
|\pmatrix| and then places the |&lt;top i&gt;| items above and the |&lt;side i&gt;| items
to the left hand side outside the parens. Thus
$$
\bordermatrix{ R\backslash C&amp;  Col 1 &amp; Col 2 &amp; Col 3 \cr
                 Row 1      &amp;   a    &amp;   b   &amp;   c   \cr
                 Row 2 &amp;\sum_{\ell=1}^n &amp;    &amp; \alpha \cr
                 Row 3 &amp; v=0         &amp;\gamma &amp; 1000.0\cr}
$$
is given by
\begintt
$$
\bordermatrix{ R\backslash C&amp;  Col 1 &amp; Col 2 &amp; Col 3 \cr
                 Row 1      &amp;   a    &amp;   b   &amp;   c   \cr
                 Row 2 &amp;\sum_{\ell=1}^n &amp;    &amp; \alpha \cr
                 Row 3 &amp; v=0         &amp;\gamma &amp; 1000.0\cr}
$$
\endtt

\mbr
\pla\@|\cases{&lt;first math&gt;&amp;&lt;first condition&gt;\cr
         ...
        &lt;last math&gt;&amp;&lt;last condition&gt;\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 |&lt;...math&gt;| is
the mathematics, and is in display math mode, and the |&lt;...condition&gt;| 
is the condition and  is in internal horizontal mode \dots\ not
math mode. Thus 
$$
G(x) = \cases{\vert x\vert &amp; for $x&lt;0$ \cr
                    x^2    &amp; for $x\ge 0$ \cr}
$$
is given by
\begintt
$$
G(x) = \cases{\vert x\vert &amp; for $x&lt;0$ \cr
                    x^2    &amp; for $x\ge 0$ \cr}
$$
\endtt
\mbr
\pla\@|\eqalign ...
  \eqalign{ &lt;left first row&gt; &amp;&lt;right first row&gt;\cr
                      ...
            &lt;left last row&gt;  &amp;&lt;right last row&gt;\cr}
  \eqalignno{&lt;left first row&gt; &amp;&lt;right first row&gt;&amp;&lt;first eq.no&gt;\cr
                      ...
             &lt;left last row&gt;  &amp;&lt;right last row&gt;&amp;&lt;last eq.no&gt;\cr}
  \leqalignno{&lt;left first row&gt;&amp;&lt;right first row&gt;&amp;&lt;first eq.no&gt;\cr
                      ...
              &lt;left last row&gt; &amp;&lt;right last row&gt;&amp;&lt;last eq.no&gt;\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  |&lt;eq.no&gt;| field
appears on the right. Any of the |&lt;left ...&gt;| or |&lt;right ...&gt;| or 
|&lt;... eq.no.&gt;| 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&lt;dimen&gt;|, immediately after the opening |$$|,  
is used to increase the spacing between the lines of an 
|\eqalign| or its relatives by |&lt;dimen&gt;|. A font relative 
|&lt;unit of measure&gt;| 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)  &amp;=\int_{-\infty}^x H(y)dy \cr
               &amp;=x^{3/2} \cr
         G(z)  &amp;\ll 1 \cr}
    \eqno (12)
$$
which is given by 
\begintt
$$
\eqalign{F(x)  &amp;=\int_{-\infty}^x H(y)dy \cr
               &amp;=x^{3/2} \cr
         G(z)  &amp;\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)  &amp;=\int_{-\infty}^x H(y)dy \cr
                 &amp;=x^{3/2} &amp;(2.i)\cr
\noalign{and}
           G(z)  &amp;\ll 1 &amp;(2.ii)\cr}
$$
is given by
\begintt
$$
\openup 1ex
\eqalignno{F(x)  &amp;=\int_{-\infty}^x H(y)dy \cr
               &amp;=x^{3/2} &amp;(2.i)\cr
\noalign{and}
         G(z)  &amp;\ll 1 &amp;(2.ii)\cr}
$$
\endtt
The use of |\noalign {&lt;text&gt;}| 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 &lt;reference&gt;   \leqno &lt;reference&gt;|
\nbr
|\eqno| and |\leqno| are used to put an equation |&lt;reference&gt;|, 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{&lt;tag&gt;}| or |\autoeqnum{&lt;tag&gt;}| 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 {&lt;text&gt;}|
\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 &lt;dimen&gt;|
\nbr
This is used in  display mathematics |$$\openup  ... $$| to increase spacing
between lines in an |\eqalign|, |\eqalignno|, or |\leqalignno|. The dimension
should be |&lt;decimal number&gt;ex| for font size independence. It does not work
with |\cases| or |\matrix|.

\mbr
\pri\@|\over ... \under ...
     \overline{&lt;math&gt;}    \underline{&lt;math&gt;}
     \overbrace{&lt;math&gt;}   \underbrace{&lt;math&gt;}|
\nbr
These commands put lines and braces on top or under the |&lt;math&gt;| 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{&lt;dimen or glue&gt;}|
\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 
|&lt;dimen or glue&gt;|. 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{&lt;entry 11&gt;&amp;&lt;entry 12&gt;&amp;...&amp;&lt;entry 1n&gt;\cr
         &lt;second row&gt;\cr
            ...
         &lt;last row&gt; \cr}
  \pmatrix{&lt;several rows&gt;\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        &amp;   b   &amp;  c \cr
           \sum_{\ell=1}^n &amp;       &amp; \alpha \cr
               v=0         &amp;\gamma &amp; 1000.0\cr}
\right\} 
$$
is given by
\begintt
$$
\left\{
   \matrix{       a        &amp;   b   &amp;  c \cr
           \sum_{\ell=1}^n &amp;       &amp; \alpha \cr
               v=0         &amp;\gamma &amp; 1000.0\cr}
\right\} 
$$
\endtt
Note that the braces |{..}| were in addition to the rows generated by
|\matrix|. |\pmatrix| is identical to |\left( \matrix{&lt;rows&gt;\cr} \right)|.
This just saves the placement of the braces.


\mbr
\pla\@|\phantom{&lt;math&gt;}    \vphantom{&lt;math&gt;}    \sphantom{&lt;hlist&gt;}|
\nbr
|\phantom| builds a box the same size as |&lt;math&gt;| but prints a blank.
|\vphantom| is a box of the same height and depth as |&lt;math&gt;| 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{&lt;math&gt;}|
\nbr
This puts a square root sign around a |&lt;math&gt;| expression. Thus |$\sqrt{2}$|
gives $\sqrt{2}$.

\mbr
\pla\@|\smash{&lt;math&gt;}|
\nbr
This leaves the |&lt;math&gt;| expression in a box of height and depth zero. It is
useful for certain kinds of superposition.

\endblockmode
\ejectpage



\done
</pre></body></html>