math-tim.mkii / last modification: 2020-01-30 14:15
%D \module
%D   [       file=math-tim,
%D        version=2001.04.12,
%D          title=\CONTEXT\ Math Macros,
%D       subtitle=Mathtime Specials,
%D         author={Hans Hagen \& Taco Hoekwater},
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\endinput % i will clean this up after taco has gone over it

%D With thanks to Berthold Horn from YandY for providing me
%D evaluation copies of the MathTimePlus fonts.

% version 0 : Michael Spivak
% version 1 : Taco Hoekwater
% version 2 : Hans Hagen
% version 3 : etc etc etc


%D We use the predefined spare families \type {\mcfam} and
%D \type {\mdfam}.

\let\cafam\mcfam \let\hexcafam\hexmcfam
\let\gbfam\mdfam \let\hexgbfam\hexmdfam
\let\gkfam\mdfam \let\hexgkfam\hexmdfam

% Why is this needed?

% \font\tenmd  =mtgu at 10pt
% \font\sevenmd=mtgu at 7.6pt
% \font\fivemd =mtgu at 6pt
% \font\tenmc  =mtms at 10pt
% \font\sevenmc=mtms at 7.6pt
% \font\fivemc =mtms at 6pt
% \textfont        \mcfam\tenmc   \textfont        \mdfam\tenmd
% \scriptfont      \mcfam\sevenmc \scriptfont      \mdfam\sevenmd
% \scriptscriptfont\mcfam\fivemc  \scriptscriptfont\mdfam\fivemd

% \addtocommalist{gk}\familylist
% \addtocommalist{gb}\familylist
% \defineinterfaceconstant {ca} {ca} % boohoo!
% \defineinterfaceconstant {gk} {gk} % boohoo!
% \defineinterfaceconstant {gb} {gb} % boohoo!

% \definealternativestyle[script]   [\ca][\ca]
% \definealternativestyle[greek]    [\gk][\gk]
% \definealternativestyle[boldgreek][\gb][\gb]

% \definebodyfont
%   [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt] [rm]
%   [ca=mtms  sa 1,
%    gk=mtgu  sa 1,
%    gb=mtgub sa 1]

%D Since a font size is a rather fuzzy thing, it will be no
%D surprise that the Math Times fonts have different specs
%D than the Computer Modern Roman fonts.
%D \starttabulate[|Bl|c|c|c|c|c|c|c|c|c|c|]
%D \NC Computer Modern\NC
%D     5  \NC6  \NC7  \NC8  \NC9  \NC10  \NC11  \NC12  \NC14  \NC18\NC\NR
%D \NC Math Times     \NC
%D     6.0\NC6.8\NC7.6\NC8.4\NC9.2\NC10.0\NC10.8\NC11.6\NC13.2\NC--\NC\NR
%D \stoptabulate
%D The following definitions presume the existence of \type
%D {tio} and \type {tibio} font alternatives. Definitions for
%D \type {\tf.} etc and \type {\sc} are left as they are.

%D moved code

%D The next lines set up coding dependant versions of math
%D accents (for \type {texnansi} of course). These are needed
%D in commands like \type {\bf} and \type {\it} (which use the
%D text font encoding) a opposed to \type {_no spec_} and
%D \type {mi} that use the math font encoding. This stuff
%D should be made more general!

% \daghex, \ddaghex and \dothex were wrong in my version of mtmacs

\def\daghex  {86}  % to do
\def\ddaghex {87}
\def\Shex    {A7}
\def\Phex    {B6}
\def\barhex  {16}
\def\hathex  {5E}
\def\dothex  {05}
\def\ddothex {7F}

%D The \type {mtex} fonts need a recalculation of \type
%D {\p@renwd}, which in \CONTEXT\ is done automatically.

%D The following definitions are mostly copied from the file
%D \type {mtmacs.tex}, which banner said:
%D \starttyping
%D MTMACS.TEX VERSION 1.1.1 (1996 Dec 8)
%D \stoptyping
%D We reformatted the macros and changed a few bits and
%D pieces. A further cleanup with regards to the scratch
%D registers will be done later.

\mathchardef\Gamma         = "0130
\mathchardef\Delta         = "0131
\mathchardef\Theta         = "0132
\mathchardef\Lambda        = "0133
\mathchardef\Xi            = "0134
\mathchardef\Pi            = "0135
\mathchardef\Sigma         = "0136
\mathchardef\Upsilon       = "0137
\mathchardef\Phi           = "0138
\mathchardef\Psi           = "0139
\mathchardef\Omega         = "017F
\mathchardef\varGamma      = "0100
\mathchardef\varDelta      = "0101
\mathchardef\varTheta      = "0102
\mathchardef\varLambda     = "0103
\mathchardef\varXi         = "0104
\mathchardef\varPi         = "0105
\mathchardef\varSigma      = "0106
\mathchardef\varUpsilon    = "0107
\mathchardef\varPhi        = "0108
\mathchardef\varPsi        = "0109
\mathchardef\varOmega      = "010A
\mathchardef\varkappa      = "017E

\mathchardef\ldotp         = "613A

\mathchardef\triangleleft  = "2247
\mathchardef\triangleright = "2246
\mathchardef\comp          = "2242

\mathchardef\Relbar        = "3248
\mathchardef\dagger        = "20\daghex    % to do
\mathchardef\ddagger       = "20\ddaghex   % to do
\mathchardef\dotacc        = "0250

\mathcode`\( = "412E
\mathcode`\) = "512F
\mathcode`\. = "013A
\mathcode`\, = "613B
\mathcode`\+ = "2243
\mathcode`\= = "3244
\mathcode`\; = "6249

\delcode `\( = "12E300
\delcode `\) = "12F301

\let\mit=\undefined % to do

\def\vec{\mathaccent"0245 }

% fam equals -1 unless the user has said something
% like \rm (cf. the texbook page 290)



\def\grave  {\ifdefaultfamelse{"024A}{"70\gravehex}}
\def\acute  {\ifdefaultfamelse{"024B}{"70\acutehex}}
\def\check  {\ifdefaultfamelse{"024C}{"70\checkhex}}
\def\breve  {\ifdefaultfamelse{"024D}{"70\brevehex}}
\def\bar    {\ifdefaultfamelse{"024E}{"70\barhex  }}
\def\hat    {\ifdefaultfamelse{"024F}{"70\hathex  }}
\def\dot    {\ifdefaultfamelse{"0250}{"70\dothex  }}
\def\tilde  {\ifdefaultfamelse{"0251}{"70\tildehex}}
\def\ddot   {\ifdefaultfamelse{"0252}{"70\ddothex }}

\def\widebar{\mathaccent"0253 }


\def\dag {\edef\next@{0\daghex }\expandafter\mathhexbox@\next@}



      \raise7\points\vbox{\kern 7\points\hbox{$\mathsurround\zeropoint.$}}\mkern2mu
      \raise \points\hbox{$\mathsurround\zeropoint.$}\mkern1mu}}

      {\hbox{\lower.07em \hbox{$\mathchar"\barhex$}}}
      {\hbox{\lower.07em \hbox{$\mathchar"\barhex$}}}

      \mkern2.5mu\leaders\hrule height.48\points\hfill\mkern2.5mu\crcr}}}}


\amstexex = .2326ex

     \hfil\the\textfont\zerocount lim\hfil\crcr

     \hfil\the\textfont\zerocount lim\hfil\crcr

\def\varliminf{\mathop{\underbar  {lim}}} % context-ified
\def\varlimsup{\mathop{\overstrike{lim}}} % context-ified

\def\spdot   {^{\hbox{\raise\amstexex\hbox{\the\textfont\zerocount   .}}}}
\def\spddot  {^{\hbox{\raise\amstexex\hbox{\the\textfont\zerocount  ..}}}}
\def\spdddot {^{\hbox{\raise\amstexex\hbox{\the\textfont\zerocount ...}}}}

%D Here some code is merged in order to save strings.

   \ifdim\ht0<\dimen0 \dimen0\ht0 \fi




  {\errmessage{\noexpand#1allowed only in math mode}}




   \ifdim\dimen@>30\points \advance\dimen@ii-16\points \else
   \ifdim\dimen@>24\points \advance\dimen@ii -8\points \else
   \ifdim\dimen@>18\points \advance\dimen@ii -6\points \else
   \ifdim\dimen@>12\points \advance\dimen@ii -4\points \else
   \ifdim\dimen@>10\points \advance\dimen@ii -2\points \fi\fi\fi\fi\fi
   \setbox\plustwo=\hbox{$\mathsurround\zeropoint#1\mskip\uproot@ mu$}%
   \advance\dimen@ii by1.667\wd\plustwo
   \mkern-\leftroot@ mu\mkern5mu\raise.6\dimen@ii\copy\rootbox
   \mkern-8mu\mkern\leftroot@ mu\box\zerocount\leftroot\zerocount\uproot\zerocount}

\def\space@.{\futurelet\space@\relax} \space@. % really needed ?

  {\mkern-\plustwo mu}

%D For the moment the following code is left unchanged. It is
%D not used anyway.

\newif\ifsubscriptcorrection \subscriptcorrectionfalse


  \expandafter\let\csname subscript character \string_\endcsname_


       \expandafter\csname subscript character \string_\endcsname


  \ifnum\catcode`\^^A=8 \catcode`\^^A\active\let^^A_\fi

    {\csname subscript character \string_\endcsname

       \def\next@. %
         {\ifx\next j%
            \mkern-\plustwo mu\else
          \ifx\next f%
            \mkern-\plustwo mu\else
          \ifx\next p%
            \mkern-\plusone mu\fi\fi\fi}%