summaryrefslogtreecommitdiff
path: root/macros/inrstex/inrsdoc/thmateq.tex
blob: e894a666e9df13a369858fed179bdd5ef4b79f23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
%-*-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 |$<expression>$|. 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
$$
<display mathematics forms>
$$
\endtt
There should be {\bf no} blank lines or |\par| within 
|<display mathematics>|. 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
|{<super,subscript characters>}| 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
     {<parm1> \atop <parm2>}
     {<parm1> \choose <parm2>}
     {<parm1> \over <parm2>}
     {<parm1> \atopwithdelims<left delim><right delim>  <parm2>}
     {<parm1> \overwithdelims<left delim><right delim> <parm2>}
     {<parm1> \abovewithdelims<left delim><right delim>
            <bar thickness>  <parm2>}|
\nbr
These forms are all used for putting |<parm1>| on top of |<parm2>| as might
happen in a fraction. The difference between them is that |\atop| puts no
line or bar between the |<parms>| while |\over| does, and |\choose| puts in
no bar but does enclose the |<parms>| in large parens as is normally done in
a binomial coefficient. The forms |\...delims| allow for the specifcation of
delimiters around the |<parms>| that may be different than parens. Finally
the |<bar thickness>| in the |\abovewithdelims| allows for the thickness of
the line or bar between the |<parms>| to be a specified |<dimen>|. 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{<tag>}|  
\nbr
\ext|\autoeqnum{<tag>}|
\nbr
When |autonumbering| is on these commands will automatically number
equations. |\aneq| and |\aneqtag{<tag>}| inserts a bracketed equation number
in the correct place in the equation depending on whether it is an
|\eqalign|, |\eqalignno|, or |\leqalignno|. The |\autonumeq{<tag>}| inserts a
number without brackets. The |<tag>| allows for references to the equation.

If |autonumbering| is off, the |\aneq| results in nothing and the two forms
with |<tag>| insert the |<tag>| --- 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{<top 0>&<top 1>&<top 2>&...&<top n>\cr
              <side 1>&<first row>\cr
                  ...
              <side m>&<last row>\cr}|
\nbr
The |\bordermatrix| places parens around the |<rows>| in the same way as
|\pmatrix| and then places the |<top i>| items above and the |<side i>| 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{<first math>&<first condition>\cr
         ...
        <last math>&<last condition>\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{ <left first row> &<right first row>\cr
                      ...
            <left last row>  &<right last row>\cr}
  \eqalignno{<left first row> &<right first row>&<first eq.no>\cr
                      ...
             <left last row>  &<right last row>&<last eq.no>\cr}
  \leqalignno{<left first row>&<right first row>&<first eq.no>\cr
                      ...
              <left last row> &<right last row>&<last eq.no>\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  |<eq.no>| field
appears on the right. Any of the |<left ...>| or |<right ...>| 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<dimen>|, immediately after the opening |$$|,  
is used to increase the spacing between the lines of an 
|\eqalign| or its relatives by |<dimen>|. A font relative 
|<unit of measure>| 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 {<text>}| 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 <reference>   \leqno <reference>|
\nbr
|\eqno| and |\leqno| are used to put an equation |<reference>|, 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{<tag>}| or |\autoeqnum{<tag>}| 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 {<text>}|
\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 <dimen>|
\nbr
This is used in  display mathematics |$$\openup  ... $$| to increase spacing
between lines in an |\eqalign|, |\eqalignno|, or |\leqalignno|. The dimension
should be |<decimal number>ex| for font size independence. It does not work
with |\cases| or |\matrix|.

\mbr
\pri\@|\over ... \under ...
     \overline{<math>}    \underline{<math>}
     \overbrace{<math>}   \underbrace{<math>}|
\nbr
These commands put lines and braces on top or under the |<math>| 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{<dimen or glue>}|
\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 
|<dimen or glue>|. 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{<entry 11>&<entry 12>&...&<entry 1n>\cr
         <second row>\cr
            ...
         <last row> \cr}
  \pmatrix{<several rows>\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{<rows>\cr} \right)|.
This just saves the placement of the braces.


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

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

\endblockmode
\ejectpage



\done