math-pln.mkxl /size: 3902 b    last modification: 2023-12-21 09:44
1%D \module
2%D   [       file=math-pln,
3%D        version=2001.11.16,
4%D          title=\CONTEXT\ Math Macros,
5%D       subtitle=Plain Helpers,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14%D Here we collect some Plain \TEX\ leftovers.
15
16\writestatus{loading}{ConTeXt Math Macros / Plain Helpers}
17
18\unprotect
19
20% We need proper unicode:
21
22\def\relbar{\mathrel{\smash-}} % - has the same height as + .. no clue what this refers to
23
24%D This might change:
25
26\permanent\protected\def\hrulefill{\leaders\hrule\hfill}
27%permanent\protected\def\dotfill  {\cleaders\hbox{\normalstartimath\mathsurround\zeropoint\mkern1.5mu.\mkern1.5mu\normalstopimath}\hfill}
28
29%D These need an update:
30
31\permanent\protected\def\bmod
32  {\nonscript
33   \mskip-\medmuskip
34   \mkern5mu
35   \mfunction{mod}%
36   \penalty900
37   \mkern5mu
38   \nonscript
39   \mskip-\medmuskip}
40
41\permanent\protected\def\pmod#1%
42  {\allowbreak
43   \mkern18mu
44   (\mfunction{mod}\mskip\medmuskip#1)}
45
46%D This comes from plain but I gave it a \CONTEXT\ touch. When Mikael and I are in
47%D the mood we will redo them in a more modern way.
48
49\permanent\def\math_border_NC_indeed
50  {\enforced\global\def\math_border_NC{\aligntab}}
51
52\aliased\let\math_border_NC\math_border_NC_indeed
53
54\permanent\def\math_border_NR
55  {\enforced\global\let\math_border_NC\math_border_NC_indeed
56   \cr}
57
58\protected\def\math_border_matrix#1#2#3% adapted plain
59  {\begingroup
60   %
61   \setbox\scratchbox\hbox\bgroup
62     \mr B%
63   \egroup
64   \scratchdimenone\wd\scratchbox
65   %
66   \scratchdimentwo.2\bodyfontsize
67   %
68   \mathsurround\zeropoint
69   %
70   \enforced\def\NC{\math_border_NC}%
71   \enforced\def\NR{\math_border_NR}%
72   %
73   \gdef\m_math_border_matrix
74     {\kern\scratchdimentwo
75      \glet\m_math_border_matrix\relax}%
76   %
77   \setbox\scratchboxone\vbox\bgroup
78     \everycr{\noalign\bgroup\m_math_border_matrix\egroup}%
79     \tabskip \zeroskip
80     \halign{% \ialign resets everycr
81       \startimath\alignmark\alignmark\stopimath
82       \hfil
83       \kern\dimexpr\scratchdimentwo+\scratchdimenone\relax
84       \aligntab
85       \thinspace
86       \hfil
87       \startimath\alignmark\alignmark\stopimath
88       \hfil
89       \aligntab
90       \aligntab
91       \quad
92       \hfil
93       \startimath\alignmark\alignmark\stopimath
94       \hfil
95       \crcr
96       \omit
97       \strut
98       \hfil
99       \crcr
100       \noalign{\kern-\baselineskip}%
101       #3\crcr
102       \omit
103       \strut
104       \cr}%
105   \egroup
106   \setbox\scratchboxtwo\vbox\bgroup
107     \unvcopy\scratchboxone
108     \global\setbox\globalscratchbox\lastbox
109   \egroup
110   \setbox\scratchboxtwo\hbox\bgroup
111     \unhbox\globalscratchbox
112     \unskip
113     \global\setbox\globalscratchbox\lastbox
114   \egroup
115   \setbox\scratchboxtwo\hbox\bgroup
116     \startimath
117     \kern\dimexpr\wd\globalscratchbox-\scratchdimenone\relax
118     \left#1\relax
119     \kern-\wd\globalscratchbox
120     \global\setbox\globalscratchbox\vbox\bgroup
121       \box\globalscratchbox
122       \kern\scratchdimentwo
123     \egroup
124     \vcenter\bgroup
125       \kern-\ht\globalscratchbox
126       \unvbox\scratchboxone
127       \kern-\baselineskip
128     \egroup
129     \thinspace
130     \right#2\relax
131     \stopimath
132   \egroup
133   \null
134   \thickspace
135   \vbox\bgroup
136     \kern\ht\globalscratchbox
137     \box\scratchboxtwo
138   \egroup
139   %
140   \endgroup}
141
142\permanent\protected\def\bordermatrix {\math_border_matrix()}
143\permanent\protected\def\bbordermatrix{\math_border_matrix[]}
144
145\permanent\protected\def\startbordermatrix #1\stopbordermatrix {\math_border_matrix(){#1}}
146\permanent\protected\def\startbbordermatrix#1\stopbbordermatrix{\math_border_matrix[]{#1}}
147
148\permanent\let\stopbordermatrix \relax
149\permanent\let\stopbbordermatrix\relax
150
151\protect \endinput
152