1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16\writestatus{loading}{ConTeXt Math Macros Plain Helpers}
17
18\unprotect
19
20
21
22\def\relbar{\mathrel{\smash}}
23
24
25
26\permanent\protected\def\hrulefill{\leaders\hrule\hfill}
27
28
29
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
47
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
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{
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 |