Debian Codegraph @

texmf-dist/tex/plain/zztex/zzmath.tex

raw
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %
3 % Module: ZzTeX Mathematics Facilities
4 %
5 % Synopsis: This file provides the mathematics facilities of
6 % ZzTeX. All of the Plain TeX math stuff is included.
7 %
8 % Author: Paul C. Anagnostopoulos
9 % Created: 14 November 1990
10 %
11 % Copyright 1989--2020 by Paul C. Anagnostopoulos
12 % under The MIT License (opensource.org/licenses/MIT)
13 %
14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15
16 % Math Version
17 % ---- -------
18
19
20 \definecount{\zmathver}{0}
21
22
23 \def \mathversion #1{%
24 \global\zmathver = #1\relax
25 \input zzmathv#1\relax}
26
27 % Alternate Math Fonts
28 % --------- ---- -----
29
30
31 \outer\def \ComputerModernmathfonts {%
32 \input zzcmmath\relax}
33
34 \outer\def \Lucidamathfonts #1{% {arrows?}
35 \setflag \zusemar = #1\relax
36 \input zzlucida\relax}
37
38 \outer\def \MathTimefonts {%
39 \input zzmtime\relax}
40
41 % Spacing
42 % -------
43
44
45 % Note major uses of each kind of space:
46 % thin: around large operators; after punctuation
47 % medium: around binary operators
48 % thick: around relational operators
49
50 \def \setmathspaces #1#2#3{% {thin}{medium}{thick}
51 \global\thinmuskip = #1\relax
52 \global\medmuskip = #2\relax
53 \global\thickmuskip = #3\relax}
54
55 \def \mthickspace {\mkern 2\thinmuskip}
56
57 \def \mthinspace {\mkern \thinmuskip}
58 \def \mnegthinspace {\mkern -\thinmuskip}
59
60 \def \mspace #1{\mkern #1\relax}% {mu}
61
62 % Math mode \, \; \! are in ZZHMODE.
63
64 \def \setTeXmathspaces {%
65 \setmathspaces{3mu}{4mu plus 2mu minus 4mu}{5mu plus 5mu}}
66
67 % Character Definition
68 % --------- ----------
69
70
71 % These are the math character classes:
72
73 \chardef \classord = 0 % An ordinary symbol (\alpha). %^math_class
74 \chardef \classlargeop = 1 % A large operator (\sum).. %^math_class
75 \chardef \classbinop = 2 % A binary operator (+). %^math_class
76 \chardef \classrel = 3 % A relation (=). %^math_class
77 \chardef \classopen = 4 % An opening fence ([). %^math_class
78 \chardef \classclose = 5 % A closing fence (]). %^math_class
79 \chardef \classpunc = 6 % A punctuation character (,). %^math_class
80 \chardef \classvarfam = 7 % A character that varies with \fam (\Gamma). %^math_class
81 \chardef \classactive = 8 % An active character ('). %^math_class
82
83
84 \def \definemathaccent #1#2#3#4{% {name}{class}{family}{hex-code}
85 {\zcalcmathcode{#2}{#3}{#4}%
86 \xdef #1{\mathaccent \the\tcounta\relax}}%
87 \ignorespaces}
88
89 \def \definemathchar #1#2#3#4{% {name}{class}{family}{hex-code}
90 {\zcalcmathcode{#2}{#3}{#4}%
91 \zdefmathch#1\zmark
92 \if \znext
93 \global\mathcode #1= \tcounta
94 \else
95 \global\mathchardef #1= \tcounta
96 \fi}%
97 \ignorespaces}
98
99 \def \definemathdelimiter #1#2#3#4#5#6{% {name}{class}{fam1}{hex1}{fam2}{hex2}
100 {\zcalcmathcode{#2}{#3}{#4}%
101 \multiply \tcounta by 16
102 \advance \tcounta by #5
103 \multiply \tcounta by 256
104 \advance \tcounta by "#6\relax
105 \zdefmathch#1\zmark
106 \if \znext
107 \global\delcode #1= \tcounta
108 \else
109 \xdef #1{\delimiter\the\tcounta\relax}%
110 \fi}%
111 \ignorespaces}
112
113 \def \definemathjoinedsymbol #1#2#3#4#5{% {name}{atom}{char1}{char2}{sep}
114 \gdef #1{#2{{#3}\mspace{#5mu}{#4}}}}
115
116 \def \definemathlabeledarrow #1#2#3#4{% {name}{atom}{label}{arrow}
117 \gdef #1{#2{\mathop{#4}\limits^{#3}}}}
118
119 \def \definemathstackedsymbol #1#2#3#4#5{% {name}{atom}{char1}{char2}{sep}
120 \gdef #1{#2{\mathpalette\zstksym{{#3}{#4}{#5}}}}}
121
122
123 \def \zcalcmathcode #1#2#3{% {class}{family}{hex-code}
124 \tcounta = #1
125 \multiply \tcounta by 16
126 \advance \tcounta by #2
127 \multiply \tcounta by 256
128 \advance \tcounta by "#3\relax}
129
130 \def \zdefmathch #1#2\zmark{%
131 \setflag\znext = {\if `\noexpand#1\true \else \false \fi}}
132
133 \definedimen{\muwidth}{0pt}
134
135 \def \zstksym #1#2{% {style}{{char1}{char2}{sep}}
136 \zstksymb #1#2}
137
138 \def \zstksymb #1#2#3#4{% {style}{char1}{char2}{sep}
139 \vcenter{\baselineskip = 0pt
140 \lineskiplimit = -\maxdimen
141 \setbox \zboxa = \hbox{$#1\mkern 1mu$}%
142 \muwidth = \wd\zboxa
143 \ialign{\hfil ##\hfil\cr
144 \raise #4\muwidth \hbox{$#1#2$}\cr
145 $#1#3$\cr}}}
146
147 % Character Styles
148 % --------- ------
149
150
151 \definecount{\zmstyfam}{0}
152
153
154 \def \setmathdigitstyle #1{% {style}
155 {\tcounta = "\the\classvarfam0
156 \advance \tcounta by \name{#1fam}%
157 \multiply \tcounta by 256
158 \advance \tcounta by `\0%
159 \tcountb = `0
160 \loop
161 \global\mathcode \tcountb = \tcounta
162 \increment \tcounta
163 \increment \tcountb
164 \if \lssp{\tcountb}{`\:}\repeat}}
165
166 \def \setmathletterstyle #1{% {\style}
167 {\tcounta = "\the\classvarfam0
168 \advance \tcounta by \name{#1fam}%
169 \multiply \tcounta by 256
170 \advance \tcounta by `\A%
171 \tcountb = `A
172 \loop
173 \global\mathcode \tcountb = \tcounta
174 \increment \tcounta
175 \increment \tcountb
176 \if \lssp{\tcountb}{`\[}\repeat
177 \advance \tcounta by 6
178 \tcountb = `\a
179 \loop
180 \global\mathcode \tcountb = \tcounta
181 \increment \tcounta
182 \increment \tcountb
183 \if \lssp{\tcountb}{`\{}\repeat}%
184 \if \zcommonencoding
185 \def \znext {#1}%
186 \def \zit {\it}%
187 \if \tokeqlp{\znext}{\zit}\setstyleskewchar{#1}{7}\fi
188 \fi}
189
190 \def \setmathucgreekstyle #1{% {style}
191 {\zmstyfam = \name{#1fam}%
192 \definemathchar \Alpha \classvarfam \rmfam {41}
193 \definemathchar \Beta \classvarfam \rmfam {42}
194 \definemathchar \Gamma \classvarfam \zmstyfam {00}
195 \definemathchar \Delta \classvarfam \zmstyfam {01}
196 \definemathchar \Epsilon \classvarfam \rmfam {45}
197 \definemathchar \Zeta \classvarfam \rmfam {5A}
198 \definemathchar \Eta \classvarfam \rmfam {48}
199 \definemathchar \Theta \classvarfam \zmstyfam {02}
200 \definemathchar \Iota \classvarfam \rmfam {49}
201 \definemathchar \Kappa \classvarfam \rmfam {4B}
202 \definemathchar \Lambda \classvarfam \zmstyfam {03}
203 \definemathchar \Mu \classvarfam \rmfam {4D}
204 \definemathchar \Nu \classvarfam \rmfam {4E}
205 \definemathchar \Xi \classvarfam \zmstyfam {04}
206 \definemathchar \Omicron \classvarfam \rmfam {4F}
207 \definemathchar \Pi \classvarfam \zmstyfam {05}
208 \definemathchar \Rho \classvarfam \rmfam {50}
209 \definemathchar \Sigma \classvarfam \zmstyfam {06}
210 \definemathchar \Tau \classvarfam \rmfam {54}
211 \definemathchar \Upsilon \classvarfam \zmstyfam {07}
212 \definemathchar \Phi \classvarfam \zmstyfam {08}
213 \definemathchar \Chi \classvarfam \rmfam {58}
214 \definemathchar \Psi \classvarfam \zmstyfam {09}
215 \definemathchar \Omega \classvarfam \zmstyfam {0A}}}
216
217 \def \zmtextstyle {\rm}
218 \def \zmtextfam {\rmfam}
219
220 \def \setmathtextstyle #1{% {style}
221 \gdef \zmtextstyle {#1}%
222 \xdef \zmtextfam {\name{#1fam}}}
223
224 \def \zmfunstyle {\rm}
225
226 \def \setmathfunctionstyle #1{% {style}
227 \gdef \zmfunstyle {#1}}
228
229 \def \zmvarstyle {\it}
230
231 \def \setmathmvarstyle #1{% {style}
232 \gdef \zmvarstyle {#1}}
233
234 \def \setmathpunctuationstyle #1{% {style}
235 {\zmstyfam = \name{#1fam}%
236 \definemathchar {`.} \classord \zmstyfam {2E}
237 \definemathchar {`,} \classpunc \zmstyfam {2C}
238 \definemathchar {`;} \classpunc \zmstyfam {3B}}}
239
240 % Characters
241 % ----------
242
243
244 \let \zmchar = \definemathchar
245
246
247 % Letters:
248
249 % INITEX does the following for each letter:
250 %
251 % \definemathchar{letter}{\classvarfam}{\mit}{xx}
252 %
253 % This can be changed using the \setmathletterstyle command above.
254
255
256 % Figures (digits):
257
258 % INITEX does the following for each digit:
259 %
260 % \definemathchar{digit}{\classvarfam}{\rm}{xx}
261 %
262 % This can be changed using the \setmathdigitstyle command above.
263
264
265 % Uppercase Greek letters:
266
267 % This can be changed using the \setmathucgreekstyle command above.
268
269 \setmathucgreekstyle{\rm}
270
271
272 % Lowercase Greek letters:
273
274 \zmchar \alpha \classord \mitfam {0B}
275 \zmchar \beta \classord \mitfam {0C}
276 \zmchar \gamma \classord \mitfam {0D}
277 \zmchar \delta \classord \mitfam {0E}
278 \zmchar \epsilon \classord \mitfam {0F}
279 \zmchar \zeta \classord \mitfam {10}
280 \zmchar \eta \classord \mitfam {11}
281 \zmchar \theta \classord \mitfam {12}
282 \zmchar \iota \classord \mitfam {13}
283 \zmchar \kappa \classord \mitfam {14}
284 \zmchar \lambda \classord \mitfam {15}
285 \zmchar \mu \classord \mitfam {16}
286 \zmchar \nu \classord \mitfam {17}
287 \zmchar \xi \classord \mitfam {18}
288 \zmchar \omicron \classord \mitfam {6F}
289 \zmchar \pi \classord \mitfam {19}
290 \zmchar \rho \classord \mitfam {1A}
291 \zmchar \sigma \classord \mitfam {1B}
292 \zmchar \tau \classord \mitfam {1C}
293 \zmchar \upsilon \classord \mitfam {1D}
294 \zmchar \phi \classord \mitfam {1E}
295 \zmchar \chi \classord \mitfam {1F}
296 \zmchar \psi \classord \mitfam {20}
297 \zmchar \omega \classord \mitfam {21}
298
299 \zmchar \varepsilon \classord \mitfam {22}
300 \zmchar \vartheta \classord \mitfam {23}
301 \zmchar \varpi \classord \mitfam {24}
302 \zmchar \varrho \classord \mitfam {25}
303 \zmchar \varsigma \classord \mitfam {26}
304 \zmchar \varphi \classord \mitfam {27}
305
306
307 % Ordinary symbols:
308
309 \zmchar {`.} \classord \rmfam {2E}
310 \zmchar {`/} \classord \mitfam {3D}
311 \zmchar \zmbackslash \classord \msyfam {6E}
312 \zmchar {`|} \classord \msyfam {6A}
313 \zmchar \aleph \classord \msyfam {40}
314 \zmchar \bot \classord \msyfam {3F}
315 \zmchar \clubsuit \classord \msyfam {7C}
316 \zmchar \diamondsuit \classord \msyfam {7D}
317 \zmchar \ell \classord \mitfam {60}
318 \zmchar \emptyset \classord \msyfam {3B}
319 \zmchar \exists \classord \msyfam {39}
320 \zmchar \flat \classord \mitfam {5B}
321 \zmchar \forall \classord \msyfam {38}
322 \zmchar \heartsuit \classord \msyfam {7E}
323 \zmchar \Im \classord \msyfam {3D}
324 \zmchar \imath \classord \mitfam {7B}
325 \zmchar \infinity \classord \msyfam {31}
326 \let \infty = \infinity
327 \zmchar \jmath \classord \mitfam {7C}
328 \zmchar \nabla \classord \msyfam {72}
329 \zmchar \natural \classord \mitfam {5C}
330 \zmchar \neg \classord \msyfam {3A}
331 \let \lnot = \neg
332 \zmchar \partial \classord \mitfam {40}
333 \zmchar \prime \classord \msyfam {30}
334 \zmchar \Re \classord \msyfam {3C}
335 \zmchar \sharp \classord \mitfam {5D}
336 \zmchar \spadesuit \classord \msyfam {7F}
337 \zmchar \surd \classord \msyfam {70}
338 \zmchar \top \classord \msyfam {3E}
339 \zmchar \triangle \classord \msyfam {34}
340 \zmchar \wp \classord \mitfam {7D}
341
342
343 % Large operations:
344
345 \zmchar \bigcap \classlargeop \mexfam {54}
346 \zmchar \bigcup \classlargeop \mexfam {53}
347 \zmchar \bigodot \classlargeop \mexfam {4A}
348 \zmchar \bigoplus \classlargeop \mexfam {4C}
349 \zmchar \bigotimes \classlargeop \mexfam {4E}
350 \zmchar \bigsqcup \classlargeop \mexfam {46}
351 \zmchar \biguplus \classlargeop \mexfam {55}
352 \zmchar \bigvee \classlargeop \mexfam {57}
353 \zmchar \bigwedge \classlargeop \mexfam {56}
354 \zmchar \coprod \classlargeop \mexfam {60}
355 \zmchar \intop \classlargeop \mexfam {52}
356 \zmchar \ointop \classlargeop \mexfam {48}
357 \zmchar \prod \classlargeop \mexfam {51}
358 \zmchar \smallint \classlargeop \msyfam {73}
359 \zmchar \sum \classlargeop \mexfam {50}
360
361
362 % Binary operations:
363
364 \zmchar {`*} \classbinop \msyfam {03}
365 \zmchar {`+} \classbinop \rmfam {2B}
366 \zmchar {`-} \classbinop \msyfam {00}
367 \zmchar \amalg \classbinop \msyfam {71}
368 \zmchar \ast \classbinop \msyfam {03}
369 \zmchar \bigcirc \classbinop \msyfam {0D}
370 \zmchar \bigtriangledown \classbinop \msyfam {35}
371 \zmchar \bigtriangleup \classbinop \msyfam {34}
372 \zmchar \zmbullet \classbinop \msyfam {0F}
373 \zmchar \cap \classbinop \msyfam {5C}
374 \zmchar \cdot \classbinop \msyfam {01}
375 \zmchar \circ \classbinop \msyfam {0E}
376 \let \compose = \circ
377 \zmchar \cup \classbinop \msyfam {5B}
378 \zmchar \zmdagger \classbinop \msyfam {79}
379 \zmchar \zmddagger \classbinop \msyfam {7A}
380 \zmchar \diamond \classbinop \msyfam {05}
381 \zmchar \div \classbinop \msyfam {04}
382 \zmchar \mp \classbinop \msyfam {07}
383 \zmchar \odot \classbinop \msyfam {0C}
384 \zmchar \ominus \classbinop \msyfam {09}
385 \zmchar \oplus \classbinop \msyfam {08}
386 \zmchar \oslash \classbinop \msyfam {0B}
387 \zmchar \otimes \classbinop \msyfam {0A}
388 \zmchar \pm \classbinop \msyfam {06}
389 \zmchar \setminus \classbinop \msyfam {6E}
390 \zmchar \sqcap \classbinop \msyfam {75}
391 \zmchar \sqcup \classbinop \msyfam {74}
392 \zmchar \star \classbinop \mitfam {3F}
393 \zmchar \times \classbinop \msyfam {02}
394 \let \cross = \times
395 \zmchar \triangleleft \classbinop \mitfam {2F}
396 \zmchar \triangleright \classbinop \mitfam {2E}
397 \zmchar \uplus \classbinop \msyfam {5D}
398 \zmchar \vee \classbinop \msyfam {5F}
399 \let \lor = \vee
400 \zmchar \wedge \classbinop \msyfam {5E}
401 \let \land = \wedge
402 \zmchar \wr \classbinop \msyfam {6F}
403
404
405 % Relations:
406
407 \zmchar {`:} \classrel \rmfam {3A}
408 \zmchar {`<} \classrel \mitfam {3C}
409 \zmchar {`=} \classrel \rmfam {3D}
410 \zmchar {`>} \classrel \mitfam {3E}
411 \zmchar \approx \classrel \msyfam {19}
412 \zmchar \asymp \classrel \msyfam {10}
413 \zmchar \dashv \classrel \msyfam {61}
414 \zmchar \equiv \classrel \msyfam {11}
415 \zmchar \frown \classrel \mitfam {5F}
416 \zmchar \geq \classrel \msyfam {15}
417 \let \ge = \geq
418 \let \gets = \leftarrow
419 \zmchar \gg \classrel \msyfam {1D}
420 \zmchar \in \classrel \msyfam {32}
421 \zmchar \Leftarrow \classrel \msyfam {28}
422 \zmchar \leftarrow \classrel \msyfam {20}
423 \zmchar \leftharpoondown \classrel \mitfam {29}
424 \zmchar \leftharpoonup \classrel \mitfam {28}
425 \zmchar \Leftrightarrow \classrel \msyfam {2C}
426 \zmchar \leftrightarrow \classrel \msyfam {24}
427 \zmchar \leq \classrel \msyfam {14}
428 \let \le = \leq
429 \zmchar \lhook \classrel \mitfam {2C}
430 \zmchar \ll \classrel \msyfam {1C}
431 \zmchar \mapstochar \classrel \msyfam {37}
432 \zmchar \mid \classrel \msyfam {6A}
433 \let \given = \mid
434 \zmchar \nearrow \classrel \msyfam {25}
435 \zmchar \ni \classrel \msyfam {33}
436 \zmchar \not \classrel \msyfam {36}
437 \zmchar \nwarrow \classrel \msyfam {2D}
438 \let \owns = \ni
439 \zmchar \parallel \classrel \msyfam {6B}
440 \zmchar \perp \classrel \msyfam {3F}
441 \zmchar \prec \classrel \msyfam {1E}
442 \zmchar \preceq \classrel \msyfam {16}
443 \zmchar \propto \classrel \msyfam {2F}
444 \zmchar \rhook \classrel \mitfam {2D}
445 \zmchar \Rightarrow \classrel \msyfam {29}
446 \zmchar \rightarrow \classrel \msyfam {21}
447 \zmchar \rightharpoondown \classrel \mitfam {2B}
448 \zmchar \rightharpoonup \classrel \mitfam {2A}
449 \zmchar \searrow \classrel \msyfam {26}
450 \zmchar \sim \classrel \msyfam {18}
451 \zmchar \simeq \classrel \msyfam {27}
452 \zmchar \smile \classrel \mitfam {5E}
453 \zmchar \subset \classrel \msyfam {1A}
454 \zmchar \subseteq \classrel \msyfam {12}
455 \zmchar \succ \classrel \msyfam {1F}
456 \zmchar \succeq \classrel \msyfam {17}
457 \zmchar \supset \classrel \msyfam {1B}
458 \zmchar \supseteq \classrel \msyfam {13}
459 \zmchar \swarrow \classrel \msyfam {2E}
460 \zmchar \sqsubseteq \classrel \msyfam {76}
461 \zmchar \sqsupseteq \classrel \msyfam {77}
462 \let \to = \rightarrow
463 \zmchar \vdash \classrel \msyfam {60}
464
465
466 % Openers:
467
468 \zmchar {`(} \classopen \rmfam {28}
469 \zmchar {`[} \classopen \rmfam {5B}
470 \zmchar {`\{} \classopen \msyfam {66}
471
472
473 % Closers:
474
475 \zmchar {`!} \classclose \rmfam {21}
476 \zmchar {`)} \classclose \rmfam {29}
477 \zmchar {`?} \classclose \rmfam {3F}
478 \zmchar {`]} \classclose \rmfam {5D}
479 \zmchar {`\}} \classclose \msyfam {67}
480
481
482 % Punctuation:
483
484 \zmchar {`,} \classpunc \rmfam {2C}
485 \zmchar {`;} \classpunc \rmfam {3B}
486 \zmchar \cdotp \classpunc \msyfam {01}
487 \zmchar \maps \classpunc \rmfam {3A}
488 \let \colon = \maps
489 \zmchar \ldotp \classpunc \mitfam {3A}
490
491
492 % Active characters:
493
494 \zmchar {` } \classactive \rmfam {00}
495 \zmchar {`'} \classactive \rmfam {00}
496
497 {\catcode`\' = \catactive
498 \gdef '{^\bgroup \zmprima}
499 } % \catcode
500
501 \def \zmprima {\prime \futurelet\znext \zmprimb}
502 \def \zmprimb {%
503 \if \tokeqlp{\znext}{'}%
504 \let \znext = \zmprimc
505 \else \if \tokeqlp{\znext}{^}%
506 \let \znext = \zmprimd
507 \else
508 \let \znext = \egroup
509 \fi\fi
510 \znext}
511 \def \zmprimc #1{\zmprima}
512 \def \zmprimd #1#2{#2\egroup}
513
514 % Delimiters
515 % ----------
516
517 % IniTeX does the following for each character:
518 %
519 % \delcode`x = -1
520
521 \definemathdelimiter{`(}{\classord}{\rmfam}{28}{\mexfam}{00}
522 \definemathdelimiter{`)}{\classord}{\rmfam}{29}{\mexfam}{01}
523 \definemathdelimiter{`/}{\classord}{\rmfam}{2F}{\mexfam}{0E}
524 \definemathdelimiter{`<}{\classord}{\msyfam}{68}{\mexfam}{0A}
525 \definemathdelimiter{`>}{\classord}{\msyfam}{69}{\mexfam}{0B}
526 \definemathdelimiter{`[}{\classord}{\rmfam}{5B}{\mexfam}{02}
527 \definemathdelimiter{`]}{\classord}{\rmfam}{5D}{\mexfam}{03}
528 \definemathdelimiter{`|}{\classord}{\msyfam}{6A}{\mexfam}{0C}
529
530 \definemathdelimiter{\Arrowvert}{\classord}{\mexfam}{3D}{\rmfam}{00}
531 \definemathdelimiter{\arrowvert}{\classord}{\mexfam}{3C}{\rmfam}{00}
532 \definemathdelimiter{\bracevert}{\classord}{\mexfam}{3E}{\rmfam}{00}
533 \definemathdelimiter{\Downarrow}{\classrel}{\msyfam}{2B}{\mexfam}{7F}
534 \definemathdelimiter{\downarrow}{\classrel}{\msyfam}{23}{\mexfam}{79}
535 \definemathdelimiter{\langle}{\classopen}{\msyfam}{68}{\mexfam}{0A}
536 \definemathdelimiter{\lceil}{\classopen}{\msyfam}{64}{\mexfam}{06}
537 \definemathdelimiter{\lfloor}{\classopen}{\msyfam}{62}{\mexfam}{04}
538 \definemathdelimiter{\lgroup}{\classopen}{\rmfam}{00}{\mexfam}{3A}
539 \definemathdelimiter{\lmoustache}{\classopen}{\rmfam}{00}{\mexfam}{40}
540 \definemathdelimiter{\rangle}{\classclose}{\msyfam}{69}{\mexfam}{0B}
541 \definemathdelimiter{\rceil}{\classclose}{\msyfam}{65}{\mexfam}{07}
542 \definemathdelimiter{\rfloor}{\classclose}{\msyfam}{63}{\mexfam}{05}
543 \definemathdelimiter{\rgroup}{\classclose}{\rmfam}{00}{\mexfam}{3B}
544 \definemathdelimiter{\rmoustache}{\classclose}{\rmfam}{00}{\mexfam}{41}
545 \definemathdelimiter{\Uparrow}{\classrel}{\msyfam}{2A}{\mexfam}{7E}
546 \definemathdelimiter{\uparrow}{\classrel}{\msyfam}{22}{\mexfam}{78}
547 \definemathdelimiter{\Updownarrow}{\classrel}{\msyfam}{6D}{\mexfam}{77}
548 \definemathdelimiter{\updownarrow}{\classrel}{\msyfam}{6C}{\mexfam}{3F}
549 \definemathdelimiter{\Vert}{\classord}{\msyfam}{6B}{\mexfam}{0D}
550 \definemathdelimiter{\vert}{\classord}{\msyfam}{6A}{\mexfam}{0C}
551 \definemathdelimiter{\zmbackslash}{\classord}{\msyfam}{6E}{\mexfam}{0F}
552 \definemathdelimiter{\zmlbrace}{\classopen}{\msyfam}{66}{\mexfam}{08}
553 \definemathdelimiter{\zmrbrace}{\classclose}{\msyfam}{67}{\mexfam}{09}
554
555 % Accents
556 % -------
557
558
559 \definemathaccent{\acute}{\classvarfam}{\rmfam}{13}
560 \definemathaccent{\bar}{\classvarfam}{\rmfam}{16}
561 \definemathaccent{\breve}{\classvarfam}{\rmfam}{15}
562 \definemathaccent{\check}{\classvarfam}{\rmfam}{14}
563 \definemathaccent{\ddot}{\classvarfam}{\rmfam}{7F}
564 \definemathaccent{\dot}{\classvarfam}{\rmfam}{5F}
565 \definemathaccent{\grave}{\classvarfam}{\rmfam}{12}
566 \definemathaccent{\zmhat}{\classvarfam}{\rmfam}{5E}
567 \definemathaccent{\zmtilde}{\classvarfam}{\rmfam}{7E}
568 \definemathaccent{\ring}{\classvarfam}{\rmfam}{17}
569 \definemathaccent{\widetilde}{\classord}{\mexfam}{65}
570 \definemathaccent{\widehat}{\classord}{\mexfam}{62}
571 \definemathaccent{\vec}{\classord}{\mitfam}{7E}
572
573 \def \widebar #1{% {math} %~ Wide bar accent. %^math_accent
574 \mathpalette\zwidebar{#1}}
575
576 \def \zwidebar #1#2{% {style}{math}
577 \rlap{\measuretextwidth{\tdimena}{$#1#2$}%
578 \kern .2\tdimena
579 $\overline{\vphantom{#1#2}\kern .6\tdimena}$}%
580 #2}
581
582 % Defined Characters
583 % ------- ----------
584
585
586 \def \angle {%
587 {\vbox{\ialign{$\scriptstyle##$\cr
588 \not \mathrel{\mkern 14mu}\cr
589 \noalign{\nointerlineskip}%
590 \mkern 2.5mu \leaders \hrule height .34pt \hfill
591 \mkern 2.5mu\cr}}}}
592
593 \definemathjoinedsymbol{\bowtie}{\mathrel}{\triangleright}{\triangleleft}{-3}
594
595 \definemathstackedsymbol{\cong}{\mathrel}{\sim}{=}{6}
596
597 \def \degree {^\circ}
598
599 \let \degrees = \degree
600
601 \def \defeq{%
602 \mathrel{\mathop{=}\limits^{\mathscriptscriptstyle{\roman{def}}}}}
603
604 \definemathstackedsymbol{\Deltaeq}{\mathrel}{\mathscriptscriptstyle{\Delta}}{=}{9}
605
606 \definemathstackedsymbol{\doteq}{\mathrel}{.}{=}{9}
607
608 \definemathstackedsymbol{\gel}{\mathrel}{\zge}{<}{11}
609
610 \definemathstackedsymbol{\zge}{\mathrel}{>}{=}{7.5}
611
612 \definemathstackedsymbol{\gl}{\mathrel}{>}{<}{5.5}
613
614 \def \hbar {\mathord{h \llap{$\mathchar"16 \mkern 3.5mu$}}}
615
616 \definemathjoinedsymbol{\hookleftarrow}{\mathrel}{\leftarrow}{\rhook}{-3}
617
618 \definemathjoinedsymbol{\hookrightarrow}{\mathrel}{\lhook}{\rightarrow}{-3}
619
620 \def \int {\intop\nolimits}
621
622 \def \iint {\zint2}
623
624 \def \iiint {\zint3}
625
626 \def \iiiint {\zint4}
627
628 \def \idotsint {\zint0}
629
630 \def \zint #1{%
631 \mkern -9mu \mathchoice{\mkern -5mu}{}{}{}%
632 \mathop{%
633 \mkern 9mu \mathchoice{\mkern 5mu}{}{}{}%
634 \intop
635 \ifcase #1%
636 \mkern -4mu \cdots \mkern -4mu
637 \or \relax \or
638 \zintkern
639 \or
640 \zintkern \intop \zintkern
641 \or
642 \zintkern \intop \zintkern \intop \zintkern
643 \fi}%
644 \intop\nolimits}
645
646 \def \zintkern {\mkern -8mu \mathchoice{\mkern -3mu}{}{}{}}
647
648 \let \join = \bowtie
649
650 \definemathstackedsymbol{\leftrightarrows}{\mathrel}{\leftarrow}{\rightarrow}{6}
651
652 \definemathstackedsymbol{\leftrightharpoons}{\mathrel}{\leftharpoonup}{\rightharpoondown}{4}
653
654 \definemathstackedsymbol{\ltgt}{\mathrel}{<}{>}{5.5}
655
656 \definemathjoinedsymbol{\Longleftarrow}{\mathrel}{\Leftarrow}{\Relbar}{-3}
657
658 \definemathjoinedsymbol{\longleftarrow}{\mathrel}{\leftarrow}{\relbar}{-3}
659
660 \definemathjoinedsymbol{\Longleftrightarrow}{\mathrel}{\Leftarrow}{\Rightarrow}{-3}
661 \let \iff = \Longleftrightarrow
662
663 \definemathjoinedsymbol{\longleftrightarrow}{\mathrel}{\leftarrow}{\rightarrow}{-3}
664
665 \def \longmapsto {\mapstochar \longrightarrow}
666
667 \definemathjoinedsymbol{\Longrightarrow}{\mathrel}{\Relbar}{\Rightarrow}{-3}
668
669 \definemathjoinedsymbol{\longrightarrow}{\mathrel}{\relbar}{\rightarrow}{-3}
670
671 \definemathjoinedsymbol{\longrightleftarrow}{\mathrel}{\rightarrow}{\leftarrow}{-3}
672
673 \def \oint {\ointop\nolimits}
674
675 \def \mapsto {\mapstochar \rightarrow}
676
677 \definemathjoinedsymbol{\models}{\mathrel}{|}{=}{-3}
678
679 \def \neq {\not=}
680 \let \ne = \neq
681
682 \def \nexists {\mathord{\raise .2ex \hbox{$\not\mkern 1.5mu$}\exists}}
683
684 \def \notin {\not\in}
685 \let \nin = \notin
686
687 \def \nparallel {\mathrel{\not\mkern 2mu\parallel}}
688
689 \definemathstackedsymbol{\rightleftarrows}{\mathrel}{\rightarrow}{\leftarrow}{6}
690
691 \definemathstackedsymbol{\rightleftharpoons}{\mathrel}{\rightharpoonup}{\leftharpoondown}{4}
692
693 \definemathjoinedsymbol{\semijoin}{\mathrel}{\triangleright}{<}{-4}
694
695 % Functions
696 % ---------
697
698
699 \def \definemathfunction #1#2#3{% {\name}{text}{limits}
700 \def #1{\mathop{\zmfunstyle #2}#3}}
701
702 \definemathfunction{\ad}{ad}{\nolimits} % adjoint
703 \definemathfunction{\Ai}{Ai}{\nolimits} % Airy function
704 \definemathfunction{\arccos}{arccos}{\nolimits} % arc cosine
705 \definemathfunction{\arccosh}{arccosh}{\nolimits} % hyperbolic arc cosine
706 \definemathfunction{\arccot}{arccot}{\nolimits} % arc cotangent
707 \definemathfunction{\arcsec}{arcsec}{\nolimits} % arc secant
708 \definemathfunction{\arcsin}{arcsin}{\nolimits} % arc sine
709 \definemathfunction{\arctan}{arctan}{\nolimits} % arc tangent
710 \definemathfunction{\arg}{arg}{\nolimits} % argument
711 \definemathfunction{\argmax}{arg\,max}{\displaylimits} % argument maximum
712 \definemathfunction{\argmin}{arg\,min}{\displaylimits} % argument maximum
713 \definemathfunction{\Bd}{Bd}{\nolimits} % Bound
714 \definemathfunction{\cl}{cl}{\nolimits} % closure
715 \definemathfunction{\codim}{codim}{\nolimits} % co-dimension
716 \definemathfunction{\coker}{coker}{\nolimits} % cokernel
717 \definemathfunction{\conj}{conj}{\nolimits} % conjugate
718 \definemathfunction{\cos}{cos}{\nolimits} % cosine
719 \definemathfunction{\cosec}{cos}{\nolimits} % cosecant
720 \definemathfunction{\cosh}{cosh}{\nolimits} % hyperbolic cosine
721 \definemathfunction{\cot}{cot}{\nolimits} % cotangent
722 \definemathfunction{\coth}{coth}{\nolimits} % hyperbolic cotangent
723 \definemathfunction{\csc}{csc}{\nolimits} % cosecant
724 \definemathfunction{\csch}{csch}{\nolimits} % hyperbolic cosecant
725 \definemathfunction{\curl}{curl}{\nolimits} % curl
726 \definemathfunction{\deg}{deg}{\nolimits} % degree
727 \definemathfunction{\det}{det}{\displaylimits} % determinant
728 \definemathfunction{\diag}{diag}{\nolimits} % diagonal
729 \definemathfunction{\dim}{dim}{\nolimits} % dimension
730 \definemathfunction{\dist}{dist}{\nolimits} % distance
731 \definemathfunction{\erf}{erf}{\nolimits} % error function
732 \definemathfunction{\erfc}{erfc}{\nolimits} % error function comp.
733 \definemathfunction{\exp}{exp}{\nolimits} % exponential
734 \definemathfunction{\gcd}{gcd}{\displaylimits} % greatest common div.
735 \definemathfunction{\GL}{GL}{\nolimits} % General Linear
736 \definemathfunction{\glb}{glb}{\nolimits} % greatest lower bound
737 \definemathfunction{\gr}{gr}{\nolimits} % group
738 \definemathfunction{\grad}{grad}{\nolimits} % gradient
739 \definemathfunction{\hom}{hom}{\nolimits} % homology
740 \definemathfunction{\id}{id}{\nolimits} % identity
741 \definemathfunction{\inf}{inf}{\displaylimits} % infinum
742 \definemathfunction{\injlim}{inj\,lim}{\displaylimits} % injected limit
743 \definemathfunction{\ker}{ker}{\nolimits} % kernel
744 \definemathfunction{\lcm}{lcm}{\displaylimits} % least common mult.
745 \definemathfunction{\length}{length}{\nolimits} % length
746 \definemathfunction{\lg}{lg}{\nolimits} % natural logarithm
747 \definemathfunction{\lim}{lim}{\displaylimits} % limit
748 \definemathfunction{\liminf}{lim\,inf}{\displaylimits} % limit infinum
749 \definemathfunction{\limsup}{lim\,sup}{\displaylimits} % limit supremum
750 \definemathfunction{\ln}{ln}{\nolimits} % natural logarithm
751 \definemathfunction{\Log}{Log}{\nolimits} % principal logarithm
752 \definemathfunction{\log}{log}{\nolimits} % logarithm
753 \definemathfunction{\lub}{lub}{\nolimits} % least upper bound
754 \definemathfunction{\max}{max}{\displaylimits} % maximum
755 \definemathfunction{\min}{min}{\displaylimits} % minimum
756 \definemathfunction{\mod}{mod}{\nolimits} % modulus
757 \definemathfunction{\Pr}{Pr}{\displaylimits} % Probability
758 \definemathfunction{\Prob}{Prob}{\displaylimits} % Probability
759 \definemathfunction{\projlim}{proj\,lim}{\displaylimits}% projected limit
760 \definemathfunction{\rank}{rank}{\nolimits} % rank
761 \definemathfunction{\sec}{sec}{\nolimits} % secant
762 \definemathfunction{\sech}{sech}{\nolimits} % hyperbolic secant
763 \definemathfunction{\sgn}{sgn}{\nolimits} % sign
764 \definemathfunction{\sign}{sign}{\nolimits} % sign
765 \definemathfunction{\sin}{sin}{\nolimits} % sine
766 \definemathfunction{\sinc}{sinc}{\nolimits} % cardinal sine
767 \definemathfunction{\sinh}{sinh}{\nolimits} % hyperbolic sine
768 \definemathfunction{\SL}{SL}{\nolimits} % Special Linear
769 \definemathfunction{\sup}{sup}{\displaylimits} % supremum
770 \definemathfunction{\Szg}{Sz(g)}{\nolimits} % Suzuki group
771 \definemathfunction{\tan}{tan}{\nolimits} % tangent
772 \definemathfunction{\tanh}{tanh}{\nolimits} % hyperbolic tangent
773 \definemathfunction{\tr}{tr}{\nolimits} % trace
774 \definemathfunction{\trace}{trace}{\nolimits} % trace
775 \definemathfunction{\wstar}{w*}{\nolimits} % weak star
776
777
778 % For the occasional one-timer:
779
780 \def \mathfunction #1{\mathop{\rm #1}\nolimits}
781
782 \let \mfun = \mathfunction
783
784 % Display/Text/Script Styles
785 % ------------------- ------
786
787
788 \def \mathdisplaystyle #1{{\displaystyle #1}}% {subequation}
789 \def \mathtextstyle #1{{\textstyle #1}}
790 \def \mathscriptstyle #1{{\scriptstyle #1}}
791 \def \mathscriptscriptstyle #1{{\scriptscriptstyle #1}}
792
793 \def \mathpalette #1#2{% {\macro}{text}
794 \mathchoice{#1\displaystyle{#2}}%
795 {#1\textstyle{#2}}%
796 {#1\scriptstyle{#2}}%
797 {#1\scriptscriptstyle{#2}}}
798
799 \def \mtext #1{%
800 {\mathchoice{\hbox{\zmtextstyle #1}}
801 {\hbox{\zmtextstyle #1}}
802 {\hbox{\the\scriptfont\zmtextfam #1}}
803 {\hbox{\the\scriptscriptfont\zmtextfam #1}}}}
804
805 \everymath = {\let\text=\mtext}%
806
807 % This is specifically designed to work in math or in text.
808
809 \def \mvar #1{{\zmvarstyle #1\if \textmodep \/\fi}}% {text}
810
811 % General Tools
812 % ------- -----
813
814
815 \def \aboverule #1{\above #1\relax}% {rule-height}
816
817 \def \abs #1{\left|#1\right|}% {expression}
818
819 \def \big #1{{\hbox{$\left#1\vbox to 8.5pt{}\right.\zmnosp$}}}
820 \def \Big #1{{\hbox{$\left#1\vbox to 11.5pt{}\right.\zmnosp$}}}
821 \def \bigg #1{{\hbox{$\left#1\vbox to 14.5pt{}\right.\zmnosp$}}}
822 \def \Bigg #1{{\hbox{$\left#1\vbox to 17.5pt{}\right.\zmnosp$}}}
823 \def \zmnosp {\nulldelimiterspace = 0pt}
824
825 \def \bigl {\mathopen\big}
826 \def \Bigl {\mathopen\Big}
827 \def \bigm {\mathrel\big}
828 \def \Bigm {\mathrel\Big}
829 \def \bigr {\mathclose\big}
830 \def \Bigr {\mathclose\Big}
831 \def \biggl {\mathopen\bigg}
832 \def \Biggl {\mathopen\Bigg}
833 \def \biggm {\mathrel\bigg}
834 \def \Biggm {\mathrel\Bigg}
835 \def \biggr {\mathclose\bigg}
836 \def \Biggr {\mathclose\Bigg}
837
838 \def \binomial #1#2{{{#1} \atopwithdelims() {#2}}}
839
840 \let \binom = \binomial
841
842 \def \bmod {\mathbin{\rm mod}}
843
844 \def \bordermatrix #1{%
845 {\setbox \zboxa = \hbox{\mex B}%
846 \tdimena = \wd\zboxa
847 \setbox \zboxa = \vbox{%
848 \def \cr {\crcr \noalign{\kern 0pt \global\let \cr = \completerow}}%
849 \ialign{$##$\hfil \kern 2pt \kern \tdimena&
850 \thinspace \hfil $##$\hfil&&
851 \quad \hfil $##$\hfil \crcr
852 \omit \strut \hfil \crcr
853 \noalign{\kern -\baselineskip}%
854 #1\crcr
855 \omit \strut \cr}}%
856 \setbox \zboxc = \vbox{%
857 \unvcopy \zboxa \global\setbox \zboxb = \lastbox}%
858 \setbox \zboxc = \hbox{%
859 \unhbox \zboxb \unskip \global\setbox \zboxb = \lastbox}%
860 \setbox \zboxc = \hbox{%
861 $\kern \wd\zboxb \kern -\tdimena \left(\kern -\wd\zboxb
862 \global\setbox \zboxb = \vbox{\box\zboxb \kern 8pt}%
863 \vcenter{\kern -\ht\zboxb \unvbox\zboxa \kern -\baselineskip}\,%
864 \right)$}%
865 \null\;\vbox{\kern \ht\zboxb \box\zboxc}}}
866
867 \def \brace {\atopwithdelims\{\}}
868
869 \def \bracematrix #1{% {row...}
870 \left\{ \matrix{#1} \right\}}
871
872 \def \brack {\atopwithdelims[]}
873
874 \def \bracketmatrix #1{% {row...}
875 \left[ \matrix{#1} \right]}
876
877 \def \bracketmatrixfl #1{% {row...}
878 \left[ \matrixfl{#1} \right]}
879
880 \def \bracketmatrixfr #1{% {row...}
881 \left[ \matrixfr{#1} \right]}
882
883 \def \cases #1{% {row...}
884 \left\{ \,%
885 \vcenter{\matrixbaselines
886 \ialign{$##$\hfil&
887 \quad {\rm ##}\hfil \crcr
888 #1\crcr}}%
889 \right.}
890
891 % This version of \cases has math in both columns.
892
893 \def \mcases #1{% {row...}
894 \left\{ \,%
895 \vcenter{\matrixbaselines
896 \ialign{$##$\hfil&
897 \quad $##$\hfil \crcr
898 #1\crcr}}%
899 \right.}
900
901 \def \cdots {\mathinner{\cdotp\cdotp\cdotp}}
902
903 \def \ddots {%
904 \if \newdots
905 \vbox{\baselineskip = 4pt \lineskiplimit = 0pt
906 \hbox{.}
907 \hbox{\kern .4em .}
908 \hbox{\kern .8em .}}%
909 \else
910 \mathinner{\mkern 1mu \raise 7pt \vbox{\kern 7pt \hbox{.}}%
911 \mkern 2mu \raise 4pt \hbox{.}%
912 \mkern 2mu \raise 1pt \hbox{.}%
913 \mkern 1mu}%
914 \fi}
915
916 \def \detmatrix #1{% {row...}
917 \left| \matrix{#1} \right|}
918
919 \def \displayfrac #1#2{% {numerator}{denominator}
920 {\displaystyle \frac{#1}{#2}}}
921
922 \def \displaylines #1{% {row...}
923 \openup \jot
924 \global\setflag \zdtop = \true
925 \everycr = {\noalign{\if \zdtop
926 \vskip -\lineskiplimit
927 \vskip \normallineskiplimit
928 \global\setflag \zdtop = \false
929 \else
930 \penalty \interdisplaylinepenalty
931 \fi}}%
932 \halign{\hbox to \displaywidth{$\tabskip = 0pt \everycr = {}%
933 \hfil \displaystyle ##\hfil$}\cr
934 #1\crcr}}
935
936 \def \eqalign #1{% {row...}
937 \vcenter{%
938 \ialign{&\mathstrut \hfil $\displaystyle ##{}$&
939 $\displaystyle {}##$\hfil\cr
940 #1\crcr}}}
941
942 \def \equalfill {%
943 $\mathord =\mkern -6mu
944 \cleaders \hbox{$\mkern -2mu \mathord =\mkern -2mu$}\hfill
945 \mkern -6mu \mathord =$}
946
947 % All other fraction macros should use \frac.
948
949 \def \frac #1#2{% {numerator}{denominator}
950 {{\mskip\fracbarhang #1\mskip\fracbarhang} \over
951 {\mskip\fracbarhang #2\mskip\fracbarhang}}}
952
953 \def \fromunder #1{% {math}
954 \mathrel{\mathop{\longleftarrow}\limits^{#1}}}
955
956 \def \hphantom {%
957 \setflag \zhphant = \true
958 \setflag \zvphant = \false
959 \zphanta}
960
961 \def \joinrel {\mathrel{\mkern -3mu}}
962
963 \def \largefrac #1#2{% {numerator}{denominator}
964 {\mathchoice{\mathdisplaystyle{\frac{#1}{#2}}}
965 {\mathdisplaystyle{\frac{#1}{#2}}}
966 {\mathtextstyle{\frac{#1}{#2}}}
967 {\mathscriptstyle{\frac{#1}{#2}}}}}
968
969 \def \ldots {\mathinner{\ldotp\ldotp\ldotp}}
970
971 \def \leftarrowfill {\zleftarrowfill{\textstyle}}
972 \def \leftrightarrowfill {\zleftrightarrowfill{\textstyle}}
973 \def \rightarrowfill {\zrightarrowfill{\textstyle}}
974 \def \Rightarrowfill {\zRightarrowfill{\textstyle}}
975
976 \def \zleftarrowfill #1{% {style}
977 \setbox\zboxa = \hbox{$#1-$}%
978 \ht\zboxa = 0pt
979 $#1\mathord\leftarrow \mkern -6mu
980 \cleaders \hbox{$#1\mkern -2mu \copy\zboxa \mkern -2mu$}\hfill
981 \mkern -6mu \box\zboxa$}
982
983 \def \zleftrightarrowfill #1{% {style}
984 \setbox\zboxa = \hbox{$#1-$}%
985 \ht\zboxa = 0pt
986 $#1\mathord\leftarrow \mkern -6mu
987 \cleaders \hbox{$#1\mkern -2mu \box\zboxa \mkern -2mu$}\hfill
988 \mkern -6mu \mathord\rightarrow$}
989
990 \def \zRightarrowfill #1{% {style}
991 \setbox\zboxa = \hbox{$#1=$}%
992 \ht\zboxa = 0pt
993 $#1\copy\zboxa \mkern -6mu
994 \cleaders \hbox{$#1\mkern -2mu \box\zboxa \mkern -2mu$}\hfill
995 \mkern -6mu \mathord\Rightarrow$}
996
997 \def \zrightarrowfill #1{% {style}
998 \setbox\zboxa = \hbox{$#1-$}%
999 \ht\zboxa = 0pt
1000 $#1\copy\zboxa \mkern -6mu
1001 \cleaders \hbox{$#1\mkern -2mu \box\zboxa \mkern -2mu$}\hfill
1002 \mkern -6mu \mathord\rightarrow$}
1003
1004 \let \leqalignno = \eqalignno
1005
1006 \def \mathstrut {\vphantom(}
1007
1008 \def \matrix #1{% {row...}
1009 \null\nonscript\,%
1010 \vcenter{\matrixbaselines
1011 \ialign{\hfil $##$\hfil&& \quad \hfil $##$\hfil \crcr
1012 \mathstrut\crcr
1013 \noalign{\kern -\baselineskip}%
1014 #1\crcr
1015 \mathstrut\crcr
1016 \noalign{\kern -\baselineskip}}}%
1017 \nonscript\,}
1018
1019 \let \adjustmatrix = \noalign
1020
1021 \def \matrixfl #1{% {row...}
1022 \null\nonscript\,%
1023 \vcenter{\matrixbaselines
1024 \ialign{$##$\hfil && \quad $##$\hfil \crcr
1025 \mathstrut\crcr
1026 \noalign{\kern -\baselineskip}%
1027 #1\crcr
1028 \mathstrut\crcr
1029 \noalign{\kern -\baselineskip}}}%
1030 \nonscript\,}
1031
1032 \def \matrixfr #1{% {row...}
1033 \null\nonscript\,%
1034 \vcenter{\matrixbaselines
1035 \ialign{\hfil $##$&& \quad \hfil $##$\crcr
1036 \mathstrut\crcr
1037 \noalign{\kern -\baselineskip}%
1038 #1\crcr
1039 \mathstrut\crcr
1040 \noalign{\kern -\baselineskip}}}%
1041 \nonscript\,}
1042
1043 \def \matrixbaselines {%
1044 \baselineskip = \the\matrixspread\normalbaselineskip
1045 \lineskiplimit = \normallineskiplimit
1046 \lineskip = \normallineskip}
1047
1048 \def \ontopof #1#2{{{#1} \atop {#2}}}% {numerator}{denominator}
1049
1050 \def \openup {\afterassignment\zopenup \tdimena=}
1051
1052 \def \zopenup {%
1053 \advance \baselineskip by \tdimena
1054 \advance \lineskiplimit by \tdimena
1055 \advance \lineskip by \tdimena}
1056
1057 \def \overbrace #1{%
1058 \mathop{%
1059 \vbox{\ialign{##\cr
1060 \noalign{\kern 3pt}%
1061 \downbracefill\cr
1062 \noalign{\kern 3pt \nointerlineskip}%
1063 $\hfil \displaystyle{#1}\hfil$\cr}}}\limits}
1064
1065 \def \overleftarrow {\mathpalette\zoverleftarrow}
1066 \def \overleftrightarrow {\mathpalette\zoverleftrightarrow}
1067 \def \overRightarrow {\mathpalette\zoverRightarrow}
1068 \def \overrightarrow {\mathpalette\zoverrightarrow}
1069
1070 \def \zoverleftarrow #1#2{% {style}{math}
1071 \vbox{\ialign{##\cr
1072 \zleftarrowfill{\scriptscriptstyle}\cr
1073 \noalign{\nointerlineskip}%
1074 $\hfil #1#2\hfil$\crcr}}}
1075
1076 \def \zoverleftrightarrow #1#2{% {style}{math}
1077 \vbox{\ialign{##\cr
1078 \zleftrightarrowfill{\scriptscriptstyle}\cr
1079 \noalign{\nointerlineskip}%
1080 $\hfil #1#2\hfil$\crcr}}}
1081
1082 \def \zoverRightarrow #1#2{% {style}{math}
1083 \vbox{\ialign{##\cr
1084 \zRightarrowfill{\scriptscriptstyle}\cr
1085 \noalign{\nointerlineskip}%
1086 $\hfil #1#2\hfil$\crcr}}}
1087
1088 \def \zoverrightarrow #1#2{% {style}{math}
1089 \vbox{\ialign{##\cr
1090 \zrightarrowfill{\scriptscriptstyle}\cr
1091 \noalign{\nointerlineskip}%
1092 $\hfil #1#2\hfil$\crcr}}}
1093
1094 \def \overset #1#2{
1095 \mathbin{\mathop{#2}\limits^{#1}}}
1096
1097 \def \parenmatrix #1{% {row...}
1098 \left( \matrix{#1} \right)}
1099
1100 \let \pmatrix = \parenmatrix
1101
1102 \def \parenmatrixfl #1{% {row...}
1103 \left( \matrixfl{#1} \right)}
1104
1105 \def \parenmatrixfr #1{% {row...}
1106 \left( \matrixfr{#1} \right)}
1107
1108 \def \phantom {%
1109 \setflag \zhphant = \true
1110 \setflag \zvphant = \true
1111 \zphanta}
1112
1113 \def \zphanta {%
1114 \if \mathmodep
1115 \def \znext {\mathpalette\zphantb}%
1116 \else
1117 \let \znext = \zphantc
1118 \fi
1119 \znext}
1120 \def \zphantb #1#2{%
1121 \setbox \zboxa = \hbox{$#1{#2}$}%
1122 \zphantd}
1123 \def \zphantc #1{%
1124 \setbox \zboxa = \hbox{#1}%
1125 \zphantd}
1126 \def \zphantd {%
1127 \setbox \zboxb = \hbox{}%
1128 \if \zhphant \wd\zboxb = \wd\zboxa \fi
1129 \if \zvphant \ht\zboxb = \ht\zboxa \dp\zboxb = \dp\zboxa \fi
1130 \box \zboxb}
1131
1132 \def \plainTeXmathdisplay {%
1133 \global\everydisplay = {}}
1134
1135 \def \pmod #1{\allowbreak \,({\rm mod}\,#1)}
1136
1137 \def \Relbar {\mathrel =}
1138 \def \relbar {\mathrel{\smash -}}
1139
1140 \definebox{\zrootbox}
1141
1142 \def \nthroot #1{% {n}
1143 \setbox\zrootbox = \hbox{$\scriptscriptstyle{#1}$}%
1144 \mathpalette\zroot}
1145
1146 \def \zroot #1#2{% {\style}{radicand}
1147 \setbox\zboxa = \hbox{$#1\sqrt{#2}$}%
1148 \tdimena = \ht\zboxa
1149 \advance \tdimena by -\dp\zboxa
1150 \mkern 5mu \raise .6\tdimena \copy\zrootbox \mkern -10mu \box\zboxa}
1151
1152 \def \skew #1#2#3{% {amount}{accent}{char}
1153 {\zmuskipa = #1mu
1154 \divide \zmuskipa by 2
1155 \mkern \zmuskipa
1156 #2{\mkern -\zmuskipa{#3}\mkern \zmuskipa}%
1157 \mkern -\zmuskipa}{}}
1158
1159 \def \smallfrac #1#2{% {numerator}{denominator}
1160 {\mathchoice{\mathtextstyle{\frac{#1}{#2}}}
1161 {\mathscriptstyle{\frac{#1}{#2}}}
1162 {\mathscriptscriptstyle{\frac{#1}{#2}}}
1163 {\mathscriptscriptstyle{\frac{#1}{#2}}}}}
1164
1165 \def \smash {%
1166 \relax
1167 \if \mathmodep
1168 \def \znext {\mathpalette\zsmasha}%
1169 \else
1170 \let \znext = \zsmashb
1171 \fi
1172 \znext}
1173
1174 \def \zsmasha #1#2{%
1175 \setbox \zboxa = \hbox{$#1{#2}$}%
1176 \zsmashc}
1177 \def \zsmashb #1{%
1178 \setbox \zboxa = \hbox{#1}%
1179 \zsmashc}
1180 \def \zsmashc {%
1181 \ht\zboxa = 0pt
1182 \dp\zboxa = 0pt
1183 \box \zboxa}
1184
1185 \def \sqrt {\radical"270370 }
1186
1187 \let \sub = _
1188 \let \super = ^
1189
1190 \def \Tounder #1{% {math}
1191 \mathrel{\mathop{\Longrightarrow}\limits^{#1}}}
1192
1193 \def \tounder #1{% {math}
1194 \mathrel{\mathop{\longrightarrow}\limits^{#1}}}
1195
1196 \def \underbrace #1{% {text}
1197 \mathop{%
1198 \vtop{\ialign{##\cr
1199 $\hfil \displaystyle{#1}\hfil$\cr
1200 \noalign{\kern 3pt \nointerlineskip}%
1201 \upbracefill\cr
1202 \noalign{\kern 3pt}}}}\limits}
1203
1204 \def \underset #1#2{
1205 \mathbin{\mathop{#2}\limits_{#1}}}
1206
1207 \def \unit #1{% {text}
1208 \if \mathmodep
1209 {\nonscript\,\mtext{#1}}%
1210 \else
1211 \,#1%
1212 \fi}
1213
1214 \def \vdots {%
1215 \if \newdots
1216 \vbox{\baselineskip = 4pt \lineskiplimit = 0pt
1217 \hbox{.}
1218 \hbox{.}
1219 \hbox{.}}%
1220 \else
1221 \vbox{\baselineskip = 4pt \lineskiplimit = 0pt
1222 \kern 6pt
1223 \hbox{.}
1224 \hbox{.}
1225 \hbox{.}}%
1226 \fi}
1227
1228 \def \vphantom {%
1229 \setflag \zhphant = \false
1230 \setflag \zvphant = \true
1231 \zphanta}
1232
1233 % Block Matrices
1234 % ----- --------
1235
1236
1237 \def \blockmatrix #1{% {rows}
1238 \zblockmatrix{\false}{#1}}
1239
1240 \def \blockmatrixvr #1{% {rows}
1241 \zblockmatrix{\true}{#1}}
1242
1243 \def \zblockmatrix #1#2{% {verticals?}{rows}
1244 \left[
1245 \vcenter{%
1246 \defineatsigncommand @R{\colrule}%
1247 \defineatsigncommand @N{\nocolrule}%
1248 \offinterlineskip
1249 \tdimena = \ht\strutbox \advance \tdimena by .2ex
1250 \tdimenb = \dp\strutbox \advance \tdimenb by .4ex
1251 \setbox \strutbox \hbox{\vrule width 0pt height \tdimena depth \tdimenb}%
1252 \ialign{\hfil \strut \thirdspace $##$\thirdspace \hfil&&
1253 \hspace{.35em}%
1254 \vrule \if #1\colrule \else \nocolrule \fi
1255 ##\relax
1256 \hspace{.35em}&
1257 \hfil \strut \thirdspace $##$\thirdspace \hfil\crcr
1258 #2\crcr}}%
1259 \right]}
1260
1261 \def \rowrule {%
1262 \noalign{%
1263 \vskip .5ex
1264 \hrule height .1ex\relax
1265 \vskip .7ex}}
1266
1267 \def \colrule {%
1268 width .1ex }
1269
1270 % Math Displays
1271 % ---- --------
1272
1273
1274 \defineblock{\mathdisplay}{\endmathdisplay}{\true}{}
1275
1276 %~block mathdisplay
1277 % \abovepenalty = integer % Penalty above display.
1278 % \aboveskip = glue % Visual space above display.
1279 % \belowpenalty = integer % Penalty below display.
1280 % \belowskip = glue % Visual space below display.
1281 % \bodyfont = {...} % Font for display.
1282 % \def \comptextformat {...} % Composite number text formatter.
1283 % \diagramdiagarrowstyle = {...} % Style for diagonal arrows in diagrams.
1284 % \diagramgutter = dimen % Gutter between diagram columns.
1285 % \diagraminterrowskip = glue % Interrowskip for diagrams.
1286 % \diagramminarrow = dimen % Minimum length of arrow in diagram.
1287 % \hfuzz = dimen % Overhang allowed at end of line.
1288 % \interrowskip = glue % Extra visual space between equations.
1289 % \leftindent = dimen % Left indentation for \alignleft.
1290 % \matrixspread = {decimal} % Spread factor for matrices.
1291 % \def \numberformat {...} % Equation number formatter.
1292 % \position = {...} % Positioning options.
1293 % \rightindent = dimen % Right indentation for \alignright.
1294 % \textcolor = {...} % Color of text.
1295 %~end
1296
1297 \definetoks{\diagramdiagarrowstyle}
1298 \definedimen{\diagramgutter}{0pt}
1299 \defineskip{\diagraminterrowskip}{0pt}
1300 \definedimen{\diagramminarrow}{0pt}
1301
1302 % Positioning options are:
1303 % \alignleft Left aligned, with \leftindent.
1304 % \alignright Right aligned, with \rightindent.
1305 % \center Centered.
1306 % \numberleft Equation number on left.
1307 % \numberright Equation number on right.
1308
1309 % These parameters are calculated:
1310
1311 \definetoks{\mathdisplayeqno} % Text following \eqno marker.
1312 \definecount{\mathdisplayprevgraf}{-1} % Previous display's ending \prevgraf.
1313 \definecount{\mathdisplayprevpenalty}{0}% Previous display's \belowpenalty.
1314 \defineskip{\mathdisplayprevskip}{0pt} % Previous display's \belowskip.
1315
1316 \declareeverypar{\global\mathdisplayprevgraf=-1}
1317 \zdeclareeveryvcontext{\zsavevcontext{\mathdisplayprevgraf=-1}}
1318
1319 %~ This marker specifies that the following text is the equation number
1320 %~ for the math display.
1321
1322 \definemarker{\eqno}
1323
1324
1325 \everydisplay = {\mathdisplay}
1326
1327 \def \mathdisplay #1$${% equation $$
1328 \advance \displayindent by \leftskip
1329 \advance \displaywidth by -\leftskip
1330 \advance \displaywidth by -\rightskip
1331 % \beginblockscope is unnecessary.
1332 \global\increment \mathdisplaydepth
1333 \abovepenalty = 5000 %~default hard
1334 \belowpenalty = \breakallowed %~default hard
1335 \hfuzz = 1pt %~default hard
1336 \leftindent = 0pt %~default soft
1337 \matrixspread = {1.0} %~default soft
1338 \rightindent = 0pt %~default soft
1339 \textcolor = {}% %~default soft
1340 \processdesign{\mathdisplay}{}%
1341 % \mathdisplaynumber is incremented by \eqno, if appropriate.
1342 \if \eqlp{\prevgraf}{\mathdisplayprevgraf}%
1343 \aboveskip = -\belowskip
1344 \advance \aboveskip by \interrowskip
1345 \fi
1346 \let \text = \mtext
1347 \zmdparams
1348 \settaginfo{}{}% % No tag info so far.
1349 \if \notp{\emptytoksp{\textcolor}}\color{\the\textcolor}\fi
1350 \mathdisplayformat{#1}%
1351 \endmathdisplay}
1352
1353 \def \endmathdisplay {%
1354 \global\mathdisplayprevgraf = \prevgraf
1355 \global\advance \mathdisplayprevgraf by 3
1356 \global\mathdisplayprevpenalty = \belowpenalty
1357 \global\mathdisplayprevskip = \belowskip
1358 \global\decrement \mathdisplaydepth
1359 \if \notp{\emptytoksp{\textcolor}}\endcolor \fi%
1360 % \endblockscope is unnecessary.
1361 $$}
1362
1363 \definecount{\zmdhpos}{0}
1364
1365 \def \zmdparams {%
1366 \abovedisplayskip = \aboveskip
1367 \abovedisplayshortskip = \aboveskip
1368 \belowdisplayskip = \belowskip
1369 \belowdisplayshortskip = \belowskip
1370 \predisplaypenalty = \abovepenalty
1371 \postdisplaypenalty = \belowpenalty
1372 \zmdhpos = 0
1373 \let \center = \relax
1374 \def \alignleft {\zmdhpos = 1}%
1375 \def \alignright {\zmdhpos = 2}%
1376 \setflag \zmdnumleft = \false
1377 \def \numberleft {\setflag \zmdnumleft = \true}%
1378 \let \numberright = \relax
1379 \the\position}
1380
1381 \def \mathdisplayformat #1{% {display}
1382 \the\bodyfont
1383 \zmdparse#1\eqno\eqno\zmark
1384 {\lineskiplimit = \maxdimen % Force \interrowskip between
1385 \lineskip = \interrowskip % each row of multi-line display.
1386 \ifcase \zmdhpos
1387 \if \zmdnumleft % Centered display.
1388 \hbox to \displaywidth {%
1389 \rlap{\hspace{-1\leftskip}\zmdeqno}%
1390 \hfil $\displaystyle \zmdeq$\hfil}%
1391 \else
1392 \hbox to \displaywidth {%
1393 \hfil $\displaystyle \zmdeq$\hfil
1394 \llap{\zmdeqno\hspace{-1\rightskip}}}%
1395 \fi
1396 \or
1397 \if \zmdnumleft % Left-aligned display.
1398 \hbox to \displaywidth {%
1399 \hbox to \leftindent{\hspace{-1\leftskip}\zmdeqno\hss}%
1400 $\displaystyle \zmdeq$\hfil}%
1401 \else
1402 \hbox to \displaywidth{%
1403 \kern \leftindent $\displaystyle \zmdeq$\hfil
1404 \llap{\zmdeqno\hspace{-1\rightskip}}}%
1405 \fi
1406 \or
1407 \if \zmdnumleft % Right-aligned display.
1408 \hbox to \displaywidth {%
1409 \rlap{\hspace{-1\leftskip}\zmdeqno}%
1410 \hfil $\displaystyle \zmdeq$\kern \rightindent}%
1411 \else
1412 \hbox to \displaywidth{%
1413 \hfil $\displaystyle \zmdeq$%
1414 \hbox to \rightindent{\hss\zmdeqno\hspace{-1\rightskip}}}%
1415 \fi
1416 \fi}}
1417
1418 \def \zmdparse #1\eqno#2\eqno#3\zmark{% equation\eqno number\eqno ???\zmark
1419 \def \zmdeq {#1}%
1420 \if \andp{\emptyargp{#2}}{\emptyargp{#3}}%
1421 \let \zmdeqno = \relax
1422 \else
1423 \def \zmdeqno {\zmdformeqno#2\tag\tag\zmark}%
1424 \fi}
1425
1426 % This macro is invoked to format equation numbers in both positions:
1427 % at the end of the display and at the end of \eqaligned rows.
1428
1429 \def \zmdformeqno #1\tag#2\tag#3\zmark{% number\tag{xxx}\tag ???\zmark
1430 \if \emptyargp{#1}%
1431 \global\increment \mathdisplaynumber
1432 \mathdisplayeqno = \expandafter{\number\mathdisplaynumber}%
1433 \setcomptext{\mathdisplaycomptext}%
1434 \else
1435 \zmdexpliciteqno #1 \zmark
1436 \fi
1437 \settaginfo{\the\mathdisplaycomptext}{???}%
1438 \hbox{\numberformat}%
1439 \if \notp{\emptyargp{#3}}\zmdtageqno#2\zmark \fi}
1440
1441 \def \zmdexpliciteqno #1#2 #3\zmark{%
1442 \if \codeeqlp{#1}{!}%
1443 \mathdisplayeqno = {#2}%
1444 \mathdisplaycomptext = {#2}%
1445 \else\if \codeeqlp{#1}{+}%
1446 \global\increment \mathdisplaynumber
1447 \mathdisplayeqno = \expandafter{\number\mathdisplaynumber #2}%
1448 \setcomptext{\mathdisplaycomptext}%
1449 \else\if \codeeqlp{#1}{,}%
1450 \mathdisplayeqno = \expandafter{\number\mathdisplaynumber #2}%
1451 \setcomptext{\mathdisplaycomptext}%
1452 \else\if \codeeqlp{#1}{:}%
1453 \global\increment \mathdisplaynumber
1454 \mathdisplayeqno = {#2}%
1455 \setcomptext{\mathdisplaycomptext}%
1456 \else\if \codeeqlp{#1}{=}%
1457 \zmdseteqno #2\zmark
1458 \setcomptext{\mathdisplaycomptext}%
1459 \else\if \codeeqlp{#1}{>}%
1460 \zmdrefeqno #2;;\zmark
1461 %%% \mathdisplayeqno = {\ref{#2}}%
1462 %%% \mathdisplaycomptext = {\ref{#2}}%
1463 \else
1464 \mathdisplayeqno = {#1#2}%
1465 \setcomptext{\mathdisplaycomptext}%
1466 \fi\fi\fi\fi\fi\fi}
1467
1468 \def \zmdseteqno #1;#2\zmark{%
1469 \global\mathdisplaynumber = #1\relax
1470 \mathdisplayeqno = \expandafter{\number\mathdisplaynumber #2}}
1471
1472 \def \zmdrefeqno #1;#2;#3\zmark{%
1473 \if \emptyargp{#2}%
1474 \mathdisplayeqno = {\ref{#1}}%
1475 \mathdisplaycomptext = {\ref{#1}}%
1476 \else
1477 \mathdisplayeqno = {\ref{#1}\,#2}%
1478 \mathdisplaycomptext = {\ref{#1}\,#2}%
1479 \fi}
1480
1481 \def \zmdtageqno #1#2\zmark{%
1482 \def \znext { }%
1483 \if \znext#2\tag{#1}\else \tag{#1#2}\fi}
1484
1485 \def \setmathdisplaynumber #1{%
1486 \global\mathdisplaynumber = #1\relax
1487 \global\decrement \mathdisplaynumber}
1488
1489 %~ This modifier for |$$| is used when the display is the first thing
1490 %~ after a head, the first thing in a list item, the first thing in
1491 %~ a float, etc. It eliminates the vertical space above the display.
1492
1493 \def \immediatemathdisplay {% %^modifier
1494 \with{\abovepenalty = \breaknever
1495 \aboveskip = 0pt}}
1496
1497 % Aligned Equations
1498 % ------- ---------
1499
1500
1501 % This tool can only be used inside a math display.
1502
1503
1504 \defineskip{\zeqaltabskip}{0pt}
1505 \definedimen{\zeqnoshift}{0pt}
1506
1507 \def \eqaligned #1{% {rows...}
1508 \vcenter{%
1509 \zeqalinit
1510 \halign to \tdimena {%
1511 \hfil $\displaystyle ##{}$\tabskip = 0pt&
1512 $\displaystyle {}##$\hfil \tabskip = \zeqaltabskip&
1513 \relax \zeqaleqno ##\zmark% \relax prevents expansion of \zeqaleqno.
1514 \tabskip = \if \zmdnumleft \displaywidth \else 0pt \fi \cr
1515 #1\crcr}}}
1516
1517 \def \eqalignedpairs #1{% {rows...}
1518 \vcenter{%
1519 \zeqalinit
1520 \halign to \tdimena {%
1521 \hfil $\displaystyle ##{}$\tabskip = 0pt&
1522 $\displaystyle {}##$\hfil&
1523 \hfil $\displaystyle ##{}$&
1524 $\displaystyle {}##$\hfil \tabskip = \zeqaltabskip&
1525 \relax \zeqaleqno ##\zmark% \relax prevents expansion of \zeqaleqno.
1526 \tabskip = \if \zmdnumleft \displaywidth \else 0pt \fi \cr
1527 #1\crcr}}}
1528
1529 \def \eqalignedtriples #1{% {rows...}
1530 \vcenter{%
1531 \zeqalinit
1532 \halign to \tdimena {%
1533 \hfil $\displaystyle ##{}$\tabskip = 0pt&
1534 $\displaystyle {}##$\hfil&
1535 \hfil $\displaystyle ##{}$&
1536 $\displaystyle {}##$\hfil&
1537 \hfil $\displaystyle ##{}$&
1538 $\displaystyle {}##$\hfil \tabskip = \zeqaltabskip&
1539 \relax \zeqaleqno ##\zmark% \relax prevents expansion of \zeqaleqno.
1540 \tabskip = \if \zmdnumleft \displaywidth \else 0pt \fi \cr
1541 #1\crcr}}}
1542
1543 \def \eqalignedquadruples #1{% {rows...}
1544 \vcenter{%
1545 \zeqalinit
1546 \halign to \tdimena {%
1547 \hfil $\displaystyle ##{}$\tabskip = 0pt&
1548 $\displaystyle {}##$\hfil&
1549 \hfil $\displaystyle ##{}$&
1550 $\displaystyle {}##$\hfil&
1551 \hfil $\displaystyle ##{}$&
1552 $\displaystyle {}##$\hfil&
1553 \hfil $\displaystyle ##{}$&
1554 $\displaystyle {}##$\hfil \tabskip = \zeqaltabskip&
1555 \relax \zeqaleqno ##\zmark% \relax prevents expansion of \zeqaleqno.
1556 \tabskip = \if \zmdnumleft \displaywidth \else 0pt \fi \cr
1557 #1\crcr}}}
1558
1559 \def \zeqalinit {%
1560 \def \eqno {&\relax}% \relax prevents expansion of stuff after \eqno.
1561 \tdimena = \displaywidth
1562 \advance \tdimena by -\leftindent
1563 \advance \tdimena by -\rightindent
1564 \zeqaltabskip = \if \eqlp{\zmdhpos}{2}0pt \else \centerindent \fi
1565 \if \zmdnumleft
1566 \zeqnoshift = \leftskip \advance \zeqnoshift by \leftindent
1567 \else
1568 \zeqnoshift = \rightskip \advance \zeqnoshift by \rightindent
1569 \fi
1570 \tabskip = \if \eqlp{\zmdhpos}{1}0pt \else \centerindent \fi}
1571
1572 \def \zeqaleqno \relax#1\zmark{% \relax [\eqno [text]][\tag]\zmark
1573 \if \zmdnumleft
1574 \kern -\displaywidth
1575 \rlap{\zmdformeqno#1\tag\tag\zmark}%
1576 \else
1577 \llap{\zmdformeqno#1\tag\tag\zmark \hspace{-\zeqnoshift}}%
1578 \fi}
1579
1580 \let \adjustmathdisplay = \noalign
1581
1582 % Diagrams
1583 % --------
1584
1585
1586 % This tool can only be used inside a math display.
1587
1588
1589 \def \diagram #1{% {rows...}
1590 \zdiagcmds
1591 \null\,%
1592 \vcenter{%
1593 \lineskip = \diagraminterrowskip
1594 \lineskiplimit = \lineskip
1595 \tabskip = -\diagramgutter
1596 \halign{%
1597 &\kern \diagramgutter \hfil $\displaystyle ##$\hfil \tabskip = 0pt \cr
1598 #1\crcr}}%
1599 \,}
1600
1601 \def \zdiagcmds {%
1602 \defineatsigncommand @>##1>##2>{\zdiagra{##1}{##2}}%
1603 \defineatsigncommand @<##1<##2<{\zdiagla{##1}{##2}}%
1604 \defineatsigncommand @X##1X##2X{\zdiaglra{##1}{##2}}%
1605 \defineatsigncommand @=##1=##2={\zdiaghb{##1}{##2}}%
1606 \defineatsigncommand @V##1V##2V{%
1607 \zdiagva{c}{}{\hbox}{\big\downarrow}{##1}{##2}}%
1608 \defineatsigncommand @A##1A##2A{%
1609 \zdiagva{c}{}{\hbox}{\big\uparrow}{##1}{##2}}%
1610 \defineatsigncommand @|##1|##2|{%
1611 \zdiagva{c}{}{\hbox}{\big|}{##1}{##2}}%
1612 \defineatsigncommand @H##1|##2|{%
1613 \zdiagva{c}{}{\hbox}{\big\Vert}{##1}{##2}}%
1614 \defineatsigncommand @1##11##21##31{%
1615 \zdiagva{##1}{l}{r}{\the\diagramdiagarrowstyle \mathchar "7025}{##2}{##3}}%
1616 \defineatsigncommand @3##13##23##33{%
1617 \zdiagva{##1}{l}{r}{\the\diagramdiagarrowstyle \mathchar "7026}{##2}{##3}}%
1618 \defineatsigncommand @5##15##25##35{%
1619 \zdiagva{##1}{r}{l}{\the\diagramdiagarrowstyle \mathchar "702E}{##2}{##3}}%
1620 \defineatsigncommand @7##17##27##37{%
1621 \zdiagva{##1}{r}{l}{\the\diagramdiagarrowstyle \mathchar "702D}{##2}{##3}}%
1622 \defineatsigncommand @"##1"##2"{\zdiagwd{##1}{##2}}}
1623
1624 \def \zdiagra #1#2{%
1625 {\setbox \zboxa = \hbox{$\scriptstyle \;{#1}\;\;\;$}%
1626 \setbox \zboxb = \hbox{$\scriptstyle \;{#2}\;\;\;$}%
1627 \setbox \zboxc = \hbox{$#2$}%
1628 \tdimena = \diagramminarrow
1629 \if \dimgtrp{\wd\zboxa}{\tdimena}\tdimena = \wd\zboxa \fi
1630 \if \dimgtrp{\wd\zboxb}{\tdimena}\tdimena = \wd\zboxb \fi
1631 \mathrel{\mathop{\hbox to \tdimena {\rightarrowfill}}%
1632 \limits^{#1}\if \dimposp{\wd\zboxc}_{#2}\fi}}}
1633
1634 \def \zdiagla #1#2{%
1635 {\setbox \zboxa = \hbox{$\scriptstyle \;\;\;{#1}\;$}%
1636 \setbox \zboxb = \hbox{$\scriptstyle \;\;\;{#2}\;$}%
1637 \setbox \zboxc = \hbox{$#2$}%
1638 \tdimena = \diagramminarrow
1639 \if \dimgtrp{\wd\zboxa}{\tdimena}\tdimena = \wd\zboxa \fi
1640 \if \dimgtrp{\wd\zboxb}{\tdimena}\tdimena = \wd\zboxb \fi
1641 \mathrel{\mathop{\hbox to \tdimena {\leftarrowfill}}%
1642 \limits^{#1}\if \dimposp{\wd\zboxc}_{#2}\fi}}}
1643
1644 \def \zdiaglra #1#2{%
1645 {\setbox \zboxa = \hbox{$\scriptstyle \;\;\;{#1}\;\;\;$}%
1646 \setbox \zboxb = \hbox{$\scriptstyle \;\;\;{#2}\;\;\;$}%
1647 \setbox \zboxc = \hbox{$#2$}%
1648 \tdimena = \diagramminarrow
1649 \if \dimgtrp{\wd\zboxa}{\tdimena}\tdimena = \wd\zboxa \fi
1650 \if \dimgtrp{\wd\zboxb}{\tdimena}\tdimena = \wd\zboxb \fi
1651 \mathrel{\mathop{\hbox to \tdimena {\leftrightarrowfill}}%
1652 \limits^{#1}\if \dimposp{\wd\zboxc}_{#2}\fi}}}
1653
1654 \def \zdiaghb #1#2{%
1655 {\setbox \zboxa = \hbox{$\scriptstyle \;{#1}\;$}%
1656 \setbox \zboxb = \hbox{$\scriptstyle \;{#2}\;$}%
1657 \setbox \zboxc = \hbox{$#2$}%
1658 \tdimena = \diagramminarrow
1659 \if \dimgtrp{\wd\zboxa}{\tdimena}\tdimena = \wd\zboxa \fi
1660 \if \dimgtrp{\wd\zboxb}{\tdimena}\tdimena = \wd\zboxb \fi
1661 \mathrel{\mathop{\hbox to \tdimena {\equalfill}}%
1662 \limits^{#1}\if \dimposp{\wd\zboxc}_{#2}\fi}}}
1663
1664 \def \zdiagva #1#2#3#4#5#6{% {centering}{h-overlap}{t-overlap}
1665 % {arrow}{left-label}{right-label}
1666 \if \codeeqlp{#1}{h}%
1667 \if \codeeqlp{#2}{l}%
1668 \llap{$\scriptstyle{#5}\mkern 2mu{#4}$}%
1669 \rlap{$\mkern 2mu \scriptstyle #6$}%
1670 \else
1671 \llap{$\scriptstyle{#5}\mkern 2mu$}%
1672 \rlap{${#4}\mkern 2mu \scriptstyle{#6}$}%
1673 \fi
1674 \else\if \codeeqlp{#1}{t}%
1675 \if \codeeqlp{#3}{l}%
1676 \llap{$\scriptstyle{#5}\mkern 2mu{#4}$}
1677 \rlap{$\mkern 2mu \scriptstyle #6$}%
1678 \else
1679 \llap{$\scriptstyle{#5}\mkern 2mu$}
1680 \rlap{${#4}\mkern 2mu \scriptstyle #6$}%
1681 \fi
1682 \else
1683 \llap{$\scriptstyle{#5}\mkern 2mu$}{#4}%
1684 \rlap{$\mkern 2mu \scriptstyle #6$}%
1685 \fi\fi}
1686
1687 \def \zdiagwd #1#2{%
1688 \setbox \zboxa = \hbox{$\scriptstyle #2$}%
1689 \hbox to \wd\zboxa {\hfil $\scriptstyle #1$\hfil}}
1690
1691 % Enunciation Definition
1692 % ----------- ----------
1693
1694
1695 \setlist \zenuntypelist = {}
1696
1697
1698 \def \defineenunciationtype #1#2{% {type}{association}
1699 \if \emptyargp{#2}%
1700 \if \withname\undefinedp{\enunciation#1number}%
1701 \withname\definecount{\enunciation#1number}{0}%
1702 \withname\declaresnapitem{\enunciation#1number}%
1703 \fi
1704 \else
1705 \defineenunciationtype{#2}{}%
1706 \edef \znext {%
1707 \global\withname\let{\enunciation#1number}=\name{\enunciation#2number}}%
1708 \znext
1709 \fi
1710 \append{#1}{\zenuntypelist}}
1711
1712 %~ Use this command to define a new type of enunciation.
1713
1714 \def \defineenunciation #1#2#3{% {type}{association}{design}
1715 \defineenunciationtype{#1}{#2}%
1716 \withname\def {\enunciation#1design}{#3}}
1717
1718
1719 % This is deprecated in favor of \defineenunciation.
1720
1721 \def \defineenunciationtypedesign #1#2#3{% {type}{assocation}{design}
1722 \defineenunciationtype{#1}{#2}%
1723 \withname\def {\enunciation#1design}{#3}}
1724
1725 \def \resetenunciationnumbers {%
1726 \maplist{\global\name{\enunciation##1number}=0\relax}{\zenuntypelist}}
1727
1728 % Enunciation Block
1729 % ----------- -----
1730
1731
1732 \defineblock{\enunciation}{\endenunciation}{\false}{}
1733
1734 %~block enunciation Type
1735 % \abovepenalty = integer % Penalty above block
1736 % \aboveskip = glue % Space b/b above block.
1737 % \setflag \allowclubline = flag % True if club allowed below.
1738 % \setflag \allownesting = flag % True if blocks can be nested.
1739 % \attribution = {...} % Attribution text (no longer used).
1740 % \setflag \attributionarg = flag % True if \enunciation takes attribution argument.
1741 % \autoqed = {,,,} % Automatic QED at end.
1742 % \belowpenalty = integer % Penalty below block.
1743 % \belowskip = glue % Space b/b below block.
1744 % \bodyfont = {...} % Font for text.
1745 % \def \comptextformat {...} % Composite number text formatter.
1746 % \continue = integer % Continued or continuation.
1747 % \difficulty = integer % Level of difficulty.
1748 % \def \endformat {...} % End of enunciation formatter.
1749 % \def \labelformat ##1{...} % Enunciation label formatter.
1750 % \leftindent = glue % Left indentation.
1751 % \parindent = dimen % Paragraph indent.
1752 % \parrag = dimen % Paragraph raggedness.
1753 % \parskip = glue % Paragraph skip.
1754 % \rightindent = glue % Right indentation.
1755 % \width = dimen % Width of text.
1756 %~end
1757
1758 \definetoks{\attribution}
1759 \definecount{\attributiontype}{0} % 0: none; 1: attribution; 2: new title
1760 \definetoks{\autoqed}
1761
1762 \setflag \zautoqeddone = \false
1763
1764
1765 \def \enunciation #1{% {type}{optional-attribution}
1766 \beginblockscope{enunciation}%
1767 \global\increment \enunciationdepth
1768 \abovepenalty = \breakgood %~default hard
1769 \setflag \allowclubline = \false %~default soft
1770 \setflag \allownesting = \false %~default soft
1771 \attribution = {}% %~default with
1772 \setflag \attributionarg = \false %~default soft
1773 \autoqed = {}% %~default soft
1774 \belowpenalty = \breakgood %~default hard
1775 \continue = 0 %~default with
1776 \setflag \continuation = \false % Deprecated
1777 \difficulty = 0 %~default with
1778 \def \endformat {}% %~default soft
1779 \processdesign{\enunciation}{#1}%
1780 \zsetcontinue % Handle old \continuation.
1781 \if \andp{\notp{\allownesting}}{\gtrp{\enunciationdepth}{1}}%
1782 \error{blkcantnest}
1783 {An enunciation cannot be nested inside itself}%
1784 \fi
1785 \if \attributionarg
1786 \let \znext = \enunciationarg
1787 \else
1788 \let \znext = \enunciationb
1789 \fi
1790 \znext{#1}}
1791
1792 \def \enunciationarg #1#2{% {type}{attribution}
1793 \if \notp{\emptyargp{#2}}\attribution = {#2}\fi
1794 \enunciationb{#1}}
1795
1796 \def \enunciationb #1{% {type}
1797 \attributiontype = 0\relax
1798 \global\setflag \zautoqeddone = \false
1799 \if \notp{\emptytoksp{\attribution}}%
1800 \expandafter\zparseenunattr \the\attribution \zmark
1801 \fi
1802 \if \notp{\continuationp}%
1803 \global\withname\increment{\enunciation#1number}%
1804 \fi
1805 \global\withname\enunciationnumber{\enunciation#1number}%
1806 \setcomptext{\enunciationcomptext}%
1807 \enunciationformat
1808 \settaginfo{\the\enunciationcomptext}{???}%
1809 \ignorespaces}
1810
1811 \def \endenunciation {%
1812 \futurelet\nexttoken \zendenunciation}
1813
1814 \def \zendenunciation {%
1815 \endenunciationformat
1816 \global\decrement \enunciationdepth
1817 \endblockscope{enunciation}%
1818 \parnext}
1819
1820 \def \enunciationformat {%
1821 \endgraf
1822 \the\bodyfont
1823 \bbskipabove{\abovepenalty}{\aboveskip}%
1824 \alterindentation{\leftindent}{\rightindent}%
1825 \settextwidth{\width}%
1826 \setparrag{\parrag}%
1827 \expandafter\labelformat\expandafter{\the\attribution}%
1828 \if \notp{\allowclubline}\overrideclubpenalty{\breaknever}\fi}
1829
1830 \def \endenunciationformat{%
1831 \if \notp{\zautoqeddone}\the\autoqed \fi
1832 \endgraf
1833 \endformat
1834 \bbskipbelowblockpar{\nexttoken}{\belowpenalty}{\belowskip}}
1835
1836 %~ This marker indicates that the enunciation title completely
1837 %~ replaces the default title.
1838
1839 \definemarker{\title}
1840
1841 \def \zparseenunattr #1#2\zmark{%
1842 \def \znext {#1}%
1843 \def \ztitle {\title}%
1844 \if \tokeqlp{\znext}{\ztitle}%
1845 \attribution = {#2}%
1846 \attributiontype = 2\relax
1847 \else
1848 \attributiontype = 1\relax
1849 \fi}
1850
1851 %~ This command is used in enunciation design macros to select the
1852 %~ title format based on the |\enunciation| *attribution* argument.
1853
1854 \long\def \attributiontypecase #1#2#3{% {format1}{format2}{format3}
1855 \ifcase \attributiontype
1856 #1% no attribution
1857 \or
1858 #2% normal attribution
1859 \or
1860 #3% title override
1861 \fi}%
1862
1863 % QED Definition
1864 % --- ----------
1865
1866
1867 %~ This command defines an end-of-enunciation dingbat for use
1868 %~ with enunciations.
1869
1870 \def \defineeoedingbat #1#2#3{% {name}{text}{space}
1871 \withname\gdef {#1dingbat}{#2}%
1872 \gdef #1{\zformateoe{#2}#3\zmark}%
1873 \withname\gdef {\no\expandafter\discardtok\string#1}{%
1874 \global\setflag \zautoqeddone = \true}}
1875
1876 \def \zformateoe #1#2#3\zmark{%
1877 {\def \znext {#2}%
1878 \def \zfr {\flushright}%
1879 \if \tokeqlp{\znext}{\zfr}%
1880 \if \vmodep
1881 \rightline{#1}%
1882 \else\if \mathmodep
1883 \hskip #3{#1}%
1884 \else
1885 \hskip #3\retain \nobreak \hfill {#1}%
1886 \fi\fi
1887 \else
1888 \if \vmodep
1889 \rightline{#1}%
1890 \else\if \mathmodep
1891 \hskip #2#3{#1}%
1892 \else
1893 \unskip \hskip #2#3\hskip 0pt plus -1fill \retain \nobreak \hfill {#1}%
1894 \fi\fi
1895 \fi
1896 \global\setflag \zautoqeddone = \true}}
1897
1898
1899 %~ This command is deprecated in favor of |\defineeoedingbat|.
1900
1901 \def \defineqed #1#2#3#4{% {\name}{text}{space}{min-space}
1902 \withname\gdef {#1dingbat}{#2}%
1903 \gdef #1{\zformatqed{#2}{#3}{#4}}%
1904 \withname\gdef{\no\expandafter\discardtok\string#1}{%
1905 \global\setflag \zautoqeddone = \true}}
1906
1907 \def \zformatqed #1#2#3{% {text}{space}{min-space}
1908 {\def \znext {#2}%
1909 \def \zfr {\flushright}%
1910 \if \tokeqlp{\znext}{\zfr}%
1911 \hspace{#3}\retain \nobreak \hfill {#1}%
1912 \else
1913 \if \vmodep
1914 \noindent #1\par
1915 \else
1916 \hspace{#2}{#1}%
1917 \fi
1918 \fi
1919 \global\setflag \zautoqeddone = \true}}