1
2
3
4
5
6
7
8
9
10
11
12
13
14\writestatus{loading}{ConTeXt Math Macros Initializations}
15
16
17
18
19
20
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\unprotect
62
63\newdimension \mathstrutht
64\newdimension \mathstrutdp
65\newinteger \mathnestinglevel
66
67\newcount \c_math_strc_hangafter
68\newdimen \d_math_strc_hangindent
69
70\newcount \c_strc_math_n_of_lines
71
72\newdimension \d_strc_math_max_right
73\newdimension \d_strc_math_first_right
74\newdimension \d_strc_math_last_right
75
76\newdimension \d_strc_math_max_left
77\newdimension \d_strc_math_first_left
78\newdimension \d_strc_math_last_left
79
80\newdimension \d_strc_math_first_height
81\newdimension \d_strc_math_last_depth
82
83\newdimension \d_strc_math_display_width
84\newdimension \d_strc_math_indent
85\newconditional\c_strc_math_indent
86
87\newdimension \d_strc_math_left_shift
88\newdimension \d_strc_math_right_shift
89
90\newinteger \currentmathblob
91\newinteger \currentmathblobnesting
92
93\registerctxluafile{mathini}{autosuffix}
94\registerctxluafile{mathdim}{autosuffix}
95
96\registerctxluafile{mathext}{autosuffix}
97\registerctxluafile{mathvfu}{autosuffix}
98\registerctxluafile{mathttv}{autosuffix}
99\registerctxluafile{mathmap}{autosuffix}
100\registerctxluafile{mathact}{autosuffix}
101\registerctxluafile{mathren}{autosuffix}
102\registerctxluafile{mathnoa}{autosuffix}
103\registerctxluafile{mathtag}{autosuffix}
104\registerctxluafile{mathfbk}{autosuffix}
105
106\registerctxluafile{mathspa}{autosuffix}
107\registerctxluafile{mathfnt}{autosuffix}
108\registerctxluafile{mathpre}{autosuffix}
109\registerctxluafile{mathtxt}{autosuffix}
110
111
112
113\aliased\let\Umathemwidth\Umathquad
114
115\protected\def\mathaxisunit {\scaledmathaxis \mathstyle\norelax}
116\protected\def\mathexheightunit{\scaledmathexheight\mathstyle\norelax}
117\protected\def\mathquadunit {\scaledmathemwidth \mathstyle\norelax}
118
119\newuserunit \mathaxisunit ma
120\newuserunit \mathexheightunit mx
121\newuserunit \mathquadunit mq
122
123
124
125
126
127\delimiterfactor \plusthousand
128\delimitershortfall \zeropoint
129
130
131
132
133
134
135
136
137
138
139\integerdef\ignoreemptyscriptsmodecode\numexpr
140 \ignoreemptysuperscriptsmodecode
141 \ignoreemptysubscriptsmodecode
142 \ignoreemptyprimescriptsmodecode
143\relax
144
145\mathscriptsmode\ignoreemptyscriptsmodecode
146
147
148
149
150
151
152
153
154\mathfontcontrol\numexpr
155 \zerocount
156 \overrulemathcontrolcode
157 \underrulemathcontrolcode
158 \radicalrulemathcontrolcode
159 \fractionrulemathcontrolcode
160 \accentskewhalfmathcontrolcode
161 \accentskewapplymathcontrolcode
162 \applyordinarykernpairmathcontrolcode
163 \applyverticalitalickernmathcontrolcode
164 \applyordinaryitalickernmathcontrolcode
165
166
167 \applyboxeditalickernmathcontrolcode
168 \staircasekernmathcontrolcode
169 \applytextitalickernmathcontrolcode
170 \checktextitalickernmathcontrolcode
171
172 \applyscriptitalickernmathcontrolcode
173
174 \analyzescriptnucleuscharmathcontrolcode
175 \analyzescriptnucleuslistmathcontrolcode
176 \analyzescriptnucleusboxmathcontrolcode
177 \accenttopskewwithoffsetmathcontrolcode
178
179
180 \extendaccentsmathcontrolcode
181 \extenddelimitersmathcontrolcode
182\relax
183
184
185
186
187
188
189\immutable\mugluespecdef\defaultthickermuskip 7mu plus 5mu
190\immutable\mugluespecdef\defaultthickmuskip 5mu plus 3mu minus 1mu
191\immutable\mugluespecdef\defaultmedmuskip 4mu plus 2mu minus 2mu
192\immutable\mugluespecdef\defaultthinmuskip 3mu
193\immutable\mugluespecdef\defaulttinymuskip 2mu minus 1mu
194\immutable\mugluespecdef\defaultpettymuskip 1mu minus 0.5mu
195
196\immutable\mugluespecdef\halfthickmuskip 2.5mu plus 1.5mu minus 0.5mu
197\immutable\mugluespecdef\halfmedmuskip 2mu plus 1mu minus 1mu
198\immutable\mugluespecdef\halfthinmuskip 1.5mu
199\immutable\mugluespecdef\halftinymuskip 1mu minus 0.5mu
200\immutable\mugluespecdef\halfpettymuskip 0.5mu minus 0.25mu
201
202\immutable\mugluespecdef\hairmuskip .15mu
203
204\immutable\integerdef \defaultrelpenalty 500
205\immutable\integerdef \defaultbinoppenalty 700
206\immutable\integerdef \defaultprerelpenalty 100
207\immutable\integerdef \defaultprebinoppenalty 100
208
209\newmuskip\thickermuskip \thickermuskip \defaultthickermuskip
210\newmuskip\fencemuskip \fencemuskip \defaultpettymuskip
211\newmuskip\continuationmuskip \continuationmuskip \zeromuskip
212
213
214
215\setnewconstant\mathstylevariantidentity "01234567
216\setnewconstant\mathstylevariantcramped "11335577
217\setnewconstant\mathstylevariantuncramped "00224466
218
219
220
221
222\setnewconstant\mathallcode \mathclassvalue all
223\setnewconstant\mathbegincode \mathclassvalue begin
224\setnewconstant\mathendcode \mathclassvalue end
225\setnewconstant\mathunsetcode \mathclassvalue unset
226
227\setnewconstant\mathordinarycode \mathclassvalue ordinary \aliased\let\mathordcode \mathordinarycode
228\setnewconstant\mathoperatorcode \mathclassvalue operator \aliased\let\mathopcode \mathoperatorcode
229\setnewconstant\mathbinarycode \mathclassvalue binary \aliased\let\mathbincode \mathbinarycode
230\setnewconstant\mathrelationcode \mathclassvalue relation \aliased\let\mathrelcode \mathrelationcode
231\setnewconstant\mathopencode \mathclassvalue open
232\setnewconstant\mathclosecode \mathclassvalue close
233\setnewconstant\mathpunctuationcode \mathclassvalue punctuation \aliased\let\mathpunctcode\mathpunctuationcode
234\setnewconstant\mathvariablecode \mathclassvalue variable
235\setnewconstant\mathactivecode \mathclassvalue active
236\setnewconstant\mathinnercode \mathclassvalue inner
237\setnewconstant\mathundercode \mathclassvalue under
238\setnewconstant\mathovercode \mathclassvalue over
239\setnewconstant\mathfractioncode \mathclassvalue fraction
240\setnewconstant\mathradicalcode \mathclassvalue radical
241\setnewconstant\mathmiddlecode \mathclassvalue middle
242\setnewconstant\mathprimecode \mathclassvalue prime
243\setnewconstant\mathaccentcode \mathclassvalue accent
244\setnewconstant\mathfencedcode \mathclassvalue fenced
245\setnewconstant\mathghostcode \mathclassvalue ghost
246\setnewconstant\mathvcentercode \mathclassvalue vcenter
247\setnewconstant\mathexplicitcode \mathclassvalue explicit
248\setnewconstant\mathimaginarycode \mathclassvalue imaginary
249\setnewconstant\mathdifferentialcode \mathclassvalue differential
250\setnewconstant\mathexponentialcode \mathclassvalue exponential
251\setnewconstant\mathintegralcode \mathclassvalue integral
252\setnewconstant\mathellipsiscode \mathclassvalue ellipsis
253\setnewconstant\mathfunctioncode \mathclassvalue function
254\setnewconstant\mathdigitcode \mathclassvalue digit
255\setnewconstant\mathdivisioncode \mathclassvalue division
256\setnewconstant\mathfactorialcode \mathclassvalue factorial
257\setnewconstant\mathwrappedcode \mathclassvalue wrapped
258\setnewconstant\mathconstructcode \mathclassvalue construct
259\setnewconstant\mathdimensioncode \mathclassvalue dimension
260\setnewconstant\mathunarycode \mathclassvalue unary
261\setnewconstant\mathtextpunctuationcode \mathclassvalue textpunctuation
262\setnewconstant\mathunspacedcode \mathclassvalue unspaced
263\setnewconstant\mathexperimentalcode \mathclassvalue experimental
264\setnewconstant\mathfakecode \mathclassvalue fake
265\setnewconstant\mathnumbergroupcode \mathclassvalue numbergroup
266\setnewconstant\mathcontinuationcode \mathclassvalue continuation
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288\setnewconstant\mathmaybeordinarycode \mathclassvalue maybeordinary
289\setnewconstant\mathmayberelationcode \mathclassvalue mayberelation
290\setnewconstant\mathmaybebinarycode \mathclassvalue maybebinary
291
292
293
294\setnewconstant\mathchemicalbondcode \mathclassvalue chemicalbond
295\setnewconstant\mathimplicationcode \mathclassvalue implication
296
297
298
299
300
301
302
303
304
305
306
307
308
309\copymathspacing \mathimaginarycode \mathordinarycode
310\copymathspacing \mathdifferentialcode \mathordinarycode
311\copymathspacing \mathfactorialcode \mathordinarycode
312\copymathspacing \mathexponentialcode \mathordinarycode
313\copymathspacing \mathintegralcode \mathoperatorcode
314\copymathspacing \mathdigitcode \mathordinarycode
315\copymathspacing \mathfunctioncode \mathoperatorcode
316\copymathspacing \mathwrappedcode \mathfractioncode
317\copymathspacing \mathunarycode \mathordinarycode
318
319\copymathspacing \mathvariablecode \mathordinarycode
320
321\copymathspacing \mathmaybeordinarycode \mathordinarycode
322\copymathspacing \mathmayberelationcode \mathrelationcode
323\copymathspacing \mathmaybebinarycode \mathbinarycode
324
325
326\copymathspacing \mathnumbergroupcode \mathrelationcode
327
328\copymathspacing \mathchemicalbondcode \mathordinarycode
329\copymathspacing \mathimplicationcode \mathrelationcode
330
331\setnewconstant\mathlimopcode \plusone
332\setnewconstant\mathnolopcode \plusone
333
334\pushoverloadmode
335
336\aliased\let\mathordinary \normalmathord
337\aliased\let\mathoperator \normalmathop
338\aliased\let\mathbinary \normalmathbin
339\aliased\let\mathrelation \normalmathrel
340\aliased\let\mathopen \normalmathopen
341\aliased\let\mathclose \normalmathclose
342\aliased\let\mathpunctuation\normalmathpunct
343\aliased\let\mathinner \normalmathinner
344
345
346
347
348
349
350
351
352
353
354
355\untraced\protected\def\mathfraction {\mathatom \s!class \mathfractioncode }
356\untraced\protected\def\mathradical {\mathatom \s!class \mathradicalcode }
357\untraced\protected\def\mathmiddle {\mathatom \s!class \mathmiddlecode }
358\untraced\protected\def\mathaccent {\mathatom \s!class \mathaccentcode }
359\untraced\protected\def\mathfenced {\mathatom \s!class \mathfencedcode }
360\untraced\protected\def\mathghost {\mathatom \s!class \mathghostcode }
361\untraced\protected\def\mathvariable {\mathatom \s!class \mathvariablecode }
362\untraced\protected\def\mathactive {\mathatom \s!class \mathactivecode }
363\untraced\protected\def\mathvcenter {\mathatom \s!class \mathvcentercode }
364\untraced\protected\def\mathimaginary {\mathatom \s!class \mathimaginarycode }
365\untraced\protected\def\mathdifferential{\mathatom \s!class \mathdifferentialcode}
366\untraced\protected\def\mathexponential {\mathatom \s!class \mathexponentialcode }
367
368
369\untraced\protected\def\mathdigit {\mathatom \s!class \mathdigitcode }
370
371\untraced\protected\def\mathdivision {\mathatom \s!class \mathdivisioncode }
372\untraced\protected\def\mathfactorial {\mathatom \s!class \mathfactorialcode }
373\untraced\protected\def\mathwrapped {\mathatom \s!class \mathwrappedcode }
374\untraced\protected\def\mathconstruct {\mathatom \s!class \mathconstructcode }
375\untraced\protected\def\mathchemicalbond{\mathatom \s!class \mathchemicalbondcode}
376\untraced\protected\def\mathimplication {\mathatom \s!class \mathimplicationcode }
377\untraced\protected\def\mathdimension {\mathatom \s!class \mathdimensioncode }
378
379
380\untraced\protected\def\mathunary {\mathatom \s!class \mathunarycode }
381
382\popoverloadmode
383
384
385
386\setnewconstant\mathboxcode \zerocount
387\setnewconstant\mathchoicecode \zerocount
388\setnewconstant\mathalphacode \zerocount
389\setnewconstant\mathnothingcode \zerocount
390
391
392
393
394\pushoverloadmode
395 \untraced\permanent\protected\def\binoppenalty {\setmathpostpenalty\mathbinarycode}
396 \untraced\permanent\protected\def\prebinoppenalty{\setmathprepenalty \mathbinarycode}
397 \untraced\permanent\protected\def\relpenalty {\setmathpostpenalty\mathrelationcode}
398 \untraced\permanent\protected\def\prerelpenalty {\setmathprepenalty \mathrelationcode}
399\popoverloadmode
400
401
402
403
404
405
406
407
408
409\setmathignore\Umathspacebeforescript\zerocount
410\setmathignore\Umathspaceafterscript \zerocount
411
412
413
414
415
416
417
418
419
420
421
422
423\mathslackmode \plusone
424\mathgroupingmode \plusone
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440\integerdef\defaultmathclassoptions\numexpr
441 \zerocount
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462\relax
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492\preshortinlinepenalty 150
493
494\appendtoks
495 \shortinlinemaththreshold\emwidth
496\to \everybodyfont
497
498
499
500\permanent\protected\untraced\def\setmathoption
501 {\afterassigned
502 {\afterassigned
503 {\scratchcounter\setmathoptions\scratchcounterone
504 \bitwiseflip\scratchcounter\scratchcountertwo
505 \setmathoptions\scratchcounterone\scratchcounter}
506 \scratchcountertwo}
507 \scratchcounterone}
508
509\permanent\protected\untraced\def\resetmathoption
510 {\afterassigned
511 {\afterassigned
512 {\scratchcounter\setmathoptions\scratchcounterone
513 \bitwiseflip\scratchcounter\scratchcountertwo
514 \setmathoptions\scratchcounterone\scratchcounter}
515 \scratchcountertwo}
516 \scratchcounterone}
517
518
519
520
521
522
523\setmathoptions\mathordinarycode\numexpr
524 \zerocount
525 \noitaliccorrectionclassoptioncode
526
527 \checkkernpairclassoptioncode
528
529 \shortinlineclassoptioncode
530\relax
531
532\setmathoptions\mathoperatorcode\numexpr
533 \zerocount
534 \nopreslackclassoptioncode
535 \nopostslackclassoptioncode
536
537 \checkkernpairclassoptioncode
538\relax
539
540\setmathoptions\mathintegralcode\numexpr
541 \zerocount
542 \nopreslackclassoptioncode
543 \nopostslackclassoptioncode
544
545 \checkkernpairclassoptioncode
546\relax
547
548
549
550
551
552
553
554
555
556
557
558
559
560\setmathoptions\mathbinarycode\numexpr
561 \zerocount
562 \nopreslackclassoptioncode
563 \nopostslackclassoptioncode
564 \lookaheadforendclassoptioncode
565 \noitaliccorrectionclassoptioncode
566
567 \checkkernpairclassoptioncode
568
569 \obeynestingclassoptioncode
570 \shortinlineclassoptioncode
571\relax
572
573\setmathoptions\mathrelationcode\numexpr
574 \zerocount
575 \nopreslackclassoptioncode
576 \nopostslackclassoptioncode
577 \noitaliccorrectionclassoptioncode
578
579 \checkkernpairclassoptioncode
580
581
582 \obeynestingclassoptioncode
583 \shortinlineclassoptioncode
584\relax
585
586\setmathoptions\mathimplicationcode\numexpr
587 \zerocount
588 \nopreslackclassoptioncode
589 \nopostslackclassoptioncode
590 \noitaliccorrectionclassoptioncode
591
592 \checkkernpairclassoptioncode
593
594
595 \obeynestingclassoptioncode
596 \shortinlineclassoptioncode
597\relax
598
599\setmathoptions\mathopencode\numexpr
600 \zerocount
601 \nopreslackclassoptioncode
602
603 \noitaliccorrectionclassoptioncode
604
605
606 \checkkernpairclassoptioncode
607 \pushnestingclassoptioncode
608 \shortinlineclassoptioncode
609\relax
610
611\setmathoptions\mathclosecode\numexpr
612 \zerocount
613
614 \nopostslackclassoptioncode
615 \noitaliccorrectionclassoptioncode
616
617
618 \checkkernpairclassoptioncode
619 \raiseprimeclassoptioncode
620 \popnestingclassoptioncode
621 \shortinlineclassoptioncode
622\relax
623
624\setmathoptions\mathpunctuationcode\numexpr
625 \zerocount
626 \nopreslackclassoptioncode
627 \nopostslackclassoptioncode
628 \noitaliccorrectionclassoptioncode
629
630
631 \checkkernpairclassoptioncode
632 \removeitaliccorrectionclassoptioncode
633 \obeynestingclassoptioncode
634 \shortinlineclassoptioncode
635\relax
636
637\setmathoptions\mathvariablecode\numexpr
638 \zerocount
639 \noitaliccorrectionclassoptioncode
640 \shortinlineclassoptioncode
641\relax
642
643\setmathoptions\mathactivecode\numexpr
644 \zerocount
645 \noitaliccorrectionclassoptioncode
646\relax
647
648
649
650
651
652
653\setmathoptions\mathmiddlecode\numexpr
654 \zerocount
655 \noitaliccorrectionclassoptioncode
656
657 \raiseprimeclassoptioncode
658 \carryoverlefttopkernclassoptioncode
659 \carryoverleftbottomkernclassoptioncode
660 \carryoverrighttopkernclassoptioncode
661 \carryoverrightbottomkernclassoptioncode
662 \preferdelimiterdimensionsclassoptioncode
663\relax
664
665\setmathoptions\mathfractioncode\numexpr
666 \zerocount
667 \nopreslackclassoptioncode
668 \nopostslackclassoptioncode
669 \raiseprimeclassoptioncode
670 \carryoverlefttopkernclassoptioncode
671 \carryoverleftbottomkernclassoptioncode
672 \carryoverrighttopkernclassoptioncode
673 \carryoverrightbottomkernclassoptioncode
674 \preferdelimiterdimensionsclassoptioncode
675 \shortinlineclassoptioncode
676\relax
677
678\setmathoptions\mathradicalcode\numexpr
679 \zerocount
680 \nopreslackclassoptioncode
681 \nopostslackclassoptioncode
682 \raiseprimeclassoptioncode
683 \carryoverlefttopkernclassoptioncode
684 \carryoverleftbottomkernclassoptioncode
685 \carryoverrighttopkernclassoptioncode
686 \carryoverrightbottomkernclassoptioncode
687 \preferdelimiterdimensionsclassoptioncode
688 \shortinlineclassoptioncode
689\relax
690
691\setmathoptions\mathaccentcode\numexpr
692 \zerocount
693 \nopreslackclassoptioncode
694 \nopostslackclassoptioncode
695 \autoinjectclassoptioncode
696 \shortinlineclassoptioncode
697 \lefttopkernclassoptioncode
698 \leftbottomkernclassoptioncode
699 \righttopkernclassoptioncode
700 \rightbottomkernclassoptioncode
701\relax
702
703
704
705\setmathoptions\mathdivisioncode\numexpr
706 \zerocount
707 \nopreslackclassoptioncode
708 \nopostslackclassoptioncode
709 \lefttopkernclassoptioncode
710
711
712 \rightbottomkernclassoptioncode
713 \shortinlineclassoptioncode
714\relax
715
716\setmathoptions\mathbegincode\numexpr
717 \zerocount
718 \nopostslackclassoptioncode
719\relax
720
721\setmathoptions\mathendcode\numexpr
722 \zerocount
723 \nopreslackclassoptioncode
724\relax
725
726
727
728
729
730\setmathoptions\mathfencedcode\numexpr
731 \zerocount
732 \unpackclassoptioncode
733 \carryoverlefttopkernclassoptioncode
734 \carryoverleftbottomkernclassoptioncode
735 \carryoverrighttopkernclassoptioncode
736 \carryoverrightbottomkernclassoptioncode
737 \preferdelimiterdimensionsclassoptioncode
738\relax
739
740
741
742\setmathoptions\mathexponentialcode\numexpr
743 \zerocount
744 \shortinlineclassoptioncode
745\relax
746
747\setmathoptions\mathimaginarycode\numexpr
748 \zerocount
749 \shortinlineclassoptioncode
750\relax
751
752\setmathoptions\mathdifferentialcode\numexpr
753 \zerocount
754 \shortinlineclassoptioncode
755\relax
756
757\setmathoptions\mathdigitcode\numexpr
758 \zerocount
759 \shortinlineclassoptioncode
760\relax
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779\permanent\protected\def\math_discretionary_plus {\discretionary class \mathbinarycode {$$}{$$}{$$}}
780\permanent\protected\def\math_discretionary_minus{\discretionary class \mathbinarycode {$$}{$$}{$$}}
781
782\newtoks\everymathdiscretionaries
783
784\appendtoks
785 \enforced\let\+\math_discretionary_plus
786 \enforced\let\-\math_discretionary_minus
787\to \everymathdiscretionaries
788
789\appendtoks
790 \ifconditional\c_math_discretionaries
791 \expand\everymathdiscretionaries
792 \fi
793\to \everymathematics
794
795\newconditional\c_math_discretionaries
796
797\installtexexperiment
798 {mathematics.discretionaries}
799 {\c_math_discretionaries\conditionaltrue}
800 {\c_math_discretionaries\conditionalfalse}
801
802
803
804\permanent\protected\def\dimension#1
805 {\mathematics
806 {\mathatom
807 \s!leftclass \mathdimensioncode
808 \s!rightclass \mathordinarycode
809 {\tf #1}}}
810
811\permanent\protected\def\nodimension#1
812 {#1}
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828\appendtoks
829 \advanceby\mathnestinglevel\plusone
830\to \everymathematics
831
832
833
834\definesystemattribute[mathalphabet] [public]
835
836\definesystemattribute[mathpunctuation][public]
837\definesystemattribute[mathgreek] [public]
838\definesystemattribute[mathalternate] [public]
839\definesystemattribute[mathrendering] [public]
840\definesystemattribute[mathcategory] [public]
841\definesystemattribute[mathmode] [public]
842
843\definesystemattribute[mathkernpairs] [public]
844\definesystemattribute[mathbidi] [public]
845\definesystemattribute[mathdomain] [public]
846\definesystemattribute[mathcollapsing] [public]
847\definesystemattribute[mathunstack] [public]
848\definesystemattribute[mathvariant] [public]
849\definesystemattribute[mathnumbers] [public]
850\definesystemattribute[mathspacing] [public]
851\definesystemattribute[mathfencing] [public]
852\definesystemattribute[mathintervals] [public]
853
854
855
856
857
858
859
860
861
862\ifdefined\ordlimits\else
863 \let\ordlimits\Umathlimits
864\fi
865
866\appendtoks
867 \c_attr_mathmode\plusone
868\to \everydisplay
869
870\appendtoks
871 \c_attr_mathmode\plusone
872\to \everybeforedisplayformula
873
874
875
876
877
878\newconditional\indisplaymath
879
880\appendtoks
881 \indisplaymath\conditionalfalse
882\to \everymath
883
884\appendtoks
885 \indisplaymath\conditionaltrue
886\to \everydisplay
887
888
889
890
891
892\permanent\def\inlineordisplaymath{\ifconditional\indisplaymath\expandafter\secondoftwoarguments\else\expandafter\firstoftwoarguments\fi}
893
894\permanent\protected\def\forcedisplaymath
895 {\ifmmode
896 \displaystyle
897 \indisplaymath\conditionaltrue
898 \fi}
899
900\permanent\protected\def\forceinlinemath
901 {\ifmmode
902 \textstyle
903 \indisplaymath\conditionalfalse
904 \fi}
905
906\permanent\protected\def\startforceddisplaymath
907 {\Ustartmathmode\displaystyle
908 \begingroup
909 \indisplaymath\conditionaltrue
910 \expand\everyinsidemathematics\relax
911}
912
913\permanent\protected\def\stopforceddisplaymath
914 {\endgroup
915 \Ustopmathmode}
916
917\permanent\protected\def\startpickupmath
918 {\ifconditional\indisplaymath
919 \startforceddisplaymath
920 \enforced\let\stoppickupmath\stopforceddisplaymath
921 \else
922 \startimath
923 \enforced\let\stoppickupmath\stopimath
924 \fi}
925
926\aliased\let\stoppickupmath\relax
927
928\permanent\protected\def\rawmathematics#1
929 {\begingroup
930 \ifmmode
931 \resetmathattributes#1
932 \else
933 \startimath\resetmathattributes#1\stopimath
934 \fi
935 \endgroup}
936
937
938
939
940
941
942
943
944
945
946
947
948
949\installcorenamespace{mathematics}
950
951\installswitchcommandhandler \??mathematics {mathematics} \??mathematics
952
953\installmacrostack\currentmathematics
954
955\permanent\protected\tolerant\def\startmathematics[#1]
956 {\push_macro_currentmathematics
957 \cdef\currentmathematics{#1}
958 \expand\everyswitchmathematics}
959
960\permanent\protected\def\stopmathematics
961 {\pop_macro_currentmathematics
962 \expand\everyswitchmathematics}
963
964\definemathematics[\v!default]
965
966
967
968\pushoverloadmode
969 \permanent\protected\def\mathematics{\doifelsenextoptionalcs\math_m_yes\math_m_nop}
970
971 \aliased\let\m \mathematics
972 \aliased\let\math\mathematics
973\popoverloadmode
974
975\def\math_m_yes
976 {\relax
977 \ifmmode
978 \expandafter\math_m_yes_math
979 \else
980 \expandafter\math_m_yes_text
981 \fi}
982
983\def\math_m_yes_math[#1]#2
984 {#2}
985
986\def\math_m_yes_text[#S#1]
987 {\begingroup
988 \ifhastok={#1}
989 \setupcurrentmathematics[#1]
990 \else
991 \cdef\currentmathematics{#1}
992 \fi
993 \expand\everyswitchmathematics
994 \usemathematicscolorparameter\c!color
995 \ifcstok{\mathematicsparameter\c!openup}\v!yes
996 \expandafter\math_m_yes_text_openedup
997 \else
998 \expandafter\math_m_yes_text_normal
999 \fi}
1000
1001\def\math_m_yes_text_openedup#1
1002 {\setbox\scratchbox\hbox\bgroup
1003 \expand\everyswitchmathematics\relax
1004 \Ustartmathmode\expandedmathstyleparameter\mathematicsparameter\c!mathstyle
1005 \math_style_set_main
1006 \expand\everyinsidemathematics\relax
1007 #1
1008 \Ustopmathmode
1009 \egroup
1010 \ifdim\ht\scratchbox>\strutht
1011 \math_inline_openup_start_yes
1012 \orelse\ifdim\dp\scratchbox>\strutdp
1013 \math_inline_openup_start_yes
1014 \else
1015 \math_inline_openup_start_nop
1016 \fi
1017 \unhbox\scratchbox
1018 \math_inline_openup_stop
1019 \endgroup}
1020
1021\def\math_m_yes_text_normal#1
1022 {\expand\everyswitchmathematics\relax
1023 \Ustartmathmode\expandedmathstyleparameter\mathematicsparameter\c!mathstyle
1024 \math_style_set_main
1025 \expand\everyinsidemathematics\relax
1026 \begingroup#1\endgroup
1027 \Ustopmathmode
1028 \endgroup}
1029
1030\def\math_m_nop#1
1031 {\relax
1032 \ifmmode
1033 #1
1034 \else
1035 \normalstartimath
1036 \usemathstyleparameter\mathematicsparameter\c!mathstyle
1037 \expand\everyinsidemathematics\relax
1038 \begingroup#1\endgroup
1039 \normalstopimath
1040 \fi}
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051\let\math_trace_blobs\relax
1052
1053\def\math_trace_blobs_indeed_yes
1054 {\markblobindexdone{\currentlanguage}\scratchcounter
1055 \normalexpanded{\csname\v!mathnote\endcsname
1056 [\v!mathnote:\currentlanguage:\the\scratchcounter]
1057 {\definedfont[\s!MathRoman]\getmathtextblob{\currentlanguage}\the\currentmathblob}}}
1058
1059\def\math_trace_blobs_indeed_nop
1060 {\normalexpanded{\note[\v!mathnote:\currentlanguage:\the\scratchcounter]}}
1061
1062\protected\def\math_trace_blobs_indeed
1063 {\dontleavehmode
1064 \hbox to \zeropoint \bgroup
1065 \resetinteractioncontrastcolor
1066 \resetinteractionstyle
1067 \scratchcounter\getmathblobindex\currentmathblob
1068 \bgroup
1069 \darkgray
1070 \vrule \s!height .9\strutht \s!depth .9\strutdp \s!width \onepoint \relax
1071 \hbox to \zeropoint \bgroup
1072 \smallinfofont
1073 \the\currentmathblob\hss
1074 \hbox to \zeropoint \s!yoffset .8\strutdp \bgroup
1075 \currentlanguage
1076 \ifconditional\c_strc_tags_global
1077 \space
1078 \tohexadecimal\getmathblobmapping\currentmathblob
1079 \fi
1080 \hss
1081 \egroup
1082 \egroup
1083 \egroup
1084 \ifinsidefloat
1085 \math_trace_blobs_indeed_yes
1086 \orelse\ifblobindexdone{\currentlanguage}\scratchcounter
1087 \math_trace_blobs_indeed_nop
1088 \else
1089 \math_trace_blobs_indeed_yes
1090 \fi
1091 \hss
1092 \egroup}
1093
1094\protected\def\math_trace_blobs_checked
1095 {\iftrialtypesetting
1096
1097 \orelse\ifnum\currentmathblobnesting<\zerocount\else
1098 \aftergroup\math_trace_blobs_indeed
1099 \fi}
1100
1101\installtextracker
1102 {math.textblobs}
1103 {\let\math_trace_blobs\math_trace_blobs_checked}
1104 {\let\math_trace_blobs\relax}
1105
1106\appendtoks
1107 \math_trace_blobs
1108\to \everymathematics
1109
1110\permanent\protected\def\dm#1
1111 {\relax
1112 \ifmmode
1113
1114
1115 \mathconstruct{\displaystyle\indisplaymath\conditionaltrue#1}
1116 \else
1117
1118 \Ustartmathmode\displaystyle
1119 \indisplaymath\conditionaltrue
1120 \expand\everyinsidemathematics\relax
1121 #1
1122 \Ustopmathmode
1123 \fi}
1124
1125\permanent\protected\def\im#1
1126 {\relax
1127 \ifmmode
1128
1129
1130 \mathconstruct{\textstyle\indisplaymath\conditionalfalse#1}
1131 \else
1132
1133 \Ustartmathmode\textstyle
1134 \indisplaymath\conditionalfalse
1135 \expand\everyinsidemathematics\relax
1136 #1
1137 \Ustopmathmode
1138 \fi}
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149\startsetups math:spacing:default
1150 \thickmuskip \defaultthickmuskip
1151 \medmuskip \defaultmedmuskip
1152 \thinmuskip \defaultthinmuskip
1153 \tinymuskip \defaulttinymuskip
1154 \pettymuskip \defaultpettymuskip
1155 \relpenalty \defaultrelpenalty
1156 \binoppenalty \defaultbinoppenalty
1157 \prebinoppenalty\maxdimen
1158 \prerelpenalty \maxdimen
1159\stopsetups
1160
1161\startsetups math:spacing:split
1162 \thickmuskip \defaultthickmuskip
1163 \medmuskip \defaultmedmuskip
1164 \thinmuskip \defaultthinmuskip
1165 \tinymuskip \defaulttinymuskip
1166 \pettymuskip \defaultpettymuskip
1167 \relpenalty \defaultrelpenalty
1168 \binoppenalty \defaultbinoppenalty
1169 \prebinoppenalty\defaultprebinoppenalty
1170 \prerelpenalty \defaultprerelpenalty
1171\stopsetups
1172
1173\startsetups math:spacing:half
1174 \thickmuskip \halfthickmuskip
1175 \medmuskip \halfmedmuskip
1176 \thinmuskip \halfthinmuskip
1177 \tinymuskip \halftinymuskip
1178 \pettymuskip \halfpettymuskip
1179 \relpenalty \defaultrelpenalty
1180 \binoppenalty \defaultbinoppenalty
1181 \prebinoppenalty\maxdimen
1182 \prerelpenalty \maxdimen
1183\stopsetups
1184
1185\startsetups math:spacing:tight
1186 \ifcase\raggedstatus
1187 \thickmuskip \halfthickmuskip
1188 \medmuskip \halfmedmuskip
1189 \thinmuskip \halfthinmuskip
1190 \tinymuskip \halftinymuskip
1191 \pettymuskip \halfpettymuskip
1192 \else
1193 \thickmuskip 1\halfthickmuskip
1194 \medmuskip 1\halfmedmuskip
1195 \thinmuskip 1\halfthinmuskip
1196 \tinymuskip 1\halftinymuskip
1197 \pettymuskip 1\halfpettymuskip
1198 \fi
1199 \relpenalty \defaultrelpenalty
1200 \binoppenalty \maxdimen
1201 \prebinoppenalty\maxdimen
1202 \prerelpenalty \maxdimen
1203\stopsetups
1204
1205\startsetups math:spacing:fixed
1206 \ifcase\raggedstatus
1207 \thickmuskip \halfthickmuskip
1208 \medmuskip \halfmedmuskip
1209 \thinmuskip \halfthinmuskip
1210 \tinymuskip \halftinymuskip
1211 \pettymuskip \halfpettymuskip
1212 \else
1213 \thickmuskip 1\halfthickmuskip
1214 \medmuskip 1\halfmedmuskip
1215 \thinmuskip 1\halfthinmuskip
1216 \tinymuskip 1\halftinymuskip
1217 \pettymuskip 1\halfpettymuskip
1218 \fi
1219 \relpenalty \maxdimen
1220 \binoppenalty \maxdimen
1221 \prebinoppenalty\maxdimen
1222 \prerelpenalty \maxdimen
1223\stopsetups
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239\newmuskip\mathinterwordmuskip
1240
1241
1242
1243
1244
1245
1246
1247
1248\mathinterwordmuskip 18mu
1249
1250\permanent\protected\def\mtp#1{\mathatom class \mathtextpunctuationcode {\hbox{#1}}}
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268\startsetups math:spacing:presets
1269 \resetmathspacing
1270
1271
1272 \inherited\setmathspacing \mathordinarycode \mathoperatorcode \allmathstyles \thinmuskip
1273 \inherited\setmathspacing \mathordinarycode \mathbinarycode \allsplitstyles \medmuskip
1274 \inherited\setmathspacing \mathordinarycode \mathbinarycode \allunsplitstyles \pettymuskip
1275 \inherited\setmathspacing \mathordinarycode \mathrelationcode \allsplitstyles \thickmuskip
1276 \inherited\setmathspacing \mathordinarycode \mathrelationcode \allunsplitstyles \pettymuskip
1277
1278 \inherited\setmathspacing \mathordinarycode \mathmiddlecode \allsplitstyles \thickmuskip
1279 \inherited\setmathspacing \mathordinarycode \mathmiddlecode \allunsplitstyles \pettymuskip
1280 \inherited\setmathspacing \mathordinarycode \mathclosecode \allmathstyles \fencemuskip
1281
1282 \inherited\setmathspacing \mathordinarycode \mathconstructcode \allsplitstyles \thinmuskip
1283 \inherited\setmathspacing \mathordinarycode \mathconstructcode \allunsplitstyles \pettymuskip
1284 \inherited\setmathspacing \mathordinarycode \mathellipsiscode \allsplitstyles \thinmuskip
1285 \inherited\setmathspacing \mathordinarycode \mathellipsiscode \allunsplitstyles \pettymuskip
1286 \inherited\setmathspacing \mathordinarycode \mathfractioncode \allsplitstyles \thinmuskip
1287 \inherited\setmathspacing \mathordinarycode \mathfractioncode \allunsplitstyles \pettymuskip
1288
1289
1290
1291 \inherited\setmathspacing \mathoperatorcode \mathordinarycode \allmathstyles \thinmuskip
1292 \inherited\setmathspacing \mathoperatorcode \mathoperatorcode \allmathstyles \thinmuskip
1293
1294 \inherited\setmathspacing \mathoperatorcode \mathrelationcode \allsplitstyles \thickmuskip
1295 \inherited\setmathspacing \mathoperatorcode \mathrelationcode \allunsplitstyles \pettymuskip
1296
1297 \inherited\setmathspacing \mathoperatorcode \mathmiddlecode \allsplitstyles \thickmuskip
1298 \inherited\setmathspacing \mathoperatorcode \mathmiddlecode \allunsplitstyles \pettymuskip
1299 \inherited\setmathspacing \mathoperatorcode \mathclosecode \allmathstyles \fencemuskip
1300
1301 \inherited\setmathspacing \mathoperatorcode \mathconstructcode \allsplitstyles \thinmuskip
1302 \inherited\setmathspacing \mathoperatorcode \mathconstructcode \allunsplitstyles \pettymuskip
1303 \inherited\setmathspacing \mathoperatorcode \mathellipsiscode \allsplitstyles \thinmuskip
1304 \inherited\setmathspacing \mathoperatorcode \mathellipsiscode \allunsplitstyles \pettymuskip
1305 \inherited\setmathspacing \mathoperatorcode \mathfractioncode \allsplitstyles \medmuskip
1306 \inherited\setmathspacing \mathoperatorcode \mathfractioncode \allunsplitstyles \pettymuskip
1307 \inherited\setmathspacing \mathoperatorcode \mathradicalcode \allmathstyles \thinmuskip
1308
1309 \inherited\setmathspacing \mathbinarycode \mathordinarycode \allsplitstyles \medmuskip
1310 \inherited\setmathspacing \mathbinarycode \mathordinarycode \allunsplitstyles \pettymuskip
1311 \inherited\setmathspacing \mathbinarycode \mathoperatorcode \allsplitstyles \medmuskip
1312 \inherited\setmathspacing \mathbinarycode \mathoperatorcode \allunsplitstyles \pettymuskip
1313
1314
1315 \inherited\setmathspacing \mathbinarycode \mathopencode \allsplitstyles \medmuskip
1316 \inherited\setmathspacing \mathbinarycode \mathopencode \allunsplitstyles \pettymuskip
1317 \inherited\setmathspacing \mathbinarycode \mathmiddlecode \allsplitstyles \thickmuskip
1318 \inherited\setmathspacing \mathbinarycode \mathmiddlecode \allunsplitstyles \pettymuskip
1319 \inherited\setmathspacing \mathbinarycode \mathclosecode \allmathstyles \fencemuskip
1320 \inherited\setmathspacing \mathbinarycode \mathpunctuationcode \allsplitstyles \medmuskip
1321 \inherited\setmathspacing \mathbinarycode \mathpunctuationcode \allunsplitstyles \pettymuskip
1322 \inherited\setmathspacing \mathbinarycode \mathconstructcode \allsplitstyles \medmuskip
1323 \inherited\setmathspacing \mathbinarycode \mathconstructcode \allunsplitstyles \pettymuskip
1324 \inherited\setmathspacing \mathbinarycode \mathellipsiscode \allsplitstyles \medmuskip
1325 \inherited\setmathspacing \mathbinarycode \mathellipsiscode \allunsplitstyles \pettymuskip
1326 \inherited\setmathspacing \mathbinarycode \mathfractioncode \allsplitstyles \medmuskip
1327 \inherited\setmathspacing \mathbinarycode \mathfractioncode \allunsplitstyles \pettymuskip
1328 \inherited\setmathspacing \mathbinarycode \mathradicalcode \allsplitstyles \medmuskip
1329 \inherited\setmathspacing \mathbinarycode \mathradicalcode \allunsplitstyles \pettymuskip
1330
1331 \inherited\setmathspacing \mathrelationcode \mathordinarycode \allsplitstyles \thickmuskip
1332 \inherited\setmathspacing \mathrelationcode \mathordinarycode \allunsplitstyles \pettymuskip
1333 \inherited\setmathspacing \mathrelationcode \mathoperatorcode \allsplitstyles \thickmuskip
1334 \inherited\setmathspacing \mathrelationcode \mathoperatorcode \allunsplitstyles \pettymuskip
1335
1336
1337 \inherited\setmathspacing \mathrelationcode \mathopencode \allsplitstyles \thickmuskip
1338 \inherited\setmathspacing \mathrelationcode \mathopencode \allunsplitstyles \pettymuskip
1339 \inherited\setmathspacing \mathrelationcode \mathmiddlecode \allsplitstyles \thickmuskip
1340 \inherited\setmathspacing \mathrelationcode \mathmiddlecode \allunsplitstyles \thinmuskip
1341 \inherited\setmathspacing \mathrelationcode \mathclosecode \allmathstyles \fencemuskip
1342 \inherited\setmathspacing \mathrelationcode \mathpunctuationcode \allsplitstyles \thickmuskip
1343 \inherited\setmathspacing \mathrelationcode \mathpunctuationcode \allunsplitstyles \pettymuskip
1344 \inherited\setmathspacing \mathrelationcode \mathconstructcode \allsplitstyles \thickmuskip
1345 \inherited\setmathspacing \mathrelationcode \mathconstructcode \allunsplitstyles \pettymuskip
1346 \inherited\setmathspacing \mathrelationcode \mathellipsiscode \allsplitstyles \thickmuskip
1347 \inherited\setmathspacing \mathrelationcode \mathellipsiscode \allunsplitstyles \pettymuskip
1348 \inherited\setmathspacing \mathrelationcode \mathfractioncode \allsplitstyles \thickmuskip
1349 \inherited\setmathspacing \mathrelationcode \mathfractioncode \allunsplitstyles \pettymuskip
1350 \inherited\setmathspacing \mathrelationcode \mathradicalcode \allsplitstyles \thickmuskip
1351 \inherited\setmathspacing \mathrelationcode \mathradicalcode \allunsplitstyles \pettymuskip
1352
1353 \inherited\setmathspacing \mathopencode \mathordinarycode \allmathstyles \fencemuskip
1354 \inherited\setmathspacing \mathopencode \mathoperatorcode \allmathstyles \fencemuskip
1355 \inherited\setmathspacing \mathopencode \mathbinarycode \allmathstyles \fencemuskip
1356 \inherited\setmathspacing \mathopencode \mathrelationcode \allmathstyles \fencemuskip
1357 \inherited\setmathspacing \mathopencode \mathopencode \allmathstyles \fencemuskip
1358 \inherited\setmathspacing \mathopencode \mathmiddlecode \allmathstyles \pettymuskip
1359 \inherited\setmathspacing \mathopencode \mathclosecode \allmathstyles \pettymuskip
1360 \inherited\setmathspacing \mathopencode \mathpunctuationcode \allmathstyles \pettymuskip
1361 \inherited\setmathspacing \mathopencode \mathconstructcode \allmathstyles \pettymuskip
1362 \inherited\setmathspacing \mathopencode \mathellipsiscode \allmathstyles \pettymuskip
1363 \inherited\setmathspacing \mathopencode \mathradicalcode \allmathstyles \fencemuskip
1364 \inherited\setmathspacing \mathopencode \mathfractioncode \allsplitstyles \pettymuskip
1365 \inherited\setmathspacing \mathopencode \mathfractioncode \allunsplitstyles \pettymuskip
1366
1367 \inherited\setmathspacing \mathclosecode \mathordinarycode \allmathstyles \tinymuskip
1368 \inherited\setmathspacing \mathclosecode \mathoperatorcode \allmathstyles \thinmuskip
1369 \inherited\setmathspacing \mathclosecode \mathbinarycode \allsplitstyles \medmuskip
1370 \inherited\setmathspacing \mathclosecode \mathbinarycode \allunsplitstyles \pettymuskip
1371 \inherited\setmathspacing \mathclosecode \mathrelationcode \allsplitstyles \thickmuskip
1372 \inherited\setmathspacing \mathclosecode \mathrelationcode \allunsplitstyles \pettymuskip
1373 \inherited\setmathspacing \mathclosecode \mathopencode \alltextstyles \tinymuskip
1374 \inherited\setmathspacing \mathclosecode \mathopencode \alldisplaystyles \thinmuskip
1375 \inherited\setmathspacing \mathclosecode \mathopencode \allunsplitstyles \pettymuskip
1376
1377
1378
1379
1380
1381
1382
1383 \inherited\setmathspacing \mathclosecode \mathclosecode \allmathstyles \fencemuskip
1384
1385 \inherited\setmathspacing \mathclosecode \mathconstructcode \allsplitstyles \thinmuskip
1386 \inherited\setmathspacing \mathclosecode \mathconstructcode \allunsplitstyles \pettymuskip
1387 \inherited\setmathspacing \mathclosecode \mathfactorialcode \allmathstyles \zeromuskip
1388 \inherited\setmathspacing \mathclosecode \mathellipsiscode \allsplitstyles \thinmuskip
1389 \inherited\setmathspacing \mathclosecode \mathellipsiscode \allunsplitstyles \pettymuskip
1390 \inherited\setmathspacing \mathclosecode \mathfractioncode \allsplitstyles \thinmuskip
1391 \inherited\setmathspacing \mathclosecode \mathfractioncode \allunsplitstyles \pettymuskip
1392
1393
1394 \inherited\setmathspacing \mathpunctuationcode \mathordinarycode \allsplitstyles \medmuskip
1395 \inherited\setmathspacing \mathpunctuationcode \mathordinarycode \allunsplitstyles \tinymuskip
1396 \inherited\setmathspacing \mathpunctuationcode \mathoperatorcode \allsplitstyles \medmuskip
1397 \inherited\setmathspacing \mathpunctuationcode \mathoperatorcode \allunsplitstyles \tinymuskip
1398
1399 \inherited\setmathspacing \mathpunctuationcode \mathrelationcode \allsplitstyles \medmuskip
1400 \inherited\setmathspacing \mathpunctuationcode \mathrelationcode \allunsplitstyles \tinymuskip
1401 \inherited\setmathspacing \mathpunctuationcode \mathopencode \allsplitstyles \medmuskip
1402 \inherited\setmathspacing \mathpunctuationcode \mathopencode \allunsplitstyles \tinymuskip
1403 \inherited\setmathspacing \mathpunctuationcode \mathmiddlecode \allsplitstyles \thickmuskip
1404 \inherited\setmathspacing \mathpunctuationcode \mathmiddlecode \allunsplitstyles \tinymuskip
1405 \inherited\setmathspacing \mathpunctuationcode \mathclosecode \allsplitstyles \medmuskip
1406 \inherited\setmathspacing \mathpunctuationcode \mathclosecode \allunsplitstyles \tinymuskip
1407 \inherited\setmathspacing \mathpunctuationcode \mathpunctuationcode \allsplitstyles \medmuskip
1408 \inherited\setmathspacing \mathpunctuationcode \mathpunctuationcode \allunsplitstyles \tinymuskip
1409 \inherited\setmathspacing \mathpunctuationcode \mathconstructcode \allsplitstyles \medmuskip
1410 \inherited\setmathspacing \mathpunctuationcode \mathconstructcode \allunsplitstyles \tinymuskip
1411 \inherited\setmathspacing \mathpunctuationcode \mathellipsiscode \allsplitstyles \medmuskip
1412 \inherited\setmathspacing \mathpunctuationcode \mathellipsiscode \allunsplitstyles \tinymuskip
1413 \inherited\setmathspacing \mathpunctuationcode \mathfractioncode \allsplitstyles \medmuskip
1414 \inherited\setmathspacing \mathpunctuationcode \mathfractioncode \allunsplitstyles \tinymuskip
1415 \inherited\setmathspacing \mathpunctuationcode \mathradicalcode \allsplitstyles \medmuskip
1416 \inherited\setmathspacing \mathpunctuationcode \mathradicalcode \allunsplitstyles \tinymuskip
1417
1418 \inherited\setmathspacing \mathconstructcode \mathordinarycode \allsplitstyles \thinmuskip
1419 \inherited\setmathspacing \mathconstructcode \mathordinarycode \allunsplitstyles \pettymuskip
1420 \inherited\setmathspacing \mathconstructcode \mathoperatorcode \allmathstyles \thinmuskip
1421 \inherited\setmathspacing \mathconstructcode \mathbinarycode \allsplitstyles \medmuskip
1422 \inherited\setmathspacing \mathconstructcode \mathbinarycode \allunsplitstyles \pettymuskip
1423 \inherited\setmathspacing \mathconstructcode \mathrelationcode \allsplitstyles \thickmuskip
1424 \inherited\setmathspacing \mathconstructcode \mathrelationcode \allunsplitstyles \pettymuskip
1425 \inherited\setmathspacing \mathconstructcode \mathopencode \allsplitstyles \thinmuskip
1426 \inherited\setmathspacing \mathconstructcode \mathopencode \allunsplitstyles \pettymuskip
1427 \inherited\setmathspacing \mathconstructcode \mathmiddlecode \allsplitstyles \thickmuskip
1428 \inherited\setmathspacing \mathconstructcode \mathmiddlecode \allunsplitstyles \pettymuskip
1429 \inherited\setmathspacing \mathconstructcode \mathclosecode \allmathstyles \pettymuskip
1430 \inherited\setmathspacing \mathconstructcode \mathpunctuationcode \allsplitstyles \thinmuskip
1431 \inherited\setmathspacing \mathconstructcode \mathpunctuationcode \allunsplitstyles \pettymuskip
1432 \inherited\setmathspacing \mathconstructcode \mathconstructcode \allsplitstyles \thinmuskip
1433 \inherited\setmathspacing \mathconstructcode \mathconstructcode \allunsplitstyles \pettymuskip
1434 \inherited\setmathspacing \mathconstructcode \mathfractioncode \allsplitstyles \thinmuskip
1435 \inherited\setmathspacing \mathconstructcode \mathfractioncode \allunsplitstyles \pettymuskip
1436 \inherited\setmathspacing \mathconstructcode \mathradicalcode \allsplitstyles \thinmuskip
1437 \inherited\setmathspacing \mathconstructcode \mathradicalcode \allunsplitstyles \pettymuskip
1438
1439 \inherited\setmathspacing \mathellipsiscode \mathordinarycode \allsplitstyles \thinmuskip
1440 \inherited\setmathspacing \mathellipsiscode \mathordinarycode \allunsplitstyles \pettymuskip
1441 \inherited\setmathspacing \mathellipsiscode \mathoperatorcode \allmathstyles \thinmuskip
1442 \inherited\setmathspacing \mathellipsiscode \mathbinarycode \allsplitstyles \medmuskip
1443 \inherited\setmathspacing \mathellipsiscode \mathbinarycode \allunsplitstyles \pettymuskip
1444 \inherited\setmathspacing \mathellipsiscode \mathrelationcode \allsplitstyles \thickmuskip
1445 \inherited\setmathspacing \mathellipsiscode \mathrelationcode \allunsplitstyles \pettymuskip
1446 \inherited\setmathspacing \mathellipsiscode \mathopencode \allsplitstyles \thinmuskip
1447 \inherited\setmathspacing \mathellipsiscode \mathopencode \allunsplitstyles \pettymuskip
1448 \inherited\setmathspacing \mathellipsiscode \mathmiddlecode \allsplitstyles \thickmuskip
1449 \inherited\setmathspacing \mathellipsiscode \mathmiddlecode \allunsplitstyles \pettymuskip
1450 \inherited\setmathspacing \mathellipsiscode \mathclosecode \allmathstyles \pettymuskip
1451 \inherited\setmathspacing \mathellipsiscode \mathpunctuationcode \allsplitstyles \thinmuskip
1452 \inherited\setmathspacing \mathellipsiscode \mathpunctuationcode \allunsplitstyles \pettymuskip
1453 \inherited\setmathspacing \mathellipsiscode \mathconstructcode \allsplitstyles \thinmuskip
1454 \inherited\setmathspacing \mathellipsiscode \mathconstructcode \allunsplitstyles \pettymuskip
1455 \inherited\setmathspacing \mathellipsiscode \mathellipsiscode \allsplitstyles \thinmuskip
1456 \inherited\setmathspacing \mathellipsiscode \mathellipsiscode \allunsplitstyles \pettymuskip
1457 \inherited\setmathspacing \mathellipsiscode \mathfractioncode \allsplitstyles \thinmuskip
1458 \inherited\setmathspacing \mathellipsiscode \mathfractioncode \allunsplitstyles \pettymuskip
1459 \inherited\setmathspacing \mathellipsiscode \mathradicalcode \allsplitstyles \thinmuskip
1460 \inherited\setmathspacing \mathellipsiscode \mathradicalcode \allunsplitstyles \pettymuskip
1461
1462 \inherited\setmathspacing \mathfractioncode \mathordinarycode \allsplitstyles \thinmuskip
1463 \inherited\setmathspacing \mathfractioncode \mathordinarycode \allunsplitstyles \pettymuskip
1464 \inherited\setmathspacing \mathfractioncode \mathoperatorcode \allsplitstyles \medmuskip
1465 \inherited\setmathspacing \mathfractioncode \mathoperatorcode \allunsplitstyles \pettymuskip
1466 \inherited\setmathspacing \mathfractioncode \mathbinarycode \allsplitstyles \medmuskip
1467 \inherited\setmathspacing \mathfractioncode \mathbinarycode \allunsplitstyles \pettymuskip
1468 \inherited\setmathspacing \mathfractioncode \mathrelationcode \allsplitstyles \thickmuskip
1469 \inherited\setmathspacing \mathfractioncode \mathrelationcode \allunsplitstyles \pettymuskip
1470 \inherited\setmathspacing \mathfractioncode \mathopencode \allsplitstyles \thinmuskip
1471 \inherited\setmathspacing \mathfractioncode \mathopencode \allunsplitstyles \pettymuskip
1472 \inherited\setmathspacing \mathfractioncode \mathmiddlecode \allsplitstyles \thickmuskip
1473 \inherited\setmathspacing \mathfractioncode \mathmiddlecode \allunsplitstyles \pettymuskip
1474 \inherited\setmathspacing \mathfractioncode \mathclosecode \allmathstyles \pettymuskip
1475
1476 \inherited\setmathspacing \mathfractioncode \mathpunctuationcode \allsplitstyles \tinymuskip
1477 \inherited\setmathspacing \mathfractioncode \mathpunctuationcode \allunsplitstyles \pettymuskip
1478 \inherited\setmathspacing \mathfractioncode \mathtextpunctuationcode \allmathstyles \tinymuskip
1479 \inherited\setmathspacing \mathfractioncode \mathconstructcode \allsplitstyles \thinmuskip
1480 \inherited\setmathspacing \mathfractioncode \mathconstructcode \allunsplitstyles \pettymuskip
1481 \inherited\setmathspacing \mathfractioncode \mathellipsiscode \allsplitstyles \thinmuskip
1482 \inherited\setmathspacing \mathfractioncode \mathellipsiscode \allunsplitstyles \pettymuskip
1483 \inherited\setmathspacing \mathfractioncode \mathfractioncode \allsplitstyles \thinmuskip
1484 \inherited\setmathspacing \mathfractioncode \mathfractioncode \allunsplitstyles \pettymuskip
1485 \inherited\setmathspacing \mathfractioncode \mathradicalcode \allsplitstyles \thinmuskip
1486 \inherited\setmathspacing \mathfractioncode \mathradicalcode \allunsplitstyles \pettymuskip
1487 \inherited\setmathspacing \mathfractioncode \mathdifferentialcode \allsplitstyles \medmuskip
1488 \inherited\setmathspacing \mathfractioncode \mathdifferentialcode \allunsplitstyles \pettymuskip
1489
1490 \inherited\setmathspacing \mathradicalcode \mathordinarycode \allsplitstyles \tinymuskip
1491 \inherited\setmathspacing \mathradicalcode \mathordinarycode \allunsplitstyles \pettymuskip
1492 \inherited\setmathspacing \mathradicalcode \mathoperatorcode \allmathstyles \thinmuskip
1493 \inherited\setmathspacing \mathradicalcode \mathbinarycode \allsplitstyles \medmuskip
1494 \inherited\setmathspacing \mathradicalcode \mathbinarycode \allunsplitstyles \pettymuskip
1495 \inherited\setmathspacing \mathradicalcode \mathrelationcode \allsplitstyles \thickmuskip
1496 \inherited\setmathspacing \mathradicalcode \mathrelationcode \allunsplitstyles \pettymuskip
1497
1498 \inherited\setmathspacing \mathradicalcode \mathmiddlecode \allsplitstyles \thickmuskip
1499 \inherited\setmathspacing \mathradicalcode \mathmiddlecode \allunsplitstyles \pettymuskip
1500 \inherited\setmathspacing \mathradicalcode \mathclosecode \allmathstyles \pettymuskip
1501 \inherited\setmathspacing \mathradicalcode \mathpunctuationcode \allsplitstyles \pettymuskip
1502 \inherited\setmathspacing \mathradicalcode \mathpunctuationcode \allunsplitstyles \tinymuskip
1503 \inherited\setmathspacing \mathradicalcode \mathconstructcode \allsplitstyles \thinmuskip
1504 \inherited\setmathspacing \mathradicalcode \mathconstructcode \allunsplitstyles \pettymuskip
1505 \inherited\setmathspacing \mathradicalcode \mathellipsiscode \allsplitstyles \thinmuskip
1506 \inherited\setmathspacing \mathradicalcode \mathellipsiscode \allunsplitstyles \pettymuskip
1507 \inherited\setmathspacing \mathradicalcode \mathfractioncode \allsplitstyles \tinymuskip
1508 \inherited\setmathspacing \mathradicalcode \mathfractioncode \allunsplitstyles \pettymuskip
1509 \inherited\setmathspacing \mathradicalcode \mathradicalcode \allsplitstyles \thinmuskip
1510 \inherited\setmathspacing \mathradicalcode \mathradicalcode \allunsplitstyles \pettymuskip
1511
1512 \inherited\setmathspacing \mathmiddlecode \mathordinarycode \allsplitstyles \thickmuskip
1513 \inherited\setmathspacing \mathmiddlecode \mathordinarycode \allunsplitstyles \pettymuskip
1514 \inherited\setmathspacing \mathmiddlecode \mathoperatorcode \allmathstyles \thickmuskip
1515 \inherited\setmathspacing \mathmiddlecode \mathbinarycode \allsplitstyles \medmuskip
1516 \inherited\setmathspacing \mathmiddlecode \mathbinarycode \allunsplitstyles \pettymuskip
1517 \inherited\setmathspacing \mathmiddlecode \mathrelationcode \allsplitstyles \thickmuskip
1518 \inherited\setmathspacing \mathmiddlecode \mathrelationcode \allunsplitstyles \pettymuskip
1519 \inherited\setmathspacing \mathmiddlecode \mathopencode \allsplitstyles \thickmuskip
1520 \inherited\setmathspacing \mathmiddlecode \mathopencode \allscriptstyles \pettymuskip
1521 \inherited\setmathspacing \mathmiddlecode \mathmiddlecode \allsplitstyles \thickmuskip
1522 \inherited\setmathspacing \mathmiddlecode \mathmiddlecode \allunsplitstyles \pettymuskip
1523 \inherited\setmathspacing \mathmiddlecode \mathclosecode \allsplitstyles \thickmuskip
1524 \inherited\setmathspacing \mathmiddlecode \mathclosecode \allunsplitstyles \pettymuskip
1525 \inherited\setmathspacing \mathmiddlecode \mathpunctuationcode \allsplitstyles \thickmuskip
1526 \inherited\setmathspacing \mathmiddlecode \mathpunctuationcode \allunsplitstyles \pettymuskip
1527 \inherited\setmathspacing \mathmiddlecode \mathconstructcode \allsplitstyles \thickmuskip
1528 \inherited\setmathspacing \mathmiddlecode \mathconstructcode \allunsplitstyles \pettymuskip
1529 \inherited\setmathspacing \mathmiddlecode \mathellipsiscode \allsplitstyles \thickmuskip
1530 \inherited\setmathspacing \mathmiddlecode \mathellipsiscode \allunsplitstyles \pettymuskip
1531 \inherited\setmathspacing \mathmiddlecode \mathfractioncode \allsplitstyles \thickmuskip
1532 \inherited\setmathspacing \mathmiddlecode \mathfractioncode \allunsplitstyles \pettymuskip
1533 \inherited\setmathspacing \mathmiddlecode \mathradicalcode \allsplitstyles \thickmuskip
1534 \inherited\setmathspacing \mathmiddlecode \mathradicalcode \allmathstyles \pettymuskip
1535
1536 \inherited\setmathspacing \mathclosecode \mathdifferentialcode \allsplitstyles \thinmuskip
1537 \inherited\setmathspacing \mathclosecode \mathdifferentialcode \allunsplitstyles \pettymuskip
1538 \inherited\setmathspacing \mathordinarycode \mathdifferentialcode \allsplitstyles \thinmuskip
1539 \inherited\setmathspacing \mathordinarycode \mathdifferentialcode \allunsplitstyles \pettymuskip
1540 \inherited\setmathspacing \mathfactorialcode \mathordinarycode \allsplitstyles \thinmuskip
1541 \inherited\setmathspacing \mathfactorialcode \mathordinarycode \allunsplitstyles \pettymuskip
1542 \inherited\setmathspacing \mathfactorialcode \mathfactorialcode \allmathstyles \zeromuskip
1543
1544 \inherited\setmathspacing \mathopencode \mathconstructcode \allmathstyles \thinmuskip
1545 \inherited\setmathspacing \mathconstructcode \mathclosecode \allmathstyles \thinmuskip
1546
1547 \inherited\setmathspacing \mathdimensioncode \mathdimensioncode \allmathstyles \zeromuskip
1548 \inherited\setmathspacing \mathordinarycode \mathdimensioncode \allsplitstyles \thinmuskip
1549 \inherited\setmathspacing \mathordinarycode \mathdimensioncode \allunsplitstyles \pettymuskip
1550 \inherited\setmathspacing \mathdigitcode \mathdimensioncode \allsplitstyles \thinmuskip
1551 \inherited\setmathspacing \mathdigitcode \mathdimensioncode \allunsplitstyles \pettymuskip
1552 \inherited\setmathspacing \mathclosecode \mathdimensioncode \allsplitstyles \thinmuskip
1553 \inherited\setmathspacing \mathclosecode \mathdimensioncode \allunsplitstyles \pettymuskip
1554 \inherited\setmathspacing \mathfunctioncode \mathbinarycode \allsplitstyles \medmuskip
1555 \inherited\setmathspacing \mathfunctioncode \mathbinarycode \allunsplitstyles \pettymuskip
1556
1557
1558
1559 \inherited\setmathspacing \mathfunctioncode \mathopencode \allsplitstyles \pettymuskip
1560 \inherited\setmathspacing \mathdifferentialcode \mathopencode \allsplitstyles \pettymuskip
1561
1562
1563
1564 \inherited\setmathspacing \mathintegralcode \mathordinarycode \allmathstyles \pettymuskip
1565 \inherited\setmathspacing \mathintegralcode \mathdigitcode \allmathstyles \pettymuskip
1566 \inherited\setmathspacing \mathintegralcode \mathoperatorcode \allmathstyles \pettymuskip
1567 \inherited\setmathspacing \mathintegralcode \mathdifferentialcode \allmathstyles \pettymuskip
1568 \inherited\setmathspacing \mathintegralcode \mathexponentialcode \allmathstyles \pettymuskip
1569 \inherited\setmathspacing \mathintegralcode \mathimaginarycode \allmathstyles \pettymuskip
1570
1571
1572
1573 \inherited\setmathspacing \mathdimensioncode \mathdigitcode \allmathstyles \thickmuskip
1574 \inherited\setmathspacing \mathdimensioncode \mathbinarycode \allsplitstyles \medmuskip
1575 \inherited\setmathspacing \mathdimensioncode \mathbinarycode \allunsplitstyles \pettymuskip
1576 \inherited\setmathspacing \mathdimensioncode \mathrelationcode \allsplitstyles \thickmuskip
1577 \inherited\setmathspacing \mathdimensioncode \mathrelationcode \allunsplitstyles \pettymuskip
1578
1579 \inherited\setmathspacing \mathfakecode \mathallcode \allmathstyles \tinymuskip
1580 \inherited\setmathspacing \mathallcode \mathfakecode \allmathstyles \tinymuskip
1581
1582 \inherited\setmathspacing \mathtextpunctuationcode \mathordinarycode \allmathstyles \mathinterwordmuskip
1583 \inherited\setmathspacing \mathtextpunctuationcode \mathoperatorcode \allmathstyles \mathinterwordmuskip
1584 \inherited\setmathspacing \mathtextpunctuationcode \mathbinarycode \allmathstyles \mathinterwordmuskip
1585 \inherited\setmathspacing \mathtextpunctuationcode \mathrelationcode \allmathstyles \mathinterwordmuskip
1586 \inherited\setmathspacing \mathtextpunctuationcode \mathopencode \allmathstyles \mathinterwordmuskip
1587 \inherited\setmathspacing \mathtextpunctuationcode \mathmiddlecode \allmathstyles \mathinterwordmuskip
1588 \inherited\setmathspacing \mathtextpunctuationcode \mathclosecode \allmathstyles \mathinterwordmuskip
1589 \inherited\setmathspacing \mathtextpunctuationcode \mathpunctuationcode \allmathstyles \mathinterwordmuskip
1590 \inherited\setmathspacing \mathtextpunctuationcode \mathconstructcode \allmathstyles \mathinterwordmuskip
1591 \inherited\setmathspacing \mathtextpunctuationcode \mathellipsiscode \allmathstyles \mathinterwordmuskip
1592 \inherited\setmathspacing \mathtextpunctuationcode \mathfractioncode \allmathstyles \mathinterwordmuskip
1593 \inherited\setmathspacing \mathtextpunctuationcode \mathradicalcode \allmathstyles \mathinterwordmuskip
1594 \inherited\setmathspacing \mathtextpunctuationcode \mathdifferentialcode \allmathstyles \mathinterwordmuskip
1595 \inherited\setmathspacing \mathtextpunctuationcode \mathpunctuationcode \allmathstyles \mathinterwordmuskip
1596
1597 \inherited\setmathspacing \mathordinarycode \mathtextpunctuationcode \allmathstyles \pettymuskip
1598 \inherited\setmathspacing \mathoperatorcode \mathtextpunctuationcode \allmathstyles \pettymuskip
1599 \inherited\setmathspacing \mathbinarycode \mathtextpunctuationcode \allmathstyles \pettymuskip
1600 \inherited\setmathspacing \mathrelationcode \mathtextpunctuationcode \allmathstyles \pettymuskip
1601 \inherited\setmathspacing \mathopencode \mathtextpunctuationcode \allmathstyles \pettymuskip
1602 \inherited\setmathspacing \mathmiddlecode \mathtextpunctuationcode \allmathstyles \pettymuskip
1603 \inherited\setmathspacing \mathclosecode \mathtextpunctuationcode \allmathstyles \pettymuskip
1604 \inherited\setmathspacing \mathpunctuationcode \mathtextpunctuationcode \allmathstyles \pettymuskip
1605 \inherited\setmathspacing \mathconstructcode \mathtextpunctuationcode \allmathstyles \pettymuskip
1606 \inherited\setmathspacing \mathellipsiscode \mathtextpunctuationcode \allmathstyles \pettymuskip
1607 \inherited\setmathspacing \mathfractioncode \mathtextpunctuationcode \allmathstyles \pettymuskip
1608 \inherited\setmathspacing \mathradicalcode \mathtextpunctuationcode \allmathstyles \pettymuskip
1609 \inherited\setmathspacing \mathdifferentialcode \mathtextpunctuationcode \allmathstyles \pettymuskip
1610 \inherited\setmathspacing \mathpunctuationcode \mathtextpunctuationcode \allmathstyles \pettymuskip
1611
1612
1613
1614 \inherited\setmathspacing \mathimplicationcode \mathordinarycode \alldisplaystyles \thickermuskip
1615 \inherited\setmathspacing \mathimplicationcode \mathbinarycode \alldisplaystyles \thickermuskip
1616 \inherited\setmathspacing \mathimplicationcode \mathdigitcode \alldisplaystyles \thickermuskip
1617 \inherited\setmathspacing \mathordinarycode \mathimplicationcode \alldisplaystyles \thickermuskip
1618 \inherited\setmathspacing \mathbinarycode \mathimplicationcode \alldisplaystyles \thickermuskip
1619 \inherited\setmathspacing \mathdigitcode \mathimplicationcode \alldisplaystyles \thickermuskip
1620 \inherited\setmathspacing \mathclosecode \mathimplicationcode \alldisplaystyles \thickermuskip
1621 \inherited\setmathspacing \mathradicalcode \mathimplicationcode \alldisplaystyles \thickermuskip
1622 \inherited\setmathspacing \mathfractioncode \mathimplicationcode \alldisplaystyles \thickermuskip
1623 \inherited\setmathspacing \mathfunctioncode \mathimplicationcode \alldisplaystyles \thickermuskip
1624 \inherited\setmathspacing \mathoperatorcode \mathimplicationcode \alldisplaystyles \thickermuskip
1625 \inherited\setmathspacing \mathellipsiscode \mathimplicationcode \alldisplaystyles \thickermuskip
1626 \inherited\setmathspacing \mathconstructcode \mathimplicationcode \alldisplaystyles \thickermuskip
1627 \inherited\setmathspacing \mathghostcode \mathimplicationcode \alldisplaystyles \thickermuskip
1628 \inherited\setmathspacing \mathwrappedcode \mathimplicationcode \alldisplaystyles \thickermuskip
1629\stopsetups
1630
1631\directsetup{math:spacing:default}
1632\directsetup{math:spacing:presets}
1633
1634
1635
1636
1637
1638\definemathematics[i:default][\c!setups=math:spacing:equal]
1639\definemathematics[i:half] [\c!setups=math:spacing:half]
1640\definemathematics[i:tight] [\c!setups=math:spacing:tight]
1641\definemathematics[i:fixed] [\c!setups=math:spacing:fixed]
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655\installcorenamespace{mathstylealternative}
1656
1657\permanent\protected\def\setmathfontstylealternate#1
1658 {\ifcsname\??mathstylealternative\fontclass:#1\endcsname
1659 \expandafter\setmathfontalternate\lastnamedcs
1660 \orelse\ifcsname\??mathstylealternative#1\endcsname
1661 \expandafter\setmathfontalternate\lastnamedcs
1662 \fi}
1663
1664\permanent\tolerant\protected\def\setupmathrendering[#1]#*[#S#2]
1665 {\ifparameter#2\or
1666 \getparameters[\??mathstylealternative#1:][#2]
1667 \else
1668 \getparameters[\??mathstylealternative][#1]
1669 \fi}
1670
1671\appendtoks
1672 \edef\p_stylealternative{\mathematicsparameter\c!stylealternative}
1673 \ifempty\p_stylealternative\else
1674 \presetmathfontalternate{\p_stylealternative}
1675 \fi
1676\to \everymathematics
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698\permanent\protected\def\mathaltcalligraphic{\setmathfontalternate{calligraphic}\cal}
1699\permanent\protected\def\mathaltitalic {\setmathfontalternate{italic}}
1700\permanent\protected\def\mathslashedzero {\begingroup\setmathfontalternate{zero}∅\endgroup}
1701\permanent\protected\def\mathdotless {\setmathfontalternate{dotless}}
1702\permanent\protected\def\mathdotfull {\setmathfontalternate{dotless}}
1703\permanent\protected\def\mathdotlessi {\begingroup\mathdotless i\endgroup}
1704\permanent\protected\def\mathdotlessj {\begingroup\mathdotless j\endgroup}
1705
1706\aliased\let\mathaltcal\mathaltcalligraphic
1707\aliased\let\mathaltit \mathaltitalic
1708
1709
1710\aliased\let\textdotlessi \dotlessi \permanent\protected\def\autodotlessi {\mathortext\mathdotlessi \textdotlessi}
1711\aliased\let\textdotlessj \dotlessj \permanent\protected\def\autodotlessj {\mathortext\mathdotlessj \textdotlessj}
1712
1713\appendtoks
1714
1715 \enforced\let\dotlessi\autodotlessi
1716 \enforced\let\dotlessj\autodotlessj
1717\to \everymathematics
1718
1719\aliased\let\setmathfontalternative \setmathfontalternate
1720\aliased\let\setmathfontstylealternative\setmathfontstylealternate
1721\aliased\let\mathalternate \setmathfontalternate
1722
1723\permanent\protected\def\math_upright {\setmathattribute\s!regular\s!tf\setmathfontstylealternate\s!tf}
1724\permanent\protected\def\math_italic {\setmathattribute\s!regular\s!it\setmathfontstylealternate\s!it}
1725
1726
1727\permanent\protected\def\math_script {\setmathalphabet \s!script \setmathfontstylealternate\s!script}
1728\permanent\protected\def\math_calligraphic{\setmathalphabet \s!calligraphic\setmathfontstylealternate\s!calligraphic}
1729\permanent\protected\def\math_fraktur {\setmathalphabet \s!fraktur \setmathfontstylealternate\s!fraktur}
1730\permanent\protected\def\math_blackboard {\setmathalphabet \s!blackboard \setmathfontstylealternate\s!blackboard}
1731
1732\permanent\protected\def\mathupright {\mathgroupedcommandcs\math_upright }
1733\permanent\protected\def\mathitalic {\mathgroupedcommandcs\math_italic }
1734\permanent\protected\def\mathscript {\mathgroupedcommandcs\math_script }
1735\permanent\protected\def\mathcalligraphic{\mathgroupedcommandcs\math_calligraphic}
1736\permanent\protected\def\mathfraktur {\mathgroupedcommandcs\math_fraktur }
1737\permanent\protected\def\mathblackboard {\mathgroupedcommandcs\math_blackboard }
1738
1739\permanent\protected\def\math_rm{\setmathattribute\s!rm\s!tf\setmathfontstylealternate\s!tf}
1740\permanent\protected\def\math_ss{\setmathattribute\s!ss\s!tf\setmathfontstylealternate\s!tf}
1741\permanent\protected\def\math_tt{\setmathattribute\s!tt\s!tf\setmathfontstylealternate\s!tf}
1742
1743\permanent\protected\def\math_tf{\setmathfontstyle\s!tf\setmathfontstylealternate\s!tf}
1744\permanent\protected\def\math_sl{\setmathfontstyle\s!it\setmathfontstylealternate\s!it}
1745\permanent\protected\def\math_it{\setmathfontstyle\s!it\setmathfontstylealternate\s!it}
1746
1747\permanent\protected\def\math_bf{\setmathfontstyle\s!bf\setmathfontstylealternate\s!bf}
1748\permanent\protected\def\math_bs{\setmathfontstyle\s!bi\setmathfontstylealternate\s!bi}
1749\permanent\protected\def\math_bi{\setmathfontstyle\s!bi\setmathfontstylealternate\s!bi}
1750
1751\permanent\protected\def\mathrm{\mathgroupedcommandcs\math_rm}
1752\permanent\protected\def\mathss{\mathgroupedcommandcs\math_ss}
1753\permanent\protected\def\mathtt{\mathgroupedcommandcs\math_tt}
1754
1755\permanent\protected\def\mathtf{\mathgroupedcommandcs\math_tf}
1756\permanent\protected\def\mathsl{\mathgroupedcommandcs\math_sl}
1757\permanent\protected\def\mathit{\mathgroupedcommandcs\math_it}
1758
1759\permanent\protected\def\mathbf{\mathgroupedcommandcs\math_bf}
1760\permanent\protected\def\mathbs{\mathgroupedcommandcs\math_bs}
1761\permanent\protected\def\mathbi{\mathgroupedcommandcs\math_bi}
1762
1763\aliased\let\math_default\math_italic
1764\aliased\let\mathdefault \math_italic
1765
1766\appendtoks
1767 \ifcstok{\mathematicsparameter\c!default}\v!normal
1768 \enforced\let\mathdefault \math_upright
1769 \enforced\let\math_default\math_upright
1770 \else
1771 \enforced\let\mathdefault \math_italic
1772 \enforced\let\math_default\math_italic
1773 \fi
1774
1775\to \everyswitchmathematics
1776
1777\setupmathematics
1778 [\c!default=\v!italic]
1779
1780\aliased\let\tfmath\mathtf
1781\aliased\let\slmath\mathsl
1782\aliased\let\itmath\mathit
1783
1784\aliased\let\bfmath\mathbf
1785\aliased\let\bsmath\mathbs
1786\aliased\let\bimath\mathbi
1787
1788\aliased\let\Bbb\mathblackboard
1789
1790\permanent\protected\def\frak {\ifmmode\expandafter\mathfraktur \fi}
1791\permanent\protected\def\cal {\ifmmode\expandafter\mathcalligraphic\fi}
1792\permanent\protected\def\bbd {\ifmmode\expandafter\mathblackboard \fi}
1793\permanent\protected\def\blackboard{\ifmmode\expandafter\mathblackboard \fi}
1794\permanent\protected\def\fraktur {\ifmmode\expandafter\mathfraktur \fi}
1795\permanent\protected\def\gothic {\ifmmode\expandafter\mathfraktur \fi}
1796
1797\aliased\let\mathcal \mathcalligraphic
1798\aliased\let\mathscr \mathscript
1799\aliased\let\mathfrak\mathfraktur
1800\aliased\let\mathbb \mathblackboard
1801
1802\ifdefined\normaltf \else \permanent\let\normaltf\tf \fi \permanent\protected\def\tf{\ifmmode\expandafter\mathtf\else\expandafter\normaltf\fi}
1803\ifdefined\normalbf \else \permanent\let\normalbf\bf \fi \permanent\protected\def\bf{\ifmmode\expandafter\mathbf\else\expandafter\normalbf\fi}
1804\ifdefined\normalit \else \permanent\let\normalit\it \fi \permanent\protected\def\it{\ifmmode\expandafter\mathit\else\expandafter\normalit\fi}
1805\ifdefined\normalsl \else \permanent\let\normalsl\sl \fi \permanent\protected\def\sl{\ifmmode\expandafter\mathsl\else\expandafter\normalsl\fi}
1806\ifdefined\normalbi \else \permanent\let\normalbi\bi \fi \permanent\protected\def\bi{\ifmmode\expandafter\mathbi\else\expandafter\normalbi\fi}
1807\ifdefined\normalbs \else \permanent\let\normalbs\bs \fi \permanent\protected\def\bs{\ifmmode\expandafter\mathbs\else\expandafter\normalbs\fi}
1808
1809\permanent\protected\def\rm{\ifmmode\expandafter\mathrm\else\expandafter\normalrm\fi}
1810\permanent\protected\def\ss{\ifmmode\expandafter\mathss\else\expandafter\normalss\fi}
1811\permanent\protected\def\tt{\ifmmode\expandafter\mathtt\else\expandafter\normaltt\fi}
1812
1813\ifdefined\mr \else \let\mr\relax \fi
1814\ifdefined\mb \else \let\mb\relax \fi
1815
1816
1817
1818
1819
1820
1821
1822\prependtoks
1823 \math_default
1824\to \everymathematics
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843\newinteger\c_math_renderings_attribute
1844
1845\appendtoks
1846 \c_math_renderings_attribute\clf_mathrenderset{\mathematicsparameter\c!symbolset}\relax
1847
1848\to \everyswitchmathematics
1849
1850\appendtoks
1851 \ifcase\c_math_renderings_attribute\else
1852 \c_attr_mathrendering\c_math_renderings_attribute
1853 \fi
1854\to \everymathematics
1855
1856\setupmathematics
1857 [\c!symbolset=]
1858
1859
1860
1861
1862
1863
1864\mutable\let\mathboldsymbol\relax
1865
1866\permanent\protected\def\boldsymbol
1867 {\mathortext\mathboldsymbol\bold}
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886\aliased\let\doifutfmathaccentelse \doifelseutfmathaccent
1887\aliased\let\doifutfmathaboveelse \doifelseutfmathabove
1888\aliased\let\doifutfmathbelowelse \doifelseutfmathbelow
1889\aliased\let\doifutfmathfillerelse \doifelseutfmathfiller
1890\aliased\let\doifutfmathlimopelse \doifelseutfmathlimop
1891
1892
1893
1894\permanent\protected\def\mathlimop#1{\normalmathop{#1}}
1895\permanent\protected\def\mathbox #1{\dontleavehmode\hbox\Ustartmath\mathsurround\zeropoint#1\Ustopmath}
1896\permanent\protected\def\mathnolop#1{\normalmathop{#1}\nolimits}
1897
1898
1899
1900
1901
1902
1903
1904\ifdefined\mathop \else \aliased\let\mathop \normalmathoperator \aliased\let\normalmathop \normalmathoperator \fi
1905\ifdefined\mathord \else \aliased\let\mathord \normalmathordinary \aliased\let\normalmathord \normalmathordinary \fi
1906\ifdefined\mathbin \else \aliased\let\mathbin \normalmathbinary \aliased\let\normalmathbin \normalmathbinary \fi
1907\ifdefined\mathrel \else \aliased\let\mathrel \normalmathrelation \aliased\let\normalmathrel \normalmathrelation \fi
1908\ifdefined\mathpunct \else \aliased\let\mathpunct\normalmathpunctuation \aliased\let\normalmathpunct\normalmathpunctuation \fi
1909\ifdefined\underline \else \aliased\let\underline\normalmathunderline \aliased\let\normalunderline\normalmathunderline \fi
1910\ifdefined\overline \else \aliased\let\overline \normalmathoverline \aliased\let\normaloverline \normalmathoverline \fi
1911
1912\permanent\def\mathcodechecked#1
1913 {\numexpr
1914 \ifempty{#1}
1915 \mathordinarycode
1916 \orelse\ifchknumber#1\or
1917 \lastchknumber
1918 \orelse\ifchknumber\begincsname math#1code\endcsname\or
1919 \lastchknumber
1920 \else
1921 \mathordinarycode
1922 \fi
1923 \relax}
1924
1925\permanent\def\mathcodenumber#1
1926 {\the\mathcodechecked{#1}}
1927
1928\permanent\protected\def\mathcodecommand#1
1929 {\mathatom \s!class \mathcodechecked{#1}}
1930
1931\permanent\protected\def\mathcodeallcommand#1#2
1932 {\mathatom \s!class \mathcodechecked{#1} \s!all \mathcodechecked{#2}}
1933
1934\def\math_class_by_parameter #1#2{\normalexpanded{\noexpand\mathcodechecked{#1#2}}}
1935\def\math_atom_by_parameter #1{\normalexpanded{\noexpand\math_atom_by_parameter_indeed{#1\c!mathclass}}}
1936\def\math_atom_by_parameter_indeed#1{\mathatom \s!class \mathcodechecked{#1}}
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950\installcorenamespace{mathcommand}
1951
1952\permanent\tolerant\protected\def\definemathcommand[#1]#*[#2]#*[#3]#:#*#4
1953 {\ifparameter#3\or
1954 \ifcstok{#3}\v!one
1955 \frozen\protected\defcsname\??mathcommand#1\endcsname##1{\mathcodecommand{#2}{#4{##1}}}
1956 \orelse\ifcstok{#3}\v!two
1957 \frozen\protected\defcsname\??mathcommand#1\endcsname##1##2{\mathcodecommand{#2}{#4{##1}{##2}}}
1958 \orelse\ifchknum\mathcodechecked{#3}\or
1959 \frozen\protected\defcsname\??mathcommand#1\endcsname{\mathcodeallcommand{#2}{#3}{#4}}
1960 \else
1961 \frozen\protected\defcsname\??mathcommand#1\endcsname{\mathcodecommand{#2}{#4}}
1962 \fi
1963 \orelse\ifparameter#2\or
1964 \frozen\protected\defcsname\??mathcommand#1\endcsname{\mathcodecommand{#2}{#4}}
1965 \else
1966 \frozen\protected\defcsname\??mathcommand#1\endcsname{#4}
1967 \fi
1968 \ifparameter#1\or
1969 \letcsname#1\expandafter\endcsname\csname\??mathcommand#1\endcsname
1970 \fi}
1971
1972\permanent\protected\def\mathcommand#1
1973 {\begincsname\??mathcommand#1\endcsname}
1974
1975
1976
1977
1978\permanent\tolerant\protected\def\definemathsymbol[#1]#*[#2]#*[#3]
1979 {\frozen\expandafter\Umathchardef\csname#1\endcsname
1980 \ifparameter#3\or
1981 \mathcodechecked{#2}
1982 \zerocount
1983 \numexpr#3
1984 \else
1985 \zerocount
1986 \zerocount
1987 \numexpr#2
1988 \fi\relax}
1989
1990
1991
1992
1993
1994
1995
1996\immutable\chardef\c_math_strut"28
1997
1998
1999
2000
2001\let\math_strut_math_style\normalmathstyle
2002
2003
2004
2005\appendtoks
2006 \Umathruleheight\allmainstyles \strutheightfactor\fontspecifiedsize\textfont \zerocount
2007 \Umathruledepth \allmainstyles \strutdepthfactor \fontspecifiedsize\textfont \zerocount
2008 \Umathruleheight\allscriptstyles \strutheightfactor\fontspecifiedsize\scriptfont \zerocount
2009 \Umathruledepth \allscriptstyles \strutdepthfactor \fontspecifiedsize\scriptfont \zerocount
2010 \Umathruleheight\allscriptscriptstyles\strutheightfactor\fontspecifiedsize\scriptscriptfont\zerocount
2011 \Umathruledepth \allscriptscriptstyles\strutdepthfactor \fontspecifiedsize\scriptscriptfont\zerocount
2012\to \everybodyfont
2013
2014
2015
2016
2017\protected\def\math_strut
2018 {\normalsrule
2019
2020 \s!fam \fam
2021 \s!char \c_math_strut
2022 \relax}
2023
2024\permanent\protected\def\math_strut_height
2025 {\normalsrule
2026
2027 \s!depth \zeropoint
2028 \s!fam \fam
2029 \s!char \c_math_strut
2030 \relax}
2031
2032\permanent\protected\def\math_strut_depth
2033 {\normalsrule
2034
2035 \s!height\zeropoint
2036 \s!fam \fam
2037 \s!char \c_math_strut
2038 \relax}
2039
2040\permanent\protected\def\showmathstruts
2041 {\showmakeup[strut]}
2042
2043\pushoverloadmode
2044 \permanent\protected\def\mathstrut {\math_strut}
2045 \permanent\protected\def\mathheightstrut{\math_strut_height}
2046 \permanent\protected\def\mathdepthstrut {\math_strut_depth}
2047\popoverloadmode
2048
2049
2050
2051
2052\permanent\protected\def\topstrut{\normalsrule\s!height\strutht\relax}
2053\permanent\protected\def\botstrut{\normalsrule\s!depth \strutdp\relax}
2054
2055
2056
2057
2058\appendtoks
2059 \mathstrutht\strutht
2060 \mathstrutdp\strutdp
2061
2062\to \everymathematics
2063
2064
2065
2066\permanent\protected\def\mathopwithlimits#1#2{\mathop{#1{#2}}\limits}
2067\permanent\protected\def\stackrel #1#2{\mathrel{\mathop{#2}\limits{#1}}}
2068
2069
2070
2071
2072
2073
2074
2075
2076\permanent\protected\def\mf{\begincsname\fontalternative\endcsname}
2077
2078
2079
2080\permanent\protected\def\normalmbox
2081 {\normalhbox\bgroup
2082 \usemathematicsstyleandcolor\c!textstyle\c!textcolor
2083 \dowithnextboxcs\math_mbox_finish\normalhbox}
2084
2085\def\math_mbox_finish
2086 {\flushnextbox
2087 \egroup}
2088
2089\permanent\protected\def\mbox
2090 {\ifmmode\normalmbox\else\normalhbox\fi}
2091
2092\permanent\protected\def\enablembox
2093 {\toksapp\everymathematics{\math_enable_mbox}}
2094
2095\permanent\def\math_enable_mbox
2096 {\enforced\let\hbox\mbox}
2097
2098\permanent\protected\def\snappedmath#1
2099 {\dontleavehmode
2100 \begingroup
2101 \setbox\scratchbox\normalhbox\bgroup
2102 \startimath#1\stopimath
2103 \egroup
2104 \ht\scratchbox\strutht
2105 \dp\scratchbox\strutdp
2106 \box\scratchbox
2107 \endgroup}
2108
2109\permanent\protected\def\mtext#1
2110 {\begingroup
2111 \currentmathblobnesting\minusone
2112 \dostarttaggednodetail\t!mtext
2113 \text{\usemathematicsstyleandcolor\c!textstyle\c!textcolor#1}
2114 \dostoptagged
2115 \endgroup}
2116
2117\protected\permanent\def\textmathematics#1
2118 {\begingroup
2119 \currentmathblobnesting\minusone
2120 \mathematics{#1}
2121 \endgroup}
2122
2123
2124
2125\aliased\let\mathfunction\firstofoneunexpanded
2126
2127\let\math_tags_function \firstofoneunexpanded
2128\let\math_tags_functionlabeltext\mathlabeltext
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141\setupmathematics
2142 [\c!textstyle=,
2143 \c!textcolor=,
2144 \c!functionstyle=,
2145 \c!functioncolor=]
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165\installcorenamespace{mathfunction}
2166
2167\installcommandhandler \??mathfunction {mathfunction} \??mathfunction
2168
2169\appendtoks
2170 \frozen\protected\edefcsname\currentmathfunction\endcsname{\math_function_handle\plusone{\currentmathfunction}{}}
2171\to \everydefinemathfunction
2172
2173\aliased\let\setupmathfunctions\setupmathfunction
2174
2175\setupmathfunctions
2176 [\c!color=\mathematicsparameter\c!functioncolor,
2177 \c!style=\mathematicsparameter\c!functionstyle,
2178 \s!class=function]
2179
2180\newconstant\c_function_method
2181
2182\def\math_function_handle_normal#1#2#3
2183 {\begingroup
2184 \mathdotfull
2185 \cdef\currentmathfunction{#2}
2186 \setupcurrentmathfunction[#3]
2187 \edef\p_limits{\mathfunctionparameter\c!mathlimits}
2188 \edef\p_left{\mathfunctionparameter\c!left}
2189 \edef\p_right{\mathfunctionparameter\c!right}
2190 \c_function_method
2191 \ifempty\p_left
2192 \ifempty\p_right
2193 \zerocount
2194 \else
2195 \plustwo
2196 \fi
2197 \orelse\ifempty\p_right
2198 \plusone
2199 \else
2200 \plusthree
2201 \fi
2202 \ifcase\c_function_method
2203 \expandafter\math_function_handle_normal_string
2204 \else
2205 \expandafter\math_function_handle_normal_symbol
2206 \fi#1}
2207
2208\def\math_function_handle_normal_string#1
2209 {\dostarttagged\t!mfunction\currentmathfunction
2210 \math_tags_mfunctionlab\plusone{\currentmathfunction}{\mathfunctionparameter\c!method}
2211 \mathatom
2212 mathfont
2213 single
2214 class \mathcodechecked{\mathfunctionparameter\s!class}
2215 \ifx\p_limits\v!no
2216 nolimits
2217 \orelse\ifx\p_limits\v!yes
2218 limits
2219 \orelse\ifx\p_limits\v!auto
2220 nolimits
2221 limits
2222 \fi
2223
2224
2225
2226
2227
2228
2229
2230
2231 \bgroup
2232 \usemathfunctioncolorparameter\c!color
2233 \edef\p_functionstyle{\mathfunctionparameter\c!style}
2234
2235 \ifempty\p_functionstyle
2236 \expandafter\math_upright
2237 \orelse\ifcsname\??alternativestyle\p_functionstyle\endcsname
2238 \expandafter\lastnamedcs
2239 \else
2240 \expandafter\p_functionstyle
2241 \fi
2242
2243 \mathlabeltext{\currentmathfunction}
2244
2245 \scratchdimen\rightmathkern{\currentmathfunction}
2246 \ifzeropt\scratchdimen\else\hkern\scratchdimen\fi
2247
2248 \egroup
2249 \dostoptagged
2250 \endgroup}
2251
2252\definesystemattribute[mathstack][public]
2253
2254\newinteger\c_mathfunctionstack
2255
2256\def\math_function_handle_normal_symbol#1#2
2257 {\global\advanceby\c_mathfunctionstack\plusone
2258 \attribute\mathstackattribute\c_mathfunctionstack
2259 \math_tags_mfunctionlab\plusone{\currentmathfunction}{\mathfunctionparameter\c!method}
2260 \dostarttagged\t!mfunctionstack\currentmathfunction
2261 \mathghost carryover \bgroup
2262 \p_left
2263 \begingroup
2264 \attribute\mathstackattribute\attributeunsetvalue
2265 #2
2266 \endgroup
2267 \p_right
2268 \egroup
2269 \dostoptagged
2270 \endgroup}
2271
2272\def\math_function_handle_language_indeed#1#2#3
2273 {\cdef\currentmathfunction{#2}
2274 \setupcurrentmathfunction[#3]
2275 \edef\p_command{\mathfunctionparameter\c!command}
2276 \ifempty\p_command
2277 \endgroup\math_function_handle_normal#1{#2}{#3}
2278 \else
2279 \normalexpanded{\endgroup\p_command\expandafter}
2280 \fi}
2281
2282\def\math_function_handle_language#1#2
2283 {\begingroup
2284 \let\math_function_handle\math_function_handle_language_indeed
2285 \csname\currentmainlanguage:#2\endcsname}
2286
2287\tolerant\protected\def\math_function_handle#1#2#3
2288 {\ifcsname\currentmainlanguage:#2\endcsname
2289 \expandafter\math_function_handle_language
2290 \else
2291 \expandafter\math_function_handle_normal
2292 \fi#1{#2}{#3}}
2293
2294\permanent\tolerant\protected\def\mfunctionlabeltext[#1]
2295 {\math_function_handle\plusone{#1}{}}
2296
2297
2298
2299\permanent\tolerant\protected\def\mfunction[#1]
2300 {\ifhastok={#1}
2301 \expandafter\mfunction_yes
2302 \orelse\ifparameter#1\or
2303 \expandafter\mfunction_nop
2304 \else
2305 \expandafter\mfunction_yop
2306 \fi{#1}}
2307
2308\permanent\tolerant\protected\def\mfunction_yes#1#*[#2]#;#3{\math_function_handle\zerocount{#2#3}{#1}}
2309\permanent\protected\def\mfunction_nop #1{\math_function_handle\zerocount{#1}{}}
2310\permanent\protected\def\mfunction_yop #1#2{\math_function_handle\zerocount{#2}{}}
2311
2312\appendtoks
2313
2314
2315
2316
2317
2318
2319
2320
2321\to \everybeforedisplayformula
2322
2323\let\math_tags_mfunctionlab \gobblethreearguments
2324\def\math_tags_mfunctionlabattribute###{\zerocount}
2325
2326
2327
2328
2329
2330
2331\permanent\protected\def\math_tags_mo#1{\mathatom \s!class \mathoperatorcode {#1}}
2332\permanent\protected\def\math_tags_mi#1{\mathatom \s!class \mathordinarycode {#1}}
2333
2334\permanent\protected\def\math_tags_ms#1{\mathatom \s!class \mathtextpunctuationcode {\math_upright #1}}
2335
2336\permanent\protected\def\math_tags_mn#1
2337 {\dostarttaggednodetail\t!mdigits
2338 \mathatom \s!class \mathdigitcode {\math_upright #1}
2339 \dostoptagged}
2340
2341\newconditional\c_apply_function
2342
2343\ifdefined\apply \else \aliased\let\apply\relax \fi
2344
2345\mutable\let\mo\relax
2346\mutable\let\mi\relax
2347\mutable\let\mn\relax
2348\mutable\let\ms\relax
2349
2350\appendtoks
2351 \enforced\let\math_tags_mfunctionlab \clf_tagmfunctionlab
2352 \enforced\let\math_tags_mfunctionlabattribute\clf_tagmfunctionlabattribute
2353\to \everyenableelements
2354
2355\permanent\protected\def\registermathfunction[#1]
2356 {\begingroup
2357 \scratchcounter\clf_tagmfunctionlabattribute
2358 \plusone
2359 {#1}
2360 {}
2361 \endgroup}
2362
2363
2364
2365
2366
2367\permanent\protected\def\registermathsymbol[#1]#*[#2]#*[#3]#*[#4]
2368 {\ifparameter#4\or
2369 \clf_registerverbosemathlabel{#1}{#2}{#3}{#4}
2370 \orelse\ifparameter#3\or
2371 \clf_registerverbosemathlabel{\s!default}{#1}{#2}{#3}
2372 \else
2373 \clf_registerverbosemathlabel{\s!default}{\s!en}{#1}{#2}
2374 \fi}
2375
2376\appendtoks
2377 \enforced\let\mo \math_tags_mo
2378 \enforced\let\mi \math_tags_mi
2379 \enforced\let\mn \math_tags_mn
2380 \enforced\let\ms \math_tags_ms
2381 \enforced\let\apply\math_tags_apply
2382\to\everymathematics
2383
2384\mutable\def\currentmscaledstyle{rm}
2385
2386\permanent\protected\def\mscaledtext#1
2387 {\mathchoice
2388 {\hbox{\csname\currentmscaledstyle\endcsname\tf #1}}
2389 {\hbox{\csname\currentmscaledstyle\endcsname\tf #1}}
2390 {\hbox{\csname\currentmscaledstyle\endcsname\tfx #1}}
2391 {\hbox{\csname\currentmscaledstyle\endcsname\tfxx#1}}}
2392
2393\permanent\protected\def\setmathfunctionstyle#1
2394 {\setupmathematics[\c!functionstyle=#1]}
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530\ifdefined \prime \else
2531 \Umathchardef\prime "0 "0 "2032
2532\fi
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555\newtoks\everydonknuthmode
2556\newtoks\everynonknuthmode
2557
2558\newconditional \knuthmode
2559
2560\aliased\let\nonknuthmode\relax
2561\aliased\let\donknuthmode\relax
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641\permanent\protected\def\enableasciimode
2642 {\clf_enableasciimode}
2643
2644\permanent\protected\def\asciimode
2645 {\catcodetable\txtcatcodes
2646 \clf_enableasciimode}
2647
2648\permanent\protected\def\startasciimode
2649 {\pushcatcodetable
2650 \catcodetable\txtcatcodes
2651 \clf_enableasciimode}
2652
2653\permanent\protected\def\stopasciimode
2654 {\popcatcodetable}
2655
2656
2657
2658\permanent\def\nulloperator{\mathortext{\mathop{\emptyhbox}}{\emptyhbox}}
2659
2660
2661
2662\def\math_basics_check_compact
2663 {\ifcstok{\mathematicsparameter\c!compact}\v!yes
2664 \expandafter\enabledirectives
2665 \else
2666 \expandafter\disabledirectives
2667 \fi
2668 [math.virtual.optional]}
2669
2670\appendtoks
2671 \ifempty\currentmathematics
2672 \math_basics_check_compact
2673 \fi
2674
2675\to \everyswitchmathematics
2676
2677\setupmathematics
2678 [\c!compact=\v!no]
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711\newconditional\c_math_right_to_left
2712
2713\installcorenamespace{mathaligndirection}
2714
2715\defcsname\??mathaligndirection r2l\endcsname{\c_math_right_to_left\conditionaltrue}
2716\defcsname\??mathaligndirection\v!righttoleft\endcsname{\c_math_right_to_left\conditionaltrue}
2717
2718\appendtoks
2719 \ifcsname\??mathaligndirection\mathematicsparameter\c!align\endcsname
2720 \lastnamedcs
2721 \else
2722 \c_math_right_to_left\conditionalfalse
2723 \fi
2724\to \everyswitchmathematics
2725
2726\protected\def\math_basics_synchronize_direction
2727 {\mathdirection\ifconditional\c_math_right_to_left\directionrighttoleft\else\directionlefttoright\fi}
2728
2729
2730
2731
2732\appendtoks
2733 \math_basics_synchronize_direction
2734\to \everyswitchmathematics
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772\installcorenamespace{mathgreek}
2773
2774\newconstant\c_math_greek_attribute
2775
2776\defcsname\??mathgreek\v!none \endcsname{1}
2777\defcsname\??mathgreek\v!normal\endcsname{2}
2778\defcsname\??mathgreek\v!italic\endcsname{3}
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794\appendtoks
2795 \c_math_greek_attribute"
2796 \ifcsname\??mathgreek\mathematicsparameter\s!sygreek\endcsname\lastnamedcs\else1\fi
2797 \ifcsname\??mathgreek\mathematicsparameter\s!lcgreek\endcsname\lastnamedcs\else1\fi
2798 \ifcsname\??mathgreek\mathematicsparameter\s!ucgreek\endcsname\lastnamedcs\else1\fi
2799 \relax
2800 \ifcase\c_math_greek_attribute
2801 \c_math_greek_attribute\attributeunsetvalue
2802 \fi
2803\to \everyswitchmathematics
2804
2805
2806
2807\permanent\protected\def\mathgreekupright{\c_attr_mathgreek"222\relax}
2808\permanent\protected\def\mathgreekitalic {\c_attr_mathgreek"333\relax}
2809\permanent\protected\def\mathgreekdefault{\c_attr_mathgreek"000\relax}
2810
2811\aliased\let\mathgreeknormal\mathgreekupright
2812\aliased\let\mathgreeknone \mathgreekdefault
2813
2814\appendtoks
2815 \c_attr_mathgreek\c_math_greek_attribute
2816\to \everymathematics
2817
2818\setupmathematics
2819 [\s!sygreek=\v!normal,
2820 \s!lcgreek=\v!italic,
2821 \s!ucgreek=\v!normal]
2822
2823
2824
2825\installcorenamespace{mathcollapsing}
2826
2827\setnewconstant\c_math_collapsing_attribute\attributeunsetvalue
2828
2829\permanent\protected\def\resetmathcollapsing{\c_attr_mathcollapsing\attributeunsetvalue}
2830
2831\letcsname\??mathcollapsing 0\endcsname\zerocount
2832\letcsname\??mathcollapsing\s!tex \endcsname\zerocount
2833\letcsname\??mathcollapsing 1\endcsname\plusone
2834\letcsname\??mathcollapsing\v!default\endcsname\plusone
2835\letcsname\??mathcollapsing 2\endcsname\plustwo
2836\letcsname\??mathcollapsing\v!all \endcsname\plustwo
2837\letcsname\??mathcollapsing 3\endcsname\plusthree
2838\letcsname\??mathcollapsing\v!list \endcsname\plusthree
2839\letcsname\??mathcollapsing\v!none \endcsname\attributeunsetvalue
2840\letcsname\??mathcollapsing\v!reset \endcsname\attributeunsetvalue
2841
2842\def\math_collapsing_initialize
2843 {\ifnum\c_math_collapsing_attribute=\attributeunsetvalue \else
2844 \clf_initializemathcollapsing
2845 \glet\math_collapsing_initialize\relax
2846 \fi}
2847
2848\appendtoks
2849 \edef\p_collapsing{\mathematicsparameter\s!collapsing}
2850 \c_math_collapsing_attribute
2851 \ifcsname\??mathcollapsing\p_collapsing\endcsname\lastnamedcs\else\attributeunsetvalue\fi
2852 \relax
2853\to \everyswitchmathematics
2854
2855\appendtoks
2856 \math_collapsing_initialize
2857 \c_attr_mathcollapsing\c_math_collapsing_attribute
2858\to \everymathematics
2859
2860\setupmathematics
2861 [\s!collapsing=1]
2862
2863
2864
2865\installcorenamespace{mathkernpairs}
2866
2867\setnewconstant\c_math_kernpairs_attribute\attributeunsetvalue
2868
2869\def\math_kernpairs_initialize
2870 {\ifnum\c_math_kernpairs_attribute=\attributeunsetvalue \else
2871 \clf_initializemathkernpairs
2872 \glet\math_kernpairs_initialize\relax
2873 \fi}
2874
2875\appendtoks
2876 \edef\p_kernpairs{\mathematicsparameter\s!kernpairs}
2877 \c_math_kernpairs_attribute\ifx\p_kernpairs\v!yes\plusone\else\attributeunsetvalue\fi\relax
2878\to \everyswitchmathematics
2879
2880\appendtoks
2881 \math_kernpairs_initialize
2882 \c_attr_mathkernpairs\c_math_kernpairs_attribute
2883\to \everymathematics
2884
2885\setupmathematics
2886 [\s!kernpairs=\v!no]
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981\def\math_activeate_comma {\amcode\commaasciicode \activecatcode}
2982\def\math_activeate_period {\amcode\periodasciicode \activecatcode}
2983\def\math_activeate_semicolon{\amcode\semicolonasciicode\activecatcode}
2984
2985\def\math_set_o_comma {\Umathcode\commaasciicode \mathordinarycode \zerocount\commaasciicode}
2986\def\math_set_p_comma {\Umathcode\commaasciicode \mathpunctuationcode\zerocount\commaasciicode}
2987\def\math_set_o_period {\Umathcode\periodasciicode \mathordinarycode \zerocount\periodasciicode}
2988\def\math_set_p_period {\Umathcode\periodasciicode \mathpunctuationcode\zerocount\periodasciicode}
2989\def\math_set_o_semicolon{\Umathcode\semicolonasciicode\mathordinarycode \zerocount\semicolonasciicode}
2990\def\math_set_p_semicolon{\Umathcode\semicolonasciicode\mathpunctuationcode\zerocount\semicolonasciicode}
2991
2992\edef\math_set_o_both{\math_set_o_period\math_set_o_comma}
2993\edef\math_set_p_both{\math_set_p_period\math_set_p_comma}
2994
2995
2996
2997\protected\def\math_punctuation_nop_comma {\begingroup\math_set_p_comma ,\endgroup\math_activeate_comma }
2998\protected\def\math_punctuation_nop_period {\begingroup\math_set_o_period .\endgroup\math_activeate_period }
2999\protected\def\math_punctuation_nop_semicolon{\begingroup\math_set_p_semicolon;\endgroup\math_activeate_semicolon}
3000
3001\def\math_punctuation_comma_next {\begingroup\Umathcode\commaasciicode \ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\zerocount\commaasciicode ,\endgroup\math_activeate_comma }
3002\def\math_punctuation_period_next {\begingroup\Umathcode\periodasciicode \ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\zerocount\periodasciicode .\endgroup\math_activeate_period }
3003\def\math_punctuation_semicolon_next{\begingroup\Umathcode\semicolonasciicode\ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\zerocount\semicolonasciicode;\endgroup\math_activeate_semicolon}
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015\protected\def\math_punctuation_all_comma {\futurelet\nexttoken\math_punctuation_comma_next}
3016\protected\def\math_punctuation_all_period {\futurelet\nexttoken\math_punctuation_period_next}
3017\protected\def\math_punctuation_all_semicolon{\futurelet\nexttoken\math_punctuation_semicolon_next}
3018
3019 \let\math_punctuation_yes_comma \math_punctuation_all_comma
3020 \let\math_punctuation_yes_period \math_punctuation_nop_period
3021 \let\math_punctuation_yes_semicolon\math_punctuation_all_semicolon
3022
3023\installcorenamespace {mathautopunctuation}
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068\defcsname\??mathautopunctuation\v!no\endcsname
3069 {\letcharcode\commaasciicode \math_punctuation_nop_comma
3070 \letcharcode\periodasciicode \math_punctuation_nop_period
3071 \letcharcode\semicolonasciicode\math_punctuation_nop_semicolon}
3072
3073\defcsname\??mathautopunctuation\v!yes\endcsname
3074 {\letcharcode\commaasciicode \math_punctuation_yes_comma
3075 \letcharcode\periodasciicode \math_punctuation_yes_period
3076 \letcharcode\semicolonasciicode\math_punctuation_nop_semicolon}
3077
3078\defcsname\??mathautopunctuation\v!all\endcsname
3079 {\letcharcode\commaasciicode \math_punctuation_all_comma
3080 \letcharcode\periodasciicode \math_punctuation_all_period
3081 \letcharcode\semicolonasciicode\math_punctuation_nop_semicolon}
3082
3083\defcsname\??mathautopunctuation comma\endcsname
3084 {\letcharcode\commaasciicode \math_punctuation_yes_comma
3085 \letcharcode\periodasciicode \math_punctuation_yes_period
3086 \letcharcode\semicolonasciicode\math_punctuation_nop_semicolon}
3087
3088\defcsname\??mathautopunctuation\v!yes\string,semicolon\endcsname
3089 {\letcharcode\commaasciicode \math_punctuation_yes_comma
3090 \letcharcode\periodasciicode \math_punctuation_yes_period
3091 \letcharcode\semicolonasciicode\math_punctuation_yes_semicolon}
3092
3093\defcsname\??mathautopunctuation comma\string,semicolon\endcsname
3094 {\letcharcode\commaasciicode \math_punctuation_yes_comma
3095 \letcharcode\periodasciicode \math_punctuation_yes_period
3096 \letcharcode\semicolonasciicode\math_punctuation_yes_semicolon}
3097
3098\defcsname\??mathautopunctuation\v!all\string,semicolon\endcsname
3099 {\letcharcode\commaasciicode \math_punctuation_all_comma
3100 \letcharcode\periodasciicode \math_punctuation_all_period
3101 \letcharcode\semicolonasciicode\math_punctuation_all_semicolon}
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120\appendtoks
3121 \math_activeate_comma
3122 \math_activeate_period
3123 \math_activeate_semicolon
3124 \begincsname\??mathautopunctuation\mathematicsparameter\c!autopunctuation\endcsname
3125\to \everymathematics
3126
3127\appendtoks
3128 \ifcsname\??mathautopunctuation\mathematicsparameter\c!autopunctuation\endcsname \else
3129 \letmathematicsparameter\c!autopunctuation\v!no
3130 \fi
3131
3132\to \everyswitchmathematics
3133
3134\permanent\protected\def\enablemathpunctuation {\csname\??mathautopunctuation\v!no \endcsname}
3135\permanent\protected\def\disablemathpunctuation{\csname\??mathautopunctuation\v!yes\endcsname}
3136
3137\setupmathematics
3138 [\c!autopunctuation=\v!no]
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167\installcorenamespace{autospacing}
3168
3169\permanent\protected\def\enablemathautospacing
3170 {\attribute\mathspacingattribute\plusone
3171 \clf_initializemathspacing}
3172
3173\permanent\protected\def\disablemathautospacing
3174 {\attribute\mathspacingattribute\attributeunsetvalue}
3175
3176\appendtoks
3177 \ifcstok{\mathematicsparameter\c!autospacing}\v!yes
3178 \enablemathautospacing
3179 \else
3180 \disablemathautospacing
3181 \fi
3182
3183\to \everyswitchmathematics
3184
3185\setupmathematics
3186 [\c!autospacing=\v!no]
3187
3188\permanent\protected\def\enablemathautonumbers
3189 {\attribute\mathnumbersattribute\plusone
3190 \clf_initializemathnumbers}
3191
3192\permanent\protected\def\disablemathautonumbers
3193 {\attribute\mathnumbersattribute\attributeunsetvalue}
3194
3195\appendtoks
3196 \edef\p_autonumbers{\mathematicsparameter\c!autonumbers}
3197 \ifchknum\p_autonumbers\or
3198 \enablemathautonumbers
3199 \attribute\mathnumbersattribute\p_autonumbers\relax
3200 \orelse\ifx\p_autonumbers\v!no
3201 \disablemathautonumbers
3202 \else
3203 \enablemathautonumbers
3204 \fi
3205
3206\to \everyswitchmathematics
3207
3208\setupmathematics
3209 [\c!autonumbers=\v!no]
3210
3211\installcorenamespace{autofencing}
3212
3213\permanent\protected\def\enablemathautofencing
3214 {\attribute\mathfencingattribute\plusone
3215 \clf_initializemathfencing}
3216
3217\permanent\protected\def\disablemathautofencing
3218 {\attribute\mathfencingattribute\attributeunsetvalue}
3219
3220\appendtoks
3221 \ifcstok{\mathematicsparameter\c!autofencing}\v!yes
3222 \enablemathautofencing
3223 \autofences
3224 \else
3225 \disablemathautofencing
3226 \fi
3227
3228\to \everyswitchmathematics
3229
3230\setupmathematics
3231 [\c!autofencing=\v!no]
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260\permanent\def\uncramped#1
3261 {\beginmathgroup
3262 \ifmathstyle
3263 \or \displaystyle \or
3264 \or \textstyle \or
3265 \or \scriptstyle \or
3266 \or \scriptscriptstyle \fi
3267 #1
3268 \endmathgroup}
3269
3270\permanent\def\cramped#1
3271 {\beginmathgroup
3272 \ifmathstyle
3273 \crampeddisplaystyle \or \or
3274 \crampedtextstyle \or \or
3275 \crampedscriptstyle \or \or
3276 \crampedscriptscriptstyle \fi
3277 #1
3278 \endmathgroup}
3279
3280\permanent\def\triggermathstyle#1{\givenmathstyle{\numexpr#1\relax}}
3281
3282\permanent\let\mathstyletrigger \firstofoneargument
3283
3284\def\triggeredmathstyle#1{\givenmathstyle\numexpr\number#1\relax}
3285
3286\permanent\def\triggeredmathstyleparameter#1
3287 {\ifcase\numexpr\normalmathstyle\relax
3288 #1\displaystyle \or
3289 #1\crampeddisplaystyle \or
3290 #1\textstyle \or
3291 #1\crampedtextstyle \or
3292 #1\scriptstyle \or
3293 #1\crampedscriptstyle \or
3294 #1\scriptscriptstyle \or
3295 #1\crampedscriptscriptstyle \else
3296
3297 \fi}
3298
3299\permanent\def\mathstylefont#1
3300 {\ifcase\numexpr#1\relax
3301 \textfont \or
3302 \textfont \or
3303 \textfont \or
3304 \textfont \or
3305 \scriptfont \or
3306 \scriptfont \or
3307 \scriptscriptfont \or
3308 \scriptscriptfont \else
3309 \textfont
3310 \fi\fam}
3311
3312\permanent\def\somemathstylefont#1
3313 {\ifcase\numexpr#1\relax
3314 \textfont \or
3315 \textfont \or
3316 \textfont \or
3317 \textfont \or
3318 \scriptfont \or
3319 \scriptfont \or
3320 \scriptscriptfont \or
3321 \scriptscriptfont \else
3322 \textfont
3323 \fi}
3324
3325\permanent\def\mathsmallstylefont#1
3326 {\ifcase\numexpr#1\relax
3327 \scriptfont \or
3328 \scriptfont \or
3329 \scriptfont \or
3330 \scriptfont \or
3331 \scriptscriptfont \or
3332 \scriptscriptfont \or
3333 \scriptscriptfont \or
3334 \scriptscriptfont \else
3335 \scriptfont
3336 \fi\fam}
3337
3338\permanent\def\mathstyleface#1
3339 {\ifcase\numexpr#1\relax
3340 \textface \or
3341 \textface \or
3342 \textface \or
3343 \textface \or
3344 \scriptface \or
3345 \scriptface \or
3346 \scriptscriptface \or
3347 \scriptscriptface \else
3348 \textface
3349 \fi}
3350
3351
3352
3353
3354\permanent\def\mathsmallstyleface#1
3355 {\ifcase\numexpr#1\relax
3356 \scriptface \or
3357 \scriptface \or
3358 \scriptface \or
3359 \scriptface \or
3360 \scriptscriptface \or
3361 \scriptscriptface \or
3362 \scriptscriptface \or
3363 \scriptscriptface \else
3364 \scriptface
3365 \fi}
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380\permanent\def\mathstylecommand#1#2#3
3381 {\ifcase\numexpr\normalmathstyle\relax
3382 \expandafter#1\or
3383 \expandafter#1\or
3384 \expandafter#1\or
3385 \expandafter#1\or
3386 \expandafter#2\or
3387 \expandafter#2\or
3388 \expandafter#3\or
3389 \expandafter#3\else
3390 \expandafter#1\fi}
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405\permanent\protected\def\verbosemathstyle#1
3406 {{\normalexpanded{\relax\darkgray\ttxx[\number#1:\ifcase\numexpr#1\relax
3407 display\or
3408 crampeddisplay\or
3409 text\or
3410 crampedtext\or
3411 script\or
3412 crampedscript\or
3413 scriptscript\or
3414 crampedscriptscript\else
3415 unknown\fi]}}}
3416
3417\permanent\protected\def\showmathstyle{\verbosemathstyle\normalmathstyle}
3418
3419
3420
3421\permanent\def\mathcharwd{\scaledfontcharwd\mathstylefont\normalmathstyle}
3422\permanent\def\mathcharht{\scaledfontcharht\mathstylefont\normalmathstyle}
3423\permanent\def\mathchardp{\scaledfontchardp\mathstylefont\normalmathstyle}
3424
3425
3426
3427\aliased \let\mathexheight \exheight
3428\permanent\def\mathemwidth {\Umathquad\normalmathstyle}
3429
3430
3431
3432\permanent\def\mathpalette#1#2
3433 {\mathchoice
3434 {#1\displaystyle {#2}}
3435 {#1\textstyle {#2}}
3436 {#1\scriptstyle {#2}}
3437 {#1\scriptscriptstyle{#2}}}
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462\permanent\protected\def\crampedllap#1{\llap{\cramped#1}}
3463\permanent\protected\def\crampedrlap#1{\rlap{\cramped#1}}
3464\permanent\protected\def\crampedclap#1{\clap{\cramped#1}}
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476\permanent\protected\def\mathstylehbox#1#
3477 {\math_style_hbox{#1}}
3478
3479\protected\def\math_style_hbox#1#2
3480 {\normalexpanded{\hbox#1\bgroup
3481 \startimath\triggeredmathstyle\normalmathstyle}\mathsurround\zeropoint#2\stopimath\egroup}
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493\permanent\protected\def\mathstylevbox#1
3494 {\normalexpanded{\vbox\bgroup
3495 \startimath\triggeredmathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup}
3496
3497\permanent\protected\def\mathstylevcenter#1
3498 {\normalexpanded{\vcenter\bgroup
3499 \startimath\triggeredmathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup}
3500
3501\permanent\protected\def\mathstylevcenteredhbox#1
3502 {\normalexpanded{\vcenter\bgroup\hbox\bgroup
3503 \startimath\triggeredmathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup\egroup}
3504
3505\permanent\protected\def\mathstylevcenteredvbox#1
3506 {\normalexpanded{\vcenter\bgroup\vbox\bgroup
3507 \startimath\triggeredmathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup\egroup}
3508
3509\permanent\protected\def\setmathsmalltextbox#1#2#
3510 {\normalizebodyfontsize\m_math_text_choice_face{\mathsmallstyleface\normalmathstyle}
3511 \setbox#1#2\bgroup
3512 \font_basics_switchtobodyfont\m_math_text_choice_face
3513 \let\next}
3514
3515\permanent\protected\def\setmathtextbox#1#2#
3516 {\normalizebodyfontsize\m_math_text_choice_face{\mathstyleface\normalmathstyle}
3517 \setbox#1#2\bgroup
3518 \font_basics_switchtobodyfont\m_math_text_choice_face
3519 \let\next}
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542\permanent\def\triggerdisplaystyle
3543 {\ifmathstyle
3544 \displaystyle \or
3545 \crampeddisplaystyle \or
3546 \displaystyle \or
3547 \crampeddisplaystyle \or
3548 \displaystyle \or
3549 \crampeddisplaystyle \or
3550 \displaystyle \or
3551 \crampeddisplaystyle \or
3552 \fi}
3553
3554\permanent\def\triggertextstyle
3555 {\ifmathstyle
3556 \textstyle \or
3557 \crampedtextstyle \or
3558 \textstyle \or
3559 \crampedtextstyle \or
3560 \textstyle \or
3561 \crampedtextstyle \or
3562 \textstyle \or
3563 \crampedtextstyle \else
3564 \fi}
3565
3566\permanent\def\triggerscriptstyle
3567 {\ifmathstyle
3568 \scriptstyle \or
3569 \crampedscriptstyle \or
3570 \scriptstyle \or
3571 \crampedscriptstyle \or
3572 \scriptstyle \or
3573 \crampedscriptstyle \or
3574 \scriptstyle \or
3575 \crampedscriptstyle \or
3576 \fi}
3577
3578\permanent\def\triggerscriptscriptstyle
3579 {\ifmathstyle
3580 \scriptscriptstyle \or
3581 \crampedscriptscriptstyle \or
3582 \scriptscriptstyle \or
3583 \crampedscriptscriptstyle \or
3584 \scriptscriptstyle \or
3585 \crampedscriptscriptstyle \or
3586 \scriptscriptstyle \or
3587 \crampedscriptscriptstyle \or
3588 \fi}
3589
3590\permanent\def\triggeruncrampedstyle
3591 {\ifmathstyle
3592 \currentlysetmathstyle\or
3593 \displaystyle \or
3594 \currentlysetmathstyle\or
3595 \textstyle \or
3596 \currentlysetmathstyle\or
3597 \scriptstyle \or
3598 \currentlysetmathstyle\or
3599 \scriptscriptstyle
3600 \fi}
3601
3602\permanent\def\triggercrampedstyle
3603 {\ifmathstyle
3604 \crampeddisplaystyle \or
3605 \currentlysetmathstyle \or
3606 \crampedtextstyle \or
3607 \currentlysetmathstyle \or
3608 \crampedscriptstyle \or
3609 \currentlysetmathstyle \or
3610 \crampedscriptscriptstyle\or
3611 \currentlysetmathstyle
3612 \fi}
3613
3614\permanent\def\triggersmallstyle
3615 {\ifmathstyle
3616 \scriptstyle \or
3617 \crampedscriptstyle \or
3618 \scriptstyle \or
3619 \crampedscriptstyle \or
3620 \scriptscriptstyle \or
3621 \crampedscriptscriptstyle \or
3622 \scriptscriptstyle \or
3623 \crampedscriptscriptstyle \or
3624 \fi}
3625
3626\permanent\def\triggeruncrampedsmallstyle
3627 {\ifmathstyle
3628 \scriptstyle \or
3629 \scriptstyle \or
3630 \scriptstyle \or
3631 \scriptstyle \or
3632 \scriptscriptstyle \or
3633 \scriptscriptstyle \or
3634 \scriptscriptstyle \or
3635 \scriptscriptstyle \or
3636 \fi}
3637
3638\permanent\def\triggercrampedsmallstyle
3639 {\ifmathstyle
3640 \crampedscriptstyle \or
3641 \crampedscriptstyle \or
3642 \crampedscriptstyle \or
3643 \crampedscriptstyle \or
3644 \crampedscriptscriptstyle \or
3645 \crampedscriptscriptstyle \or
3646 \crampedscriptscriptstyle \or
3647 \crampedscriptscriptstyle \or
3648 \fi}
3649
3650\permanent\def\triggerbigstyle
3651 {\ifmathstyle
3652 \displaystyle \or
3653 \crampeddisplaystyle \or
3654 \textstyle \or
3655 \crampedtextstyle \or
3656 \textstyle \or
3657 \crampedtextstyle \or
3658 \scriptstyle \or
3659 \crampedscriptstyle \or
3660 \fi}
3661
3662\permanent\def\triggeruncrampedbigstyle
3663 {\ifmathstyle
3664 \displaystyle \or
3665 \displaystyle \or
3666 \textstyle \or
3667 \textstyle \or
3668 \textstyle \or
3669 \textstyle \or
3670 \scriptstyle \or
3671 \scriptstyle \or
3672 \fi}
3673
3674\permanent\def\triggercrampedbigstyle
3675 {\ifmathstyle
3676 \crampeddisplaystyle \or
3677 \crampeddisplaystyle \or
3678 \crampedtextstyle \or
3679 \crampedtextstyle \or
3680 \crampedtextstyle \or
3681 \crampedtextstyle \or
3682 \crampedscriptstyle \or
3683 \crampedscriptstyle \or
3684 \fi}
3685
3686\newinteger\c_math_saved_style
3687
3688\permanent\protected\def\pushmathstyle
3689 {\c_math_saved_style\mathstyle}
3690
3691\permanent\protected\def\popmathstyle
3692 {\ifnum\mathstyle=\c_math_saved_style\else
3693 \triggermathstyle\c_math_saved_style
3694 \fi}
3695
3696\installcorenamespace{mathstylecommand}
3697\installcorenamespace{mathstylecachem}
3698\installcorenamespace{mathstylecachet}
3699
3700\newconstant\c_math_styles_state_style
3701\newconstant\c_math_styles_state_cramped
3702\newconstant\c_math_styles_state_size
3703
3704\def\math_style_add_to_cache_choice {
3705 \ifcase\c_math_styles_state_size
3706 \ifcase\c_math_styles_state_style
3707 \ifcase\c_math_styles_state_cramped
3708 \currentlysetmathstyle\or
3709 \triggeruncrampedstyle\or
3710 \triggercrampedstyle \fi
3711 \or\ifcase\c_math_styles_state_cramped
3712 \ifmode\triggerdisplaystyle\else\displaystyle\fi
3713 \or\displaystyle\or\crampeddisplaystyle\fi
3714 \or\ifcase\c_math_styles_state_cramped
3715 \ifmode\triggertextstyle\else\textstyle\fi
3716 \or\textstyle\or\crampedtextstyle\fi
3717 \or\ifcase\c_math_styles_state_cramped
3718 \ifmode\triggerscriptstyle\else\scriptstyle\fi
3719 \or\scriptstyle\or\crampedscriptstyle\fi
3720 \or\ifcase\c_math_styles_state_cramped
3721 \ifmode\triggerscriptscriptstyle\else\scriptscriptstyle\fi
3722 \or\scriptscriptstyle\or\crampedscriptscriptstyle\fi
3723 \fi
3724 \or
3725 \ifcase\c_math_styles_state_style
3726 \ifcase\c_math_styles_state_cramped
3727 \triggersmallstyle \or
3728 \triggeruncrampedsmallstyle\or
3729 \triggercrampedsmallstyle \fi
3730 \or\ifcase\c_math_styles_state_cramped
3731 \ifmode\triggerscriptstyle\else\scriptstyle\fi
3732 \or\scriptstyle\or\crampedscriptstyle\fi
3733 \or\ifcase\c_math_styles_state_cramped
3734 \ifmode\triggerscriptstyle\else\scriptstyle\fi
3735 \or\scriptstyle\or\crampedscriptstyle\fi
3736 \or\ifcase\c_math_styles_state_cramped
3737 \ifmode\triggerscriptscriptstyle\else\scriptscriptstyle\fi
3738 \or\scriptscriptstyle\or\crampedscriptscriptstyle\fi
3739 \or\ifcase\c_math_styles_state_cramped
3740 \ifmode\triggerscriptscriptstyle\else\scriptscriptstyle\fi
3741 \or\scriptscriptstyle\or\crampedscriptscriptstyle\fi
3742 \fi
3743 \or
3744 \ifcase\c_math_styles_state_style
3745 \ifcase\c_math_styles_state_cramped
3746 \triggerbigstyle \or
3747 \triggeruncrampedbigstyle\or
3748 \triggercrampedbigstyle \fi
3749 \or\ifcase\c_math_styles_state_cramped
3750 \ifmode\triggerdisplaystyle\else\displaystyle\fi
3751 \or\displaystyle\or\crampeddisplaystyle\fi
3752 \or\ifcase\c_math_styles_state_cramped
3753 \ifmode\triggertextstyle\else\textstyle\fi
3754 \or\textstyle\or\crampedtextstyle\fi
3755 \or\ifcase\c_math_styles_state_cramped
3756 \ifmode\triggertextstyle\else\textstyle\fi
3757 \or\textstyle\or\crampedtextstyle\fi
3758 \or\ifcase\c_math_styles_state_cramped
3759 \ifmode\triggerscriptstyle\else\scriptstyle\fi
3760 \or\scriptstyle\or\crampedscriptstyle\fi
3761 \fi
3762 \else
3763 \currentlysetmathstyle
3764 \fi
3765}
3766
3767\permanent\def\installmathstyle#1#2
3768 {\ifcsname\??mathstylecommand#1\endcsname \else
3769 \defcsname\??mathstylecommand#1\endcsname{#2}
3770 \fi}
3771
3772\def\math_style_collect#1
3773 {\csname\??mathstylecommand#1\endcsname}
3774
3775\defcsname\??mathstylecommand\s!display \endcsname{\indisplaymath\conditionaltrue \c_math_styles_state_style\plusone}
3776\defcsname\??mathstylecommand\s!text \endcsname{\indisplaymath\conditionalfalse\c_math_styles_state_style\plustwo}
3777\defcsname\??mathstylecommand\s!script \endcsname{\indisplaymath\conditionalfalse\c_math_styles_state_style\plusthree}
3778\defcsname\??mathstylecommand\s!scriptscript\endcsname{\indisplaymath\conditionalfalse\c_math_styles_state_style\plusfour}
3779
3780\defcsname\??mathstylecommand\s!uncramped \endcsname{\c_math_styles_state_cramped\plusone}
3781\defcsname\??mathstylecommand\s!cramped \endcsname{\c_math_styles_state_cramped\plustwo}
3782\defcsname\??mathstylecommand\v!normal \endcsname{\c_math_styles_state_cramped\plusone}
3783\defcsname\??mathstylecommand\v!packed \endcsname{\c_math_styles_state_cramped\plustwo}
3784
3785\defcsname\??mathstylecommand\v!small \endcsname{\c_math_styles_state_size\plusone}
3786\defcsname\??mathstylecommand\v!big \endcsname{\c_math_styles_state_size\plustwo}
3787
3788
3789
3790
3791
3792
3793\immutable\def\m_math_styles_current
3794 {\ifmathstyle \s!display
3795 \or \s!text
3796 \or \s!text,\s!cramped
3797 \or \s!script
3798 \or \s!script,\s!cramped
3799 \or \s!scriptscript
3800 \or \s!scriptscript,\s!cramped
3801 \fi}
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830\installcorenamespace {mathstyle}
3831
3832\letcsname\??mathstyle \endcsname\empty
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855\permanent\def\expandedmathstyleparameter#1#2
3856 {\ifcstok{#1#2}\emptytoks
3857 \mathstyle
3858 \else
3859 \expandafter\math_style_set_expanded\expandafter{\lastnamedcs}
3860 \fi}
3861
3862\def\math_style_set_expanded#1
3863 {\ifcsname\??mathstyle#1\endcsname
3864 \lastnamedcs
3865 \orelse\ifcsname\ifmmode\??mathstylecachem\the\mathstyle:\else\??mathstylecachet\fi#1\endcsname
3866 \lastnamedcs
3867 \else
3868 \math_style_set_mathstyle_mathstylecache{#1}
3869 \fi}
3870
3871\def\math_style_set_main{\indisplaymath\ifcase\mathstyle\conditionaltrue\else\conditionalfalse\fi}
3872
3873\def\math_style_set_indeed
3874 {\ifcsname\??mathstyle\m_math_style_asked\endcsname
3875 \lastnamedcs
3876 \orelse\ifcsname\ifmmode\??mathstylecachem\the\mathstyle:\else\??mathstylecachet\fi\m_math_style_asked\endcsname
3877 \lastnamedcs
3878 \else
3879 \math_style_set_mathstyle_mathstylecache\m_math_style_asked
3880 \fi
3881 \math_style_set_main}
3882
3883\permanent\protected\def\usemathstyleparameter#1#2
3884 {\edef\m_math_style_asked{#1#2}
3885 \ifempty\m_math_style_asked \else
3886 \math_style_set_indeed
3887 \fi}
3888
3889\permanent\tolerant\protected\def\setmathstyle[#1]#;#=
3890 {\edef\m_math_style_asked{#1#2\c!mathstyle}
3891 \ifempty\m_math_style_asked \else
3892 \math_style_set_indeed
3893 \fi}
3894
3895\permanent\protected\def\setupmathstyle[#1]
3896 {\edef\m_math_style_asked{#1}
3897 \ifempty\m_math_style_asked \else
3898 \math_style_set_indeed
3899 \fi}
3900
3901\def\math_style_set_mathstyle_mathstylecache#1
3902 {\beginlocalcontrol
3903 \edef\m_math_style_asked{#1}
3904 \c_math_styles_state_style \zerocount
3905 \c_math_styles_state_cramped\zerocount
3906 \c_math_styles_state_size \zerocount
3907 \rawprocesscommacommand[\m_math_style_asked]\math_style_collect
3908 \gletcsname\ifmmode\??mathstylecachem\the\mathstyle:\else\??mathstylecachet\fi\m_math_style_asked\normalexpanded
3909 {\endcsname\math_style_add_to_cache_choice}
3910 \endlocalcontrol
3911 \csname\ifmmode\??mathstylecachem\the\mathstyle:\else\??mathstylecachet\fi\m_math_style_asked\endcsname
3912 \math_style_set_main}
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925\permanent\protected\def\startmathstyle[#1]
3926 {\edef\m_math_style_asked{#1}
3927 \ifempty\m_math_style_asked
3928 \enforced\aliased\let\stopmathstyle\relax
3929 \else
3930 \beginmathgroup
3931 \math_style_set_indeed
3932 \enforced\aliased\let\stopmathstyle\endmathgroup
3933 \fi}
3934
3935\aliased\let\stopmathstyle\relax
3936
3937\permanent\protected\def\startusemathstyleparameter#1#2
3938 {\edef\m_math_style_asked{#1#2}
3939 \ifempty\m_math_style_asked
3940 \enforced\let\stopusemathstyleparameter\relax
3941 \else
3942 \beginmathgroup
3943 \math_style_set_indeed
3944 \enforced\let\stopusemathstyleparameter\endmathgroup
3945 \fi}
3946
3947\aliased\let\stopusemathstyleparameter\relax
3948
3949
3950
3951
3952
3953\let\m_math_text_choice_face\relax
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031\installcorenamespace{mathtext}
4032
4033\installcommandhandler \??mathtext {mathtext} \??mathtext
4034
4035\setupmathtext
4036 [\s!leftclass=\mathtextparameter\s!class,
4037 \s!rightclass=\mathtextparameter\s!class,
4038 \s!class=\mathordinarycode]
4039
4040\appendtoks
4041 \frozen\protected\edefcsname\currentmathtext\endcsname{\math_text_handle{\currentmathtext}}
4042\to \everydefinemathtext
4043
4044\newtoks\everymathtext
4045
4046\tolerant\protected\def\math_text_handle_indeed#1#*[#S#2]#:#3#
4047 {\begingroup
4048 \cdef\currentmathtext{#1}
4049 \setupcurrentmathtext[#2]
4050 \normalizebodyfontsize\m_math_text_choice_face{\mathstyleface\normalmathstyle}
4051 \ifcstok{\mathtextparameter\c!alternative}\v!split
4052 \mathatom
4053 unroll
4054 class \mathcodechecked{\mathtextparameter\s!class}
4055 leftclass \mathcodechecked{\mathtextparameter\s!leftclass}
4056 rightclass \mathcodechecked{\mathtextparameter\s!rightclass}
4057 \bgroup
4058 \hbox#3\bgroup
4059 \aftergroup\egroup
4060 \aftergroup\endgroup
4061 \else
4062 \hbox#3\bgroup
4063 \atendofgroup\hss
4064 \aftergroup\endgroup
4065 \ifcstok{\mathtextparameter\c!alternative}\v!word
4066 \nospacing
4067 \fi
4068 \hss
4069 \fi
4070 \font_basics_switchtobodyfont\m_math_text_choice_face
4071 \usemathtextstyleandcolor\c!style\c!color
4072 \expand\everymathtext\relax
4073 \let\next}
4074
4075\protected\def\math_text_handle#1
4076 {\mathortext{\math_text_handle_indeed{#1}}\hbox}
4077
4078\definemathtext[mathtext]
4079\definemathtext[mathtexttf][mathtext][\c!style=\tf]
4080\definemathtext[mathtextit][mathtext][\c!style=\it]
4081\definemathtext[mathtextsl][mathtext][\c!style=\sl]
4082\definemathtext[mathtextbf][mathtext][\c!style=\bf]
4083\definemathtext[mathtextbi][mathtext][\c!style=\bi]
4084\definemathtext[mathtextbs][mathtext][\c!style=\bs]
4085
4086\definemathtext[mathword] [mathtext][\c!alternative=\v!word]
4087\definemathtext[mathwordtf][mathword][\c!style=\tf]
4088\definemathtext[mathwordit][mathword][\c!style=\it]
4089\definemathtext[mathwordsl][mathword][\c!style=\sl]
4090\definemathtext[mathwordbf][mathword][\c!style=\bf]
4091\definemathtext[mathwordbi][mathword][\c!style=\bi]
4092\definemathtext[mathwordbs][mathword][\c!style=\bs]
4093
4094\definemathtext[mathsplit] [mathtext] [\c!alternative=\v!split]
4095\definemathtext[mathsplittf][mathsplit][\c!style=\tf]
4096\definemathtext[mathsplitit][mathsplit][\c!style=\it]
4097\definemathtext[mathsplitsl][mathsplit][\c!style=\sl]
4098\definemathtext[mathsplitbf][mathsplit][\c!style=\bf]
4099\definemathtext[mathsplitbi][mathsplit][\c!style=\bi]
4100\definemathtext[mathsplitbs][mathsplit][\c!style=\bs]
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115\newconditional\c_mathtextauto
4116
4117\permanent\protected\def\automathtext{\c_mathtextauto\conditionaltrue}
4118
4119\let\currentmathalphabet \s!rm
4120\let\currentmathfontstyle\s!tf
4121
4122\permanent\protected\def\mathtextauto#1#2
4123 {\ifconditional\c_mathtextauto
4124 \mathortext
4125 {\mathpunct
4126 {\begincsname\currentmathalphabet\endcsname
4127 \begincsname mathtext\currentmathfontstyle\endcsname
4128 {#1}}}
4129 {#1}
4130 \else
4131 #2
4132 \fi}
4133
4134
4135
4136
4137
4138
4139
4140
4141\pushoverloadmode
4142 \permanent\protected\def\.{\mathtextauto{.}{.}}
4143 \permanent\protected\def\,{\mathtextauto{,}{\thinspace }}
4144 \permanent\protected\def\:{\mathtextauto{:}{\medspace }}
4145 \permanent\protected\def\;{\mathtextauto{;}{\thickspace}}
4146 \permanent\protected\def\!{\mathtextauto{!}{\negthinspace}}
4147 \permanent\protected\def\?{\mathtextauto{?}{?}}
4148\popoverloadmode
4149
4150\appendtoks \obeydiscretionaries \to \everymathtext
4151\appendtoks \ignorediscretionaries \to \everymathematics
4152
4153
4154
4155\appendtoks
4156 \enforced\let\_\normalunderscore
4157\to \everymathematics
4158
4159
4160
4161\appendtoks
4162 \enforced\let\text\mathtext
4163\to \everymathematics
4164
4165\newinteger\interdisplaylinepenalty \interdisplaylinepenalty\plushundred
4166
4167
4168
4169\permanent\protected\def\mathortext
4170 {\ifmmode
4171 \expandafter\firstoftwoarguments
4172 \else
4173 \expandafter\secondoftwoarguments
4174 \fi}
4175
4176
4177
4178
4179
4180\ifdefined\text\else \aliased\let\text\hbox \fi
4181
4182
4183
4184\newtoks\everymathoptext
4185
4186\appendtoks
4187 \let\textbar
4188\to \everymathoptext
4189
4190\permanent\protected\def\mathoptext
4191 {\normalizebodyfontsize\m_math_text_choice_face{\mathstyleface\normalmathstyle}
4192
4193 \dowithnextbox
4194 {\mathop{\box\nextbox}}
4195 \hbox\bgroup
4196 \expandtoks\everymathoptext
4197 \font_basics_switchtobodyfont
4198 \m_math_text_choice_face
4199 \let\next}
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210\newtoks\everyinsidemathematics
4211
4212\appendtoks
4213 \edef\p_setups{\mathematicsparameter\c!setups}
4214 \ifempty\p_setups\else
4215 \directsetup\p_setups
4216 \fi
4217
4218\to \everyinsidemathematics
4219
4220
4221
4222\permanent\protected\def\smallmathsymbol#1
4223 {\mathematics{\mathbin{\normalexpanded{\raise.15\exheight\hbox{\normalstartimath
4224 \triggeredmathstyle{\the\numexpr\normalmathstyle2\relax}#1
4225 \normalstopimath}}}}}
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279\def\m_math_inline_openup_ht{(\ifinsidecolumns\strutdp\else\lineheight\fi\plusfour)}
4280\def\m_math_inline_openup_dp{(\ifinsidecolumns\strutdp\else\lineheight\fi\plusfour)}
4281
4282
4283
4284
4285\installtextracker
4286 {math.openedup}
4287 {\let\math_inline_openup_start_yes\math_inline_openup_traced_start}
4288 {\let\math_inline_openup_start_yes\math_inline_openup_normal_start}
4289
4290\protected\def\math_inline_openup_normal_start
4291 {\scratchheight{\ht\scratchbox\m_math_inline_openup_ht}
4292 \scratchdepth {\dp\scratchbox\m_math_inline_openup_dp}
4293 \vrule\s!width\zeropoint\s!height\scratchheight\s!depth\scratchdepth\relax
4294 \begingroup
4295 \let\math_inline_openup_stop\math_inline_openup_normal_stop}
4296
4297\protected\def\math_inline_openup_normal_stop
4298 {\endgroup
4299 \vrule\s!width\zeropoint\s!height\scratchheight\s!depth\scratchdepth\relax}
4300
4301\protected\def\math_inline_openup_traced_start
4302 {\scratchtopoffset \ht\scratchbox
4303 \scratchbottomoffset\dp\scratchbox
4304 \scratchheight {\scratchtopoffset \m_math_inline_openup_ht}
4305 \scratchdepth {\scratchbottomoffset\m_math_inline_openup_dp}
4306 \vrule\s!width\zeropoint\s!height\scratchheight\s!depth\scratchdepth\relax
4307 \begingroup
4308 \dousecolorparameter{darkred}
4309 \vrule\s!width\emwidth\s!height\scratchheight\s!depth\scratchtopoffset\relax
4310 \endgroup
4311 \kern\emwidth
4312 \begingroup
4313 \let\math_inline_openup_stop\math_inline_openup_traced_stop}
4314
4315\protected\def\math_inline_openup_traced_stop
4316 {\endgroup
4317 \kern\emwidth
4318 \begingroup
4319 \dousecolorparameter{darkblue}
4320 \vrule\s!width\emwidth\s!height\scratchbottomoffset\s!depth\scratchdepth\relax
4321 \endgroup
4322 \vrule\s!width\zeropoint\s!height\scratchheight\s!depth\scratchdepth\relax}
4323
4324\let\math_inline_openup_start_yes\math_inline_openup_normal_start
4325\let\math_inline_openup_stop \relax
4326
4327\def\math_inline_openup_start_nop
4328 {\let\math_inline_openup_stop\relax}
4329
4330\permanent\protected\def\openedupimath
4331 {\dontleavehmode
4332 \begingroup
4333 \ifmmode
4334 \expandafter\openedupimath_math
4335 \else
4336 \expandafter\openedupimath_text
4337 \fi}
4338
4339\protected\def\openedupimath_math#1
4340 {\setbox\scratchbox\mathstylehbox{#1}
4341 \ifdim\ht\scratchbox>\strutht
4342 \math_inline_openup_start_yes
4343 \orelse\ifdim\dp\scratchbox>\strutdp
4344 \math_inline_openup_start_yes
4345 \else
4346 \math_inline_openup_start_nop
4347 \fi
4348 #1
4349 \math_inline_openup_stop
4350 \endgroup}
4351
4352\protected\def\openedupimath_text#1
4353 {\setbox\scratchbox\hbox{\startimath#1\stopimath}
4354 \ifdim\ht\scratchbox>\strutht
4355 \math_inline_openup_start_yes
4356 \orelse\ifdim\dp\scratchbox>\strutdp
4357 \math_inline_openup_start_yes
4358 \else
4359 \math_inline_openup_start_nop
4360 \fi
4361 \startimath
4362 #1
4363 \stopimath
4364 \math_inline_openup_stop
4365 \endgroup}
4366
4367
4368
4369
4370
4371\permanent\protected\def\mathplus {}
4372\permanent\protected\def\mathminus {\ifmmode –\orelse\iffontchar\font−−\else –\fi}
4373\permanent\protected\def\mathplusminus{±}
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400\newinteger\c_math_domain_attribute
4401
4402\appendtoks
4403 \edef\p_domain{\mathematicsparameter\c!domain}
4404 \ifempty\p_domain
4405 \c_math_domain_attribute\attributeunsetvalue
4406 \else
4407 \c_math_domain_attribute\clf_domainattribute{\p_domain}\relax
4408 \fi
4409\to \everyswitchmathematics
4410
4411\appendtoks
4412 \c_attr_mathdomain\c_math_domain_attribute
4413\to \everymathematics
4414
4415
4416
4417\installcorenamespace{mathrules}
4418
4419\permanent\protected\def\enablemathrules{\gletcsname\??mathrules\fontclass\endcsname\plusone}
4420
4421\appendtoks
4422 \mathrulesmode\ifcsname\??mathrules\fontclass\endcsname
4423 \lastnamedcs
4424 \else
4425 \zerocount
4426 \fi
4427 \mathrulesfam\zerocount
4428\to \everymathematics
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482\permanent\protected\def\math_scripts_stack
4483 {\c_attr_mathunstack\attributeunsetvalue}
4484
4485\permanent\protected\def\math_scripts_unstack
4486 {\clf_enablescriptunstacking
4487 \c_attr_mathunstack\plustwo}
4488
4489\ifdefined\stackscripts \else \aliased\let\stackscripts \relax \fi
4490\ifdefined\unstackscripts \else \aliased\let\unstackscripts\relax \fi
4491
4492\appendtoks
4493 \enforced\let\stackscripts \math_scripts_stack
4494 \enforced\let\unstackscripts\math_scripts_unstack
4495\to \everymathematics
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537\permanent\protected\def\mathopenupparameter#1#2
4538 {\ifmathparameter#1\displaystyle \or\frozen#1\displaystyle #2#1\displaystyle \fi
4539 \ifmathparameter#1\crampeddisplaystyle \or\frozen#1\crampeddisplaystyle #2#1\crampeddisplaystyle \fi
4540 \ifmathparameter#1\textstyle \or\frozen#1\textstyle #2#1\textstyle \fi
4541 \ifmathparameter#1\crampedtextstyle \or\frozen#1\crampedtextstyle #2#1\crampedtextstyle \fi
4542 \ifmathparameter#1\scriptstyle \or\frozen#1\scriptstyle #2#1\scriptstyle \fi
4543 \ifmathparameter#1\crampedscriptstyle \or\frozen#1\crampedscriptstyle #2#1\crampedscriptstyle \fi
4544 \ifmathparameter#1\scriptscriptstyle \or\frozen#1\scriptscriptstyle #2#1\scriptscriptstyle \fi
4545 \ifmathparameter#1\crampedscriptscriptstyle\or\frozen#1\crampedscriptscriptstyle#2#1\crampedscriptscriptstyle\fi}
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563\permanent\protected\def\tomathord {\Umathclass\zerocount}
4564\permanent\protected\def\tomathop {\Umathclass\plusone }
4565\permanent\protected\def\tomathbin {\Umathclass\plustwo }
4566\permanent\protected\def\tomathrel {\Umathclass\plusthree}
4567\permanent\protected\def\tomathopen {\Umathclass\plusfour }
4568\permanent\protected\def\tomathclose{\Umathclass\plusfive }
4569\permanent\protected\def\tomathpunct{\Umathclass\plussix }
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603\normalsupmarkmode\plusone
4604
4605\permanent\protected\tolerant\def\supscr[#1]#:#2
4606 {\ifchkdimension#1\or\Umathopenupheight\lastchkdimension\fi
4607 \superscript{#2}}
4608
4609\permanent\protected\tolerant\def\subscr[#1]#:#2
4610 {\ifchkdimension#1\or\Umathopenupdepth\lastchkdimension\fi
4611 \subscript{#2}}
4612
4613\permanent\protected\tolerant\def\supsubscr[#1]#:#2#3
4614 {\ifchkdimension#1\or\Umathopenupheight\lastchkdimension\Umathopenupdepth\lastchkdimension\relax\fi
4615 \superscript{#2}\subscript{#3}}
4616
4617\permanent\protected\tolerant\def\subsupscr[#1]#:#*#2#3
4618 {\ifchkdimension#1\or\Umathopenupheight\lastchkdimension\Umathopenupdepth\lastchkdimension\relax\fi
4619 \subscript{#2}\superscript{#3}}
4620
4621\permanent\protected\tolerant\def\supprescr[#1]#:#2
4622 {\ifchkdimension#1\or\Umathopenupheight\lastchkdimension\fi
4623 \superprescript{#2}}
4624
4625\permanent\protected\tolerant\def\subprescr[#1]#:#2
4626 {\ifchkdimension#1\or\Umathopenupdepth\lastchkdimension\fi
4627 \subprescript{#2}}
4628
4629\permanent\protected\tolerant\def\supsubprescr[#1]#:#2#3
4630 {\ifchkdimension#1\or\Umathopenupheight\lastchkdimension\Umathopenupdepth\lastchkdimension\fi
4631 \superprescript{#2}\subprescript{#3}}
4632
4633\permanent\protected\tolerant\def\subsupprescr[#1]#:#*#2#3
4634 {\ifchkdimension#1\or\Umathopenupheight\lastchkdimension\Umathopenupdepth\lastchkdimension\fi
4635 \subprescript{#2}\superprescript{#3}}
4636
4637
4638
4639\def\math_relax_limits{\enforced\let\limits\relax}
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664\installcorenamespace{mathspacing}
4665
4666\permanent\tolerant\protected\def\definemathspacing[#1]#*[#2]#*[#3]
4667 {\ifcstok{#2}\v!horizontal
4668 \edefcsname\??mathspacing#1\endcsname
4669 {\Umathxscale\allmathstyles\ifchknum#3\or#3\else\plusthousand\fi\relax}
4670 \orelse\ifcstok{#2}\v!vertical
4671 \edefcsname\??mathspacing#1\endcsname
4672 {\Umathyscale\allmathstyles\ifchknum#3\or#3\else\plusthousand\fi\relax}
4673 \else
4674 \edefcsname\??mathspacing#1\endcsname
4675 {\Umathxscale\allmathstyles\ifchknum#2\or\number#2\else\plusthousand\fi\relax
4676 \Umathyscale\allmathstyles\ifchknum#3\or\number#3\orelse\ifchknum#2\or\number#2\else\plusthousand\fi\relax}
4677 \fi}
4678
4679\definemathspacing[\v!normal] [1000] [1000]
4680\definemathspacing[\v!tight] [\c!vertical] [900]
4681\definemathspacing[\v!loose] [\c!vertical] [1100]
4682\definemathspacing[\v!narrow][\c!horizontal] [900]
4683\definemathspacing[\v!wide] [\c!horizontal] [1100]
4684\definemathspacing[\v!less] [900] [900]
4685\definemathspacing[\v!more] [1100] [1100]
4686
4687\permanent\protected\def\setupmathspacing[#1]
4688 {\begincsname\??mathspacing#1\endcsname}
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708\mathdisplaymode\plusone
4709
4710
4711
4712\immutable\integerdef\c_math_glyph_options_default\numexpr
4713 \noexpansionglyphoptioncode
4714 \noprotrusionglyphoptioncode
4715\relax
4716
4717\immutable\integerdef\c_math_glyph_options_hz\numexpr
4718 \noprotrusionglyphoptioncode
4719\relax
4720
4721\appendtoks
4722 \ifcstok{\mathematicsparameter\c!hz}\v!yes
4723 \glyphoptions\c_math_glyph_options_hz
4724 \else
4725 \glyphoptions\c_math_glyph_options_default
4726 \fi
4727\to \everymathematics
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741\def\math_italics_initialize
4742 {\clf_initializemathitalics
4743 \gdef\math_italics_initialize{\bitwiseflip\glyphoptions\mathcheckitalicglyphoptioncode}
4744 \math_italics_initialize}
4745
4746\appendtoks
4747 \ifcstok{\mathematicsparameter\s!italics}\v!yes
4748 \math_italics_initialize
4749 \fi
4750\to \everymathematics
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762\aliased\let\mathtraversecommand\relax
4763
4764\permanent\protected\def\traversemath#1#2#3#4
4765 {\pushmacro\mathtraversecommand
4766 \enforced\def\mathtraversecommand##1{#4}
4767 \clf_traversemath{#1}{#2}{#3}\mathtraversecommand
4768 \popmacro\mathtraversecommand}
4769
4770\permanent\protected\def\traverseblock#1#2
4771 {\pushmacro\mathtraversecommand
4772 \enforced\def\mathtraversecommand##1{#2}
4773 \clf_traverseblock{#1}\mathtraversecommand
4774 \popmacro\mathtraversecommand}
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805\scriptspace\zeropoint
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817\permanent\tolerant\def\mathdigits#1
4818 {\ifmmode
4819 \mathatom \s!class \mathdigitcode \s!all \mathdigitcode {#1}
4820 \else
4821 #1
4822 \fi}
4823
4824\permanent\tolerant\protected\def\base[#1]#*#:#2
4825 {\ifmmode
4826 \mathdigits{\tf#2}\ifparameter#1\or\subscript{\mathdigits{\tf#1}}\fi
4827 \else
4828 #2\ifparameter#1\or\low{#1}\fi
4829 \fi}
4830
4831
4832
4833\permanent\tolerant\protected\def\definemathgroupset[#1]#*[#2]
4834 {\clf_registergroupset{#1}{#2}}
4835
4836\permanent\tolerant\protected\def\setmathgroupset[#1]
4837 {\mathdictgroup\clf_groupsetgroup{#1}\relax}
4838
4839\setmathgroupset
4840 [every]
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854\definesystemattribute[mathaxis][public]
4855
4856\def\math_axis_inject_indeed#1
4857 {\srule
4858 \s!height {
4859 (\scratchdimentwo\scratchdimenone)*
4860 \ifnum\c_math_m_scaled=\plusthousand
4861 \glyphscale\plusthousand
4862 \else
4863 \c_math_m_scaled*\glyphscale\plusthousand\plusthousand
4864 \fi
4865 }
4866 \s!depth {
4867 (\scratchdimentwo\scratchdimenone)*
4868 \ifnum\c_math_m_scaled=\plusthousand
4869 \glyphscale\plusthousand
4870 \else
4871 \c_math_m_scaled*\glyphscale\plusthousand\plusthousand
4872 \fi
4873 }
4874 \s!attr \mathaxisattribute#1
4875 \relax}
4876
4877\def\math_axis_inject#1#2
4878 {\mathatom \s!class \mathghostcode \s!unpack {
4879 \showmakeup[strut]
4880 \ifcase#1
4881
4882 \or
4883 \scratchdimenone.5\Umathfractionrule\mathstyle
4884 \scratchdimentwo\Umathaxis\mathstyle
4885 \math_axis_inject_indeed#2
4886 \or
4887 \scratchdimenone.25\Umathfractionrule\mathstyle
4888 \scratchdimentwo\Umathsupshiftup\mathstyle
4889 \math_axis_inject_indeed#2
4890 \scratchdimentwo\Umathsubshiftdown\mathstyle
4891 \math_axis_inject_indeed#2
4892 \scratchdimentwo\Umathsubsupshiftdown\mathstyle
4893 \math_axis_inject_indeed#2
4894
4895 \divideby\scratchdimenone\plustwo
4896 \scratchdimentwo\Umathprimeshiftup\mathstyle
4897 \math_axis_inject_indeed#2
4898 \fi}}
4899
4900\permanent\protected\def\mathaxisbelow {\math_axis_inject\plusone\plusone}
4901\permanent\protected\def\mathaxisontop {\math_axis_inject\plusone\plustwo}
4902\permanent\protected\def\mathscriptbelow{\math_axis_inject\plustwo\plusone}
4903\permanent\protected\def\mathscriptontop{\math_axis_inject\plustwo\plustwo}
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918\mathinlinepenaltyfactor = 1500
4919\mathdisplaypenaltyfactor = 1000
4920
4921\setmathpostpenalty\mathpunctuationcode\plustenthousand
4922
4923\installcorenamespace{mathnesting}
4924
4925\installcommandhandler \??mathnesting {mathnesting} \??mathnesting
4926
4927\appendtoks
4928 \frozen\protected\instance\edefcsname\currentmathnesting\endcsname{\math_nesting[\currentmathnesting]}
4929\to \everydefinemathnesting
4930
4931\newconstant\c_math_boundary_old
4932\newconstant\c_math_boundary_new
4933
4934\protected\tolerant\def\math_nesting[#1]#*[#S#2]
4935 {\groupedcommand
4936 {\cdef\currentmathnesting{#1}
4937 \setupcurrentmathnesting[#2]
4938 \mathnestingparameter\c!left
4939 \c_math_boundary_old\c_math_boundary_new
4940 \c_math_boundary_new
4941 \ifconditional\indisplaymath
4942 \ifchknum\mathnestingparameter\c!displayfactor\or\lastnamedcs\else\mathdisplaypenaltyfactor\fi
4943 \else
4944 \ifchknum\mathnestingparameter\c!inlinefactor \or\lastnamedcs\else\mathinlinepenaltyfactor \fi
4945 \fi
4946 \relax
4947 \mathboundary\plustwo \c_math_boundary_new}
4948 {\mathboundary\plusthree\c_math_boundary_old
4949 \mathnestingparameter\c!right}}
4950
4951\permanent\tolerant\protected\def\mathnesting[#1]
4952 {\groupedcommand
4953 {\c_math_boundary_old\c_math_boundary_new
4954 \c_math_boundary_new\ifchknum#1\or#1\orelse\ifconditional\indisplaymath\mathdisplaypenaltyfactor\else\mathinlinepenaltyfactor\fi\relax
4955 \mathboundary\plustwo \c_math_boundary_new}
4956 {\mathboundary\plusthree\c_math_boundary_old}}
4957
4958
4959
4960
4961\definemathnesting[mathtogether][\c!inlinefactor=1500]
4962\definemathnesting[mathloose] [\c!inlinefactor=0500]
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984\setupmathematics
4985 [\c!snap=\v!no]
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000\installcorenamespace {mathannotation}
5001
5002\installcommandhandler \??mathannotation {mathannotation} \??mathannotation
5003
5004\setupmathannotation
5005 [\c!top=,
5006 \c!bottom=,
5007 \c!strut=\v!yes,
5008 \c!mathclass=\mathconstructcode]
5009
5010\appendtoks
5011 \frozen\protected\tolerant\edefcsname\currentmathannotation\endcsname{\math_annotation{\currentmathannotation}}
5012\to \everydefinemathannotation
5013
5014\tolerant\protected\def\math_annotation#1[#S#2]#:#3
5015 {\beginmathgroup
5016 \edef\currentmathannotation{#1}
5017 \setupcurrentmathannotation[#2]
5018 \edef\p_strut{\mathannotationparameter\c!strut}
5019 \mathatom
5020 limits
5021 \s!class\mathcodechecked{\mathannotationparameter\c!mathclass}
5022 {#3}
5023 \ifempty{\mathannotationparameter\c!top}\else
5024
5025 \superscript{
5026 \ifx\p_strut\v!yes\botstrut\fi
5027 \mtext{\mathannotationparameter\c!top}
5028 }
5029 \fi
5030 \ifempty{\mathannotationparameter\c!bottom}\else
5031
5032 \subscript{
5033 \ifx\p_strut\v!yes\topstrut\fi
5034 \mtext{\mathannotationparameter\c!bottom}
5035 }
5036 \fi
5037 \endmathgroup}
5038
5039\definemathannotation[mathannotation]
5040
5041
5042
5043\mathdoublescriptmode
5044 "\tohexadecimal\numexpr
5045 \inheritclassdoublescriptmodecode
5046 \discardshapekerndoublescriptmodecode
5047 \realignscriptsdoublescriptmodecode
5048 \reorderprescriptsdoublescriptmodecode
5049 \relax
5050 \tohexadecimal\mathcontinuationcode
5051 \tohexadecimal\mathcontinuationcode
5052 \tohexadecimal\mathcontinuationcode
5053
5054\immutable\integerdef\c_math_alignscripts_bits\numexpr
5055 "1000000 * \realignscriptsdoublescriptmodecode
5056\relax
5057
5058\immutable\integerdef\c_math_obeyempty_bits\numexpr
5059 \ignoreemptysuperscriptsmodecode
5060 \ignoreemptysubscriptsmodecode
5061 \ignoreemptyprimescriptsmodecode
5062\relax
5063
5064\letempty\m_math_alignscripts
5065
5066\def\m_math_update_alignscripts
5067 {\ifx\m_alignscripts\v!yes
5068 \bitwiseflip\mathdoublescriptmode \c_math_alignscripts_bits
5069 \bitwiseflip\mathscriptsmode \c_math_obeyempty_bits
5070 \orelse\ifx\m_alignscripts\v!always
5071 \bitwiseflip\mathdoublescriptmode \c_math_alignscripts_bits
5072 \bitwiseflip\mathscriptsmode \c_math_obeyempty_bits
5073 \orelse\ifx\m_alignscripts\v!empty
5074 \bitwiseflip\mathdoublescriptmode\c_math_alignscripts_bits
5075 \bitwiseflip\mathscriptsmode \c_math_obeyempty_bits
5076 \else
5077 \bitwiseflip\mathdoublescriptmode\c_math_alignscripts_bits
5078 \bitwiseflip\mathscriptsmode \c_math_obeyempty_bits
5079 \fi
5080 \let\m_math_alignscripts\m_alignscripts}
5081
5082\appendtoks
5083 \cdef\m_alignscripts{\mathematicsparameter\c!alignscripts}
5084 \ifx\m_math_alignscripts\m_alignscripts\else
5085 \m_math_update_alignscripts
5086 \fi
5087
5088\to \everyswitchmathematics
5089
5090\appendtoks
5091 \scriptspacebetweenfactor\numericscale\mathematicsparameter\c!interscriptfactor\relax
5092
5093\to \everyswitchmathematics
5094
5095\setupmathematics
5096 [\c!alignscripts=\v!always,
5097 \c!interscriptfactor=1]
5098
5099
5100
5101\newinteger\c_math_intervals
5102
5103\appendtoks
5104 \ifcstok{\mathematicsparameter\c!autointervals}\v!yes
5105 \c_math_intervals\plusone
5106 \else
5107 \c_math_intervals\attributeunsetvalue
5108 \fi
5109
5110\to \everyswitchmathematics
5111
5112\appendtoks
5113 \attribute\mathintervalsattribute\c_math_intervals
5114\to \everymathematics
5115
5116\setupmathematics
5117 [\c!autointervals=\v!yes]
5118
5119
5120
5121\definesystemattribute[mathblob][public]
5122
5123
5124
5125
5126\newconditional\overloadedmathmeaning
5127
5128\permanent\protected\def\math_start_meaning
5129 {\begingroup
5130 \let\math_trace_blobs\relax
5131 \setbox\scratchbox\hpack\bgroup\startmathexport[math:export]
5132 \startimath}
5133
5134\permanent\protected\def\math_stop_meaning
5135 {\stopimath
5136 \stopmathexport
5137 \egroup
5138 \endgroup
5139 \global\overloadedmathmeaning\conditionaltrue}
5140
5141\appendtoks
5142 \enforced\let\startmathmeaning\math_start_meaning
5143 \enforced\let\stopmathmeaning \math_stop_meaning
5144\to \everyenableelements
5145
5146\permanent\protected\def\startmathmeaning
5147 {\gobbleuntil\stopmathmeaning}
5148
5149\protected\def\math_bump_blob_state
5150 {\ifnum\currentmathblobnesting<\zerocount\else
5151 \ifcase\currentmathblobnesting
5152 \ifconditional\overloadedmathmeaning
5153 \global\overloadedmathmeaning\conditionalfalse
5154 \else
5155 \global\advanceby\currentmathblob\plusone
5156 \fi
5157 \attribute\mathblobattribute\currentmathblob
5158 \fi
5159 \advanceby\currentmathblobnesting\plusone
5160 \fi}
5161
5162\appendtoks
5163 \math_bump_blob_state
5164\to \everymathematics
5165
5166
5167
5168
5169
5170
5171
5172\appendtoks
5173 \clf_enablecollectingmath
5174\to \everyenableelements
5175
5176\appendtoks
5177 \clf_disablecollectingmath
5178\to \everydisableelements
5179
5180
5181
5182\permanent\protected\def\math_application_of
5183
5184 {\mathatom class \mathghostcode unpack {\applyfunctionof}}
5185
5186\appendtoks
5187 \aliased\let\of\math_application_of
5188\to \everymathematics
5189
5190\protect \endinput
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244 |