1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18\writestatus{loading}{ConTeXt Support Macros Math}
19
20\unprotect
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70\protected\def\Ucheckedstartdisplaymath
71 {\ifinner
72 \ifhmode
73 \normalUstartmath
74 \let\Ucheckedstopdisplaymath\normalUstopmath
75 \else
76 \normalUstartdisplaymath
77 \let\Ucheckedstopdisplaymath\normalUstopdisplaymath
78 \fi
79 \else
80 \normalUstartdisplaymath
81 \let\Ucheckedstopdisplaymath\normalUstopdisplaymath
82 \fi}
83
84\let\Ucheckedstopdisplaymath\relax
85
86\def\normalmathaligntab{}
87
88\let\normalsuper \Usuperscript
89\let\normalsuber \Usubscript
90
91\let\startimath \Ustartmath
92\let\stopimath \Ustopmath
93\let\startdmath \Ustartdisplaymath
94\let\stopdmath \Ustopdisplaymath
95
96\protected\def\mathematics#1{\relax \ifmmode#1\else\normalstartimath#1\normalstopimath\fi}
97\protected\def\displaymath#1{\noindent \ifmmode#1\else\normalstartdmath#1\normalstopdmath\fi}
98\protected\def\inlinemath #1{\dontleavehmode\ifmmode#1\else\normalstartimath#1\normalstopimath\fi}
99\protected\def\textmath #1{\dontleavehmode\ifmmode#1\else\begingroup\everymath\emptytoks\normalstartimath#1\normalstopimath\endgroup\fi}
100
101\let\m\mathematics
102
103\let\stopmathmode\relax
104
105\protected\def\startmathmode
106 {\relax\ifmmode
107 \begingroup
108 \let\stopmathmode\endgroup
109 \else
110 \normalstartimath
111 \let\stopmathmode\normalstopimath
112 \fi}
113
114\protected\def\nomathematics#1
115 {\relax\ifmmode\hbox{#1}\else#1\fi}
116
117\let\math\mathematics
118
119
120
121
122
123
124\ifdefined\strc_formulas_start_formula \else
125 \def\strc_formulas_start_formula{\normalstartdmath}
126 \def\strc_formulas_stop_formula {\normalstopdmath }
127\fi
128
129\protected\def\displaymathematics#1{\relax\ifmmode#1\else\strc_formulas_start_formula{}#1\strc_formulas_stop_formula\fi}
130\protected\def\inlinemathematics {\dontleavehmode\mathematics}
131\protected\def\automathematics {\relax\ifhmode\expandafter\inlinemathematics\else\expandafter\displaymathematics\fi}
132
133
134
135\protected\def\automathematics
136 {\relax
137 \ifhmode
138 \expandafter\inlinemathematics
139 \else\ifintable
140 \doubleexpandafter\inlinemathematics
141 \else
142 \doubleexpandafter\displaymathematics
143 \fi\fi}
144
145
146
147
148
149
150
151
152
153
154
155\newsignal\dimensionsignal
156
157\def\dimensiontypeface {\tf}
158\def\dimensionhalfspace {\,}
159
160\protected\def\dimension#1
161 {\pushmacro\dodimensionsignal
162 \gdef\dodimensionsignal{\kern\dimensionsignal}
163 \ifzeropt\lastskip
164 \ifzeropt\lastkern
165 \ifmmode
166 \mathematics{\dimensionhalfspace\dimensionhalfspace\dimensiontypeface#1}
167 \else
168 \mathematics{\dimensiontypeface#1}
169 \fi
170 \else\ifdim\lastkern=\dimensionsignal
171 \mathematics{\dimensionhalfspace\dimensiontypeface#1}
172 \else
173 \unkern\mathematics{\dimensionhalfspace\dimensionhalfspace\dimensiontypeface#1}
174 \fi\fi
175 \else
176 \unskip\mathematics{\dimensionhalfspace\dimensionhalfspace\dimensiontypeface#1}
177 \fi
178 \dodimensionsignal
179 \popmacro\dodimensionsignal}
180
181\protected\def\nodimension#1
182 {\unskip#1\glet\dodimensionsignal\relax}
183
184
185
186
187
188
189
190
191
192
193
194
195
196\protected\def\cramped
197 {\mathpalette\math_cramped}
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252\def\math_cramped#1#2
253 {\begingroup
254 \setbox\scratchbox\hbox
255 {\nulldelimiterspace\zeropoint
256 \normalstartimath\mathsurround\zeropoint#1\radical\zerocount{#2}\normalstopimath}
257 \ht\scratchbox\dimexpr
258 \ifx#1\displaystyle
259 \fontdimen\pluseight\textfont\plusone
260 .25\fontdimen\plusfive \textfont\plusone
261 \else
262 1.25\fontdimen\pluseight
263 \ifx#1\textstyle \textfont \else
264 \ifx#1\scriptstyle\scriptfont \else
265 \scriptscriptfont\fi\fi \plusone
266 \fi
267 \ht\scratchbox
268 \relax
269 \box\scratchbox
270 \endgroup}
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297\protected\def\crampedllap{\mathpalette\math_cramped_llap}
298\protected\def\crampedrlap{\mathpalette\math_cramped_rlap}
299\protected\def\crampedclap{\mathpalette\math_cramped_clap}
300
301\def\math_cramped_llap#1#2{{}\dollap{\math_cramped #1{#2}}}
302\def\math_cramped_rlap#1#2{{}\dorlap{\math_cramped #1{#2}}}
303\def\math_cramped_clap#1#2{{}\doclap{\math_cramped #1{#2}}}
304
305
306
307
308
309
310
311
312
313
314
315
316
317\let\superscript \Usuperscript
318\let\subscript \Usubscript
319\let\nosuperscript\Unosuperscript
320\let\nosubscript \Unosubscript
321
322
323
324\let\superprescript \Usuperprescript
325\let\subprescript \Usubprescript
326\let\nosuperprescript\Unosuperprescript
327\let\nosubsprecript \Unosubprescript
328
329\protect \endinput
330 |