| 1 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2 |
% |
| 3 |
% Module: ZzTeX New Mathematics Facilities |
| 4 |
% |
| 5 |
% Synopsis: This file provides the mathematics facilities for "new math" |
| 6 |
% modes 1 and 2. It is loaded after the design file. |
| 7 |
% |
| 8 |
% Author: Paul C. Anagnostopoulos |
| 9 |
% Created: 16 October 2002 |
| 10 |
% |
| 11 |
% Copyright 1989--2020 by Paul C. Anagnostopoulos |
| 12 |
% under The MIT License (opensource.org/licenses/MIT) |
| 13 |
% |
| 14 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 15 |
|
| 16 |
% Punctuation |
| 17 |
% ----------- |
| 18 |
|
| 19 |
|
| 20 |
\if \eqlp{\newmath}{1}% |
| 21 |
|
| 22 |
\def \ldotp {\hbox to .42em{\hfil.\hfil}} |
| 23 |
|
| 24 |
\else\if \gtrp{\newmath}{1}% |
| 25 |
|
| 26 |
% This macro defines the math characters \zmperiod, \zmcomma, |
| 27 |
% colon, and semicolon to use the specified style. |
| 28 |
% If the style is \mit, then it's different. |
| 29 |
|
| 30 |
\def \setmathpunctuationstyle #1{% {style} |
| 31 |
{\zmstyfam = \name{#1fam}% |
| 32 |
\definemathchar {\zmperiod} \classord \zmstyfam {2E} |
| 33 |
\definemathchar {\zmcomma} \classpunc \zmstyfam {2C} |
| 34 |
\definemathchar {`;} \classpunc \zmstyfam {3B} |
| 35 |
\definemathchar {`:} \classrel \zmstyfam {3A}}} |
| 36 |
|
| 37 |
% Now establish \rm as the default punctuation style. |
| 38 |
|
| 39 |
\setmathpunctuationstyle{\rm} |
| 40 |
|
| 41 |
% Period and comma must be active in math. |
| 42 |
|
| 43 |
\definemathchar {`.} \classactive \rmfam {00} |
| 44 |
|
| 45 |
\definemathchar {`,} \classactive \rmfam {00} |
| 46 |
|
| 47 |
% When period and comma are active in math, this is what they do. |
| 48 |
|
| 49 |
{ |
| 50 |
\catcode `\. = \catactive |
| 51 |
\gdef .{\mathpalette\zmactperiod{}} |
| 52 |
|
| 53 |
\catcode `\, = \catactive |
| 54 |
\gdef ,{\mathpalette\zmactcomma{}} |
| 55 |
} |
| 56 |
|
| 57 |
\def \zmactperiod #1#2{% |
| 58 |
\mathord{\hbox to .28em{\hfil $#1\zmperiod$\hfil}}} |
| 59 |
|
| 60 |
\def \zmactcomma #1#2{% |
| 61 |
\mathpunct{\hbox to .33em{\hfil $#1\zmcomma$\kern .03em\hfil}}} |
| 62 |
|
| 63 |
% Now we can define all the dot-oriented math commands. |
| 64 |
|
| 65 |
\def \cdotp {\mathpunct{\vcenter{\hbox{$.$}}}} |
| 66 |
|
| 67 |
\def \ldotp {\mathpunct{.}} |
| 68 |
|
| 69 |
\def \cdots {\mathinner{\cdotp\cdotp\cdotp}} |
| 70 |
|
| 71 |
\def \ddots {% |
| 72 |
\vbox{\baselineskip = 4pt \lineskiplimit = 0pt |
| 73 |
\hbox{.}% |
| 74 |
\hbox{\kern .4em .}% |
| 75 |
\hbox{\kern .8em .}% |
| 76 |
\vskip -.25ex}} |
| 77 |
|
| 78 |
\def \ldots {\mathinner{\ldotp\ldotp\ldotp}} |
| 79 |
|
| 80 |
\def \vdots {% |
| 81 |
\vbox{\baselineskip = 4pt \lineskiplimit = 0pt |
| 82 |
\hbox{.}% |
| 83 |
\hbox{.}% |
| 84 |
\hbox{.}% |
| 85 |
\vskip -.25ex}} |
| 86 |
|
| 87 |
% Make \maps and \colon do the right thing. |
| 88 |
|
| 89 |
\def \maps {\mathpunct{:}} |
| 90 |
|
| 91 |
\let \colon = \maps |
| 92 |
|
| 93 |
\fi\fi |