-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path07_math.tex.lua
1518 lines (1500 loc) · 66.4 KB
/
07_math.tex.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
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
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---% language=uk engine=luatex runpath=texruns:manuals/luatex
---
---\environment luatex-style
---
---\startcomponent luatex-math
---
---# Math
---
---# Traditional alongside *OpenType*
---
---The handling of mathematics in *LuaTeX* differs quite a bit from how *TeX*82 (and
---therefore *PDF*TEX) handles math. First, *LuaTeX* adds primitives and extends some
---others so that *Unicode* input can be used easily. Second, all of *TeX*82's
---internal special values (for example for operator spacing) have been made
---accessible and changeable via control sequences. Third, there are extensions that
---make it easier to use *OpenType* math fonts. And finally, there are some
---extensions that have been proposed or considered in the past that are now added
---to the engine.
---
----------------------------------------------------------------
---
---# Unicode math characters
---
---Character handling is now extended up to the full *Unicode* range (the `\U`
---prefix), which is compatible with \XETEX.
---
---The math primitives from *TeX* are kept as they are, except for the ones that
---convert from input to math commands: `mathcode`, and `delcode`. These
---two now allow for a 21-bit character argument on the left hand side of the equals
---sign.
---
---Some of the new *LuaTeX* primitives read more than one separate value. This is
---shown in the tables below by a plus sign.
---
---The input for such primitives would look like this:
---
---```
---\def\overbrace{\Umathaccent 0 1 "23DE }
---```
---
---The altered *TeX*82 primitives are:
---
--- primitive min max \kern 2em min max
---
--- `mathcode` 0 10FFFF = 0 8000
--- `delcode` 0 10FFFF = 0 FFFFFF
---
---The unaltered ones are:
---
--- primitive min max
---
--- `mathchardef` 0 8000
--- `mathchar` 0 7FFF
--- `mathaccent` 0 7FFF
--- `delimiter` 0 7FFFFFF
--- `radical` 0 7FFFFFF
---
---For practical reasons `mathchardef` will silently accept values larger
---that `0x8000` and interpret it as `Umathcharnumdef`. This is needed
---to satisfy older macro packages.
---
---The following new primitives are compatible with \XETEX:
---
---% somewhat fuzzy:
---
--- primitive min max \kern 2em min max
---
--- `Umathchardef` 0+0+0 7+FF+10FFFF
--- `Umathcharnumdef`\rlap{\high{5}} -80000000 7FFFFFFF
--- `Umathcode` 0 10FFFF = 0+0+0 7+FF+10FFFF
--- `Udelcode` 0 10FFFF = 0+0 FF+10FFFF
--- `Umathchar` 0+0+0 7+FF+10FFFF
--- `Umathaccent` 0+0+0 7+FF+10FFFF
--- `Udelimiter` 0+0+0 7+FF+10FFFF
--- `Uradical` 0+0 FF+10FFFF
--- `Umathcharnum` -80000000 7FFFFFFF
--- `Umathcodenum` 0 10FFFF = -80000000 7FFFFFFF
--- `Udelcodenum` 0 10FFFF = -80000000 7FFFFFFF
---
---Specifications typically look like:
---
---```
---\Umathchardef\xx="1"0"456
---\Umathcode 123="1"0"789
---```
---
---The new primitives that deal with delimiter-style objects do not set up a
---“large family”. Selecting a suitable size for display purposes is expected
---to be dealt with by the font via the `Umathoperatorsize` parameter.
---
---For some of these primitives, all information is packed into a single signed
---integer. For the first two (`Umathcharnum` and `Umathcodenum`), the
---lowest 21 bits are the character code, the 3 bits above that represent the math
---class, and the family data is kept in the topmost bits. This means that the values
---for math families 128--255 are actually negative. For `Udelcodenum` there
---is no math class. The math family information is stored in the bits directly on
---top of the character code. Using these three commands is not as natural as using
---the two- and three-value commands, so unless you know exactly what you are
---doing and absolutely require the speedup resulting from the faster input
---scanning, it is better to use the verbose commands instead.
---
---The `Umathaccent` command accepts optional keywords to control various
---details regarding math accents. See \in {section} [mathacc] below for details.
---
---There are more new primitives and all of these will be explained in following
---sections:
---
--- primitive value range (in hex)
---
--- `Uroot` 0 + 0--FF + 10FFFF
--- `Uoverdelimiter` 0 + 0--FF + 10FFFF
--- `Uunderdelimiter` 0 + 0--FF + 10FFFF
--- `Udelimiterover` 0 + 0--FF + 10FFFF
--- `Udelimiterunder` 0 + 0--FF + 10FFFF
---
----------------------------------------------------------------
---
---# Math styles
---
---# `mathstyle`
---
---It is possible to discover the math style that will be used for a formula in an
---expandable fashion (while the math list is still being read). To make this
---possible, *LuaTeX* adds the new primitive: `mathstyle`. This is a “convert command” like e.g. `romannumeral`: its value can only be read,
---not set.
---
---The returned value is between 0 and 7 (in math mode), or `-1` (all other modes).
---For easy testing, the eight math style commands have been altered so that they can
---be used as numeric values, so you can write code like this:
---
---```
---\ifnum\mathstyle=\textstyle
--- \message{normal text style}
---\else \ifnum\mathstyle=\crampedtextstyle
--- \message{cramped text style}
---\fi \fi
---```
---
---Sometimes you won't get what you expect so a bit of explanation might help to
---understand what happens. When math is parsed and expanded it gets turned into a
---linked list. In a second pass the formula will be build. This has to do with the
---fact that in order to determine the automatically chosen sizes (in for instance
---fractions) following content can influence preceding sizes. A side effect of this
---is for instance that one cannot change the definition of a font family (and
---thereby reusing numbers) because the number that got used is stored and used in
---the second pass (so changing `\fam 12` mid-formula spoils over to
---preceding use of that family).
---
---The style switching primitives like `textstyle` are turned into nodes so the
---styles set there are frozen. The `mathchoice` primitive results in four
---lists being constructed of which one is used in the second pass. The fact that
---some automatic styles are not yet known also means that the `mathstyle`
---primitive expands to the current style which can of course be different from the
---one really used. It's a snapshot of the first pass state. As a consequence in the
---following example you get a style number (first pass) typeset that can actually
---differ from the used style (second pass). In the case of a math choice used
---ungrouped, the chosen style is used after the choice too, unless you group.
---
---\startbuffer[1]
--- [a:\mathstyle]\quad
--- \bgroup
--- \mathchoice
--- {\bf \scriptstyle (x:d :\mathstyle)}
--- {\bf \scriptscriptstyle (x:t :\mathstyle)}
--- {\bf \scriptscriptstyle (x:s :\mathstyle)}
--- {\bf \scriptscriptstyle (x:ss:\mathstyle)}
--- \egroup
--- \quad[b:\mathstyle]\quad
--- \mathchoice
--- {\bf \scriptstyle (y:d :\mathstyle)}
--- {\bf \scriptscriptstyle (y:t :\mathstyle)}
--- {\bf \scriptscriptstyle (y:s :\mathstyle)}
--- {\bf \scriptscriptstyle (y:ss:\mathstyle)}
--- \quad[c:\mathstyle]\quad
--- \bgroup
--- \mathchoice
--- {\bf \scriptstyle (z:d :\mathstyle)}
--- {\bf \scriptscriptstyle (z:t :\mathstyle)}
--- {\bf \scriptscriptstyle (z:s :\mathstyle)}
--- {\bf \scriptscriptstyle (z:ss:\mathstyle)}
--- \egroup
--- \quad[d:\mathstyle]
---\stopbuffer
---
---\startbuffer[2]
--- [a:\mathstyle]\quad
--- \begingroup
--- \mathchoice
--- {\bf \scriptstyle (x:d :\mathstyle)}
--- {\bf \scriptscriptstyle (x:t :\mathstyle)}
--- {\bf \scriptscriptstyle (x:s :\mathstyle)}
--- {\bf \scriptscriptstyle (x:ss:\mathstyle)}
--- \endgroup
--- \quad[b:\mathstyle]\quad
--- \mathchoice
--- {\bf \scriptstyle (y:d :\mathstyle)}
--- {\bf \scriptscriptstyle (y:t :\mathstyle)}
--- {\bf \scriptscriptstyle (y:s :\mathstyle)}
--- {\bf \scriptscriptstyle (y:ss:\mathstyle)}
--- \quad[c:\mathstyle]\quad
--- \begingroup
--- \mathchoice
--- {\bf \scriptstyle (z:d :\mathstyle)}
--- {\bf \scriptscriptstyle (z:t :\mathstyle)}
--- {\bf \scriptscriptstyle (z:s :\mathstyle)}
--- {\bf \scriptscriptstyle (z:ss:\mathstyle)}
--- \endgroup
--- \quad[d:\mathstyle]
---\stopbuffer
---
---\typebuffer[1]
---
---% \typebuffer[2]
---
---This gives:
---
---\blank `\displaystyle \getbuffer[1]` \blank
---\blank `\textstyle \getbuffer[1]` \blank
---
---Using `begingroup` \unknown\ `endgroup` instead gives:
---
---\blank `\displaystyle \getbuffer[2]` \blank
---\blank `\textstyle \getbuffer[2]` \blank
---
---This might look wrong but it's just a side effect of `mathstyle` expanding
---to the current (first pass) style and the number being injected in the list that
---gets converted in the second pass. It all makes sense and it illustrates the
---importance of grouping. In fact, the math choice style being effective afterwards
---has advantages. It would be hard to get it otherwise.
---
---# `Ustack`
---
---There are a few math commands in *TeX* where the style that will be used is not
---known straight from the start. These commands (`over`, `atop`,
---`overwithdelims`, `atopwithdelims`) would therefore normally return
---wrong values for `mathstyle`. To fix this, *LuaTeX* introduces a special
---prefix command: `Ustack`:
---
---```
---`\Ustack {a \over b}`
---```
---
---The `Ustack` command will scan the next brace and start a new math group
---with the correct (numerator) math style.
---
---# Cramped math styles
---
---*LuaTeX* has four new primitives to set the cramped math styles directly:
---
---```
---\crampeddisplaystyle
---\crampedtextstyle
---\crampedscriptstyle
---\crampedscriptscriptstyle
---```
---
---These additional commands are not all that valuable on their own, but they come
---in handy as arguments to the math parameter settings that will be added shortly.
---
---In Eijkhouts \quotation {*TeX* by Topic} the rules for handling styles in scripts
---are described as follows:
---
---* In any style superscripts and subscripts are taken from the next smaller style.
--- Exception: in display style they are in script style.
---
---* Subscripts are always in the cramped variant of the style; superscripts are only
--- cramped if the original style was cramped.
---
---* In an `..\over..` formula in any style the numerator and denominator are
--- taken from the next smaller style.
---
---* The denominator is always in cramped style; the numerator is only in cramped
--- style if the original style was cramped.
---
---* Formulas under a `\sqrt` or `overline` are in cramped style.
---
---In *LuaTeX* one can set the styles in more detail which means that you sometimes
---have to set both normal and cramped styles to get the effect you want. (Even) if
---we force styles in the script using `scriptstyle` and `crampedscriptstyle` we get this:
---
---\startbuffer[demo]
---\starttabulate
--- style example
---
--- default `b_{x=xx}^{x=xx}`
--- script `b_{\scriptstyle x=xx}^{\scriptstyle x=xx}`
--- crampedscript `b_{\crampedscriptstyle x=xx}^{\crampedscriptstyle x=xx}`
---
---\stopbuffer
---
---\getbuffer[demo]
---
---Now we set the following parameters
---
---\startbuffer[setup]
---\Umathordrelspacing\scriptstyle=30mu
---\Umathordordspacing\scriptstyle=30mu
---\stopbuffer
---
---\typebuffer[setup]
---
---This gives a different result:
---
---\start\getbuffer[setup,demo]\stop
---
---But, as this is not what is expected (visually) we should say:
---
---\startbuffer[setup]
---\Umathordrelspacing\scriptstyle=30mu
---\Umathordordspacing\scriptstyle=30mu
---\Umathordrelspacing\crampedscriptstyle=30mu
---\Umathordordspacing\crampedscriptstyle=30mu
---\stopbuffer
---
---\typebuffer[setup]
---
---Now we get:
---
---\start\getbuffer[setup,demo]\stop
---
----------------------------------------------------------------
---
---# Math parameter settings
---
---\subsection {Many new `Umath*` primitives}
---
---In *LuaTeX*, the font dimension parameters that *TeX* used in math typesetting are
---now accessible via primitive commands. In fact, refactoring of the math engine
---has resulted in many more parameters than were not accessible before.
---
---\starttabulate
--- primitive name description
---
--- `Umathquad` the width of 18 mu's
--- `Umathaxis` height of the vertical center axis of the math formula above the baseline
--- `Umathoperatorsize` minimum size of large operators in display mode
--- `Umathoverbarkern` vertical clearance above the rule
--- `Umathoverbarrule` the width of the rule
--- `Umathoverbarvgap` vertical clearance below the rule
--- `Umathunderbarkern` vertical clearance below the rule
--- `Umathunderbarrule` the width of the rule
--- `Umathunderbarvgap` vertical clearance above the rule
--- `Umathradicalkern` vertical clearance above the rule
--- `Umathradicalrule` the width of the rule
--- `Umathradicalvgap` vertical clearance below the rule
--- `Umathradicaldegreebefore` the forward kern that takes place before placement of the radical degree
--- `Umathradicaldegreeafter` the backward kern that takes place after placement of the radical degree
--- `Umathradicaldegreeraise` this is the percentage of the total height and depth of the radical sign that the degree is raised by; it is expressed in `percents`, so 60\% is expressed as the integer `60`
--- `Umathstackvgap` vertical clearance between the two elements in a `atop` stack
--- `Umathstacknumup` numerator shift upward in `atop` stack
--- `Umathstackdenomdown` denominator shift downward in `atop` stack
--- `Umathfractionrule` the width of the rule in a `over`
--- `Umathfractionnumvgap` vertical clearance between the numerator and the rule
--- `Umathfractionnumup` numerator shift upward in `over`
--- `Umathfractiondenomvgap` vertical clearance between the denominator and the rule
--- `Umathfractiondenomdown` denominator shift downward in `over`
--- `Umathfractiondelsize` minimum delimiter size for `\...withdelims`
--- `Umathlimitabovevgap` vertical clearance for limits above operators
--- `Umathlimitabovebgap` vertical baseline clearance for limits above operators
--- `Umathlimitabovekern` space reserved at the top of the limit
--- `Umathlimitbelowvgap` vertical clearance for limits below operators
--- `Umathlimitbelowbgap` vertical baseline clearance for limits below operators
--- `Umathlimitbelowkern` space reserved at the bottom of the limit
--- `Umathoverdelimitervgap` vertical clearance for limits above delimiters
--- `Umathoverdelimiterbgap` vertical baseline clearance for limits above delimiters
--- `Umathunderdelimitervgap` vertical clearance for limits below delimiters
--- `Umathunderdelimiterbgap` vertical baseline clearance for limits below delimiters
--- `Umathsubshiftdrop` subscript drop for boxes and subformulas
--- `Umathsubshiftdown` subscript drop for characters
--- `Umathsupshiftdrop` superscript drop (raise, actually) for boxes and subformulas
--- `Umathsupshiftup` superscript raise for characters
--- `Umathsubsupshiftdown` subscript drop in the presence of a superscript
--- `Umathsubtopmax` the top of standalone subscripts cannot be higher than this above the baseline
--- `Umathsupbottommin` the bottom of standalone superscripts cannot be less than this above the baseline
--- `Umathsupsubbottommax` the bottom of the superscript of a combined super- and subscript be at least as high as this above the baseline
--- `Umathsubsupvgap` vertical clearance between super- and subscript
--- `Umathspaceafterscript` additional space added after a super- or subscript
--- `Umathconnectoroverlapmin` minimum overlap between parts in an extensible recipe
---
---Each of the parameters in this section can be set by a command like this:
---
---```
---\Umathquad\displaystyle=1em
---```
---
---they obey grouping, and you can use `\the\Umathquad\displaystyle` if
---needed.
---
---# Font-based math parameters
---
---While it is nice to have these math parameters available for tweaking, it would
---be tedious to have to set each of them by hand. For this reason, *LuaTeX*
---initializes a bunch of these parameters whenever you assign a font identifier to
---a math family based on either the traditional math font dimensions in the font
---(for assignments to math family 2 and 3 using *tfm*-based fonts like `cmsy` and `cmex`), or based on the named values in a potential `MathConstants` table when the font is loaded via Lua. If there is a `MathConstants` table, this takes precedence over font dimensions, and in that
---case no attention is paid to which family is being assigned to: the `MathConstants` tables in the last assigned family sets all parameters.
---
---In the table below, the one-letter style abbreviations and symbolic tfm font
---dimension names match those used in the \TeX book. Assignments to `textfont` set the values for the cramped and uncramped display and text styles,
---`scriptfont` sets the script styles, and `scriptscriptfont` sets the
---scriptscript styles, so we have eight parameters for three font sizes. In the
---*tfm* case, assignments only happen in family 2 and family 3 (and of course only
---for the parameters for which there are font dimensions).
---
---Besides the parameters below, *LuaTeX* also looks at the “space” font
---dimension parameter. For math fonts, this should be set to zero.
---
---\def\MathLine#1#2#3#4#5%
--- {
--- \llap{\high{\tx #2\enspace}}\ttbf \string #1 \tt #5
--- \tx #3 \tt #4 }
---
--- variable / style tfm / opentype
---\MathLine{\Umathaxis} {} {} {AxisHeight} {axis_height}
---\MathLine{\Umathoperatorsize} {6} {D, D'} {DisplayOperatorMinHeight} {\emdash}
---\MathLine{\Umathfractiondelsize} {9} {D, D'} {FractionDelimiterDisplayStyleSize} {delim1}
---\MathLine{\Umathfractiondelsize} {9} {T, T', S, S', SS, SS'}{FractionDelimiterSize} {delim2}
---\MathLine{\Umathfractiondenomdown} {} {D, D'} {FractionDenominatorDisplayStyleShiftDown}{denom1}
---\MathLine{\Umathfractiondenomdown} {} {T, T', S, S', SS, SS'}{FractionDenominatorShiftDown} {denom2}
---\MathLine{\Umathfractiondenomvgap} {} {D, D'} {FractionDenominatorDisplayStyleGapMin} {3*default_rule_thickness}
---\MathLine{\Umathfractiondenomvgap} {} {T, T', S, S', SS, SS'}{FractionDenominatorGapMin} {default_rule_thickness}
---\MathLine{\Umathfractionnumup} {} {D, D'} {FractionNumeratorDisplayStyleShiftUp} {num1}
---\MathLine{\Umathfractionnumup} {} {T, T', S, S', SS, SS'}{FractionNumeratorShiftUp} {num2}
---\MathLine{\Umathfractionnumvgap} {} {D, D'} {FractionNumeratorDisplayStyleGapMin} {3*default_rule_thickness}
---\MathLine{\Umathfractionnumvgap} {} {T, T', S, S', SS, SS'}{FractionNumeratorGapMin} {default_rule_thickness}
---\MathLine{\Umathfractionrule} {} {} {FractionRuleThickness} {default_rule_thickness}
---\MathLine{\Umathskewedfractionhgap} {} {} {SkewedFractionHorizontalGap} {math_quad/2}
---\MathLine{\Umathskewedfractionvgap} {} {} {SkewedFractionVerticalGap} {math_x_height}
---\MathLine{\Umathlimitabovebgap} {} {} {UpperLimitBaselineRiseMin} {big_op_spacing3}
---\MathLine{\Umathlimitabovekern} {1} {} {0} {big_op_spacing5}
---\MathLine{\Umathlimitabovevgap} {} {} {UpperLimitGapMin} {big_op_spacing1}
---\MathLine{\Umathlimitbelowbgap} {} {} {LowerLimitBaselineDropMin} {big_op_spacing4}
---\MathLine{\Umathlimitbelowkern} {1} {} {0} {big_op_spacing5}
---\MathLine{\Umathlimitbelowvgap} {} {} {LowerLimitGapMin} {big_op_spacing2}
---\MathLine{\Umathoverdelimitervgap} {} {} {StretchStackGapBelowMin} {big_op_spacing1}
---\MathLine{\Umathoverdelimiterbgap} {} {} {StretchStackTopShiftUp} {big_op_spacing3}
---\MathLine{\Umathunderdelimitervgap} {} {} {StretchStackGapAboveMin} {big_op_spacing2}
---\MathLine{\Umathunderdelimiterbgap} {} {} {StretchStackBottomShiftDown} {big_op_spacing4}
---\MathLine{\Umathoverbarkern} {} {} {OverbarExtraAscender} {default_rule_thickness}
---\MathLine{\Umathoverbarrule} {} {} {OverbarRuleThickness} {default_rule_thickness}
---\MathLine{\Umathoverbarvgap} {} {} {OverbarVerticalGap} {3*default_rule_thickness}
---\MathLine{\Umathquad} {1} {} {<font_size(f)>} {math_quad}
---\MathLine{\Umathradicalkern} {} {} {RadicalExtraAscender} {default_rule_thickness}
---\MathLine{\Umathradicalrule} {2} {} {RadicalRuleThickness} {<not set>}
---\MathLine{\Umathradicalvgap} {3} {D, D'} {RadicalDisplayStyleVerticalGap} {default_rule_thickness+abs(math_x_height)/4}
---\MathLine{\Umathradicalvgap} {3} {T, T', S, S', SS, SS'}{RadicalVerticalGap} {default_rule_thickness+abs(default_rule_thickness)/4}
---\MathLine{\Umathradicaldegreebefore}{2} {} {RadicalKernBeforeDegree} {<not set>}
---\MathLine{\Umathradicaldegreeafter} {2} {} {RadicalKernAfterDegree} {<not set>}
---\MathLine{\Umathradicaldegreeraise} {2,7}{} {RadicalDegreeBottomRaisePercent} {<not set>}
---\MathLine{\Umathspaceafterscript} {4} {} {SpaceAfterScript} {script_space}
---\MathLine{\Umathstackdenomdown} {} {D, D'} {StackBottomDisplayStyleShiftDown} {denom1}
---\MathLine{\Umathstackdenomdown} {} {T, T', S, S', SS, SS'}{StackBottomShiftDown} {denom2}
---\MathLine{\Umathstacknumup} {} {D, D'} {StackTopDisplayStyleShiftUp} {num1}
---\MathLine{\Umathstacknumup} {} {T, T', S, S', SS, SS'}{StackTopShiftUp} {num3}
---\MathLine{\Umathstackvgap} {} {D, D'} {StackDisplayStyleGapMin} {7*default_rule_thickness}
---\MathLine{\Umathstackvgap} {} {T, T', S, S', SS, SS'}{StackGapMin} {3*default_rule_thickness}
---\MathLine{\Umathsubshiftdown} {} {} {SubscriptShiftDown} {sub1}
---\MathLine{\Umathsubshiftdrop} {} {} {SubscriptBaselineDropMin} {sub_drop}
---\MathLine{\Umathsubsupshiftdown} {8} {} {SubscriptShiftDownWithSuperscript} {\emdash}
---\MathLine{\Umathsubtopmax} {} {} {SubscriptTopMax} {abs(math_x_height*4)/5}
---\MathLine{\Umathsubsupvgap} {} {} {SubSuperscriptGapMin} {4*default_rule_thickness}
---\MathLine{\Umathsupbottommin} {} {} {SuperscriptBottomMin} {abs(math_x_height/4)}
---\MathLine{\Umathsupshiftdrop} {} {} {SuperscriptBaselineDropMax} {sup_drop}
---\MathLine{\Umathsupshiftup} {} {D} {SuperscriptShiftUp} {sup1}
---\MathLine{\Umathsupshiftup} {} {T, S, SS,} {SuperscriptShiftUp} {sup2}
---\MathLine{\Umathsupshiftup} {} {D', T', S', SS'} {SuperscriptShiftUpCramped} {sup3}
---\MathLine{\Umathsupsubbottommax} {} {} {SuperscriptBottomMaxWithSubscript} {abs(math_x_height*4)/5}
---\MathLine{\Umathunderbarkern} {} {} {UnderbarExtraDescender} {default_rule_thickness}
---\MathLine{\Umathunderbarrule} {} {} {UnderbarRuleThickness} {default_rule_thickness}
---\MathLine{\Umathunderbarvgap} {} {} {UnderbarVerticalGap} {3*default_rule_thickness}
---\MathLine{\Umathconnectoroverlapmin}{5} {} {MinConnectorOverlap} {0}
---
---Note 1: *OpenType* fonts set `Umathlimitabovekern` and `Umathlimitbelowkern` to zero and set `Umathquad` to the font size of the
---used font, because these are not supported in the `MATH` table,
---
---Note 2: Traditional *tfm* fonts do not set `Umathradicalrule` because
---*TeX*82\ uses the height of the radical instead. When this parameter is indeed not
---set when *LuaTeX* has to typeset a radical, a backward compatibility mode will
---kick in that assumes that an oldstyle *TeX* font is used. Also, they do not set
---`Umathradicaldegreebefore`, `Umathradicaldegreeafter`, and `Umathradicaldegreeraise`. These are then automatically initialized to
---`5/18`quad, `-10/18`quad, and 60.
---
---Note 3: If *tfm* fonts are used, then the `Umathradicalvgap` is not set
---until the first time *LuaTeX* has to typeset a formula because this needs
---parameters from both family 2 and family 3. This provides a partial backward
---compatibility with *TeX*82, but that compatibility is only partial: once the `Umathradicalvgap` is set, it will not be recalculated any more.
---
---Note 4: When *tfm* fonts are used a similar situation arises with respect to `Umathspaceafterscript`: it is not set until the first time *LuaTeX* has to
---typeset a formula. This provides some backward compatibility with *TeX*82. But
---once the `Umathspaceafterscript` is set, `scriptspace` will never be
---looked at again.
---
---Note 5: Traditional *tfm* fonts set `Umathconnectoroverlapmin` to zero
---because *TeX*82\ always stacks extensibles without any overlap.
---
---Note 6: The `Umathoperatorsize` is only used in `displaystyle`, and is
---only set in *OpenType* fonts. In *tfm* font mode, it is artificially set to one
---scaled point more than the initial attempt's size, so that always the “first next” will be tried, just like in *TeX*82.
---
---Note 7: The `Umathradicaldegreeraise` is a special case because it is the
---only parameter that is expressed in a percentage instead of a number of scaled
---points.
---
---Note 8: `SubscriptShiftDownWithSuperscript` does not actually exist in the
---“standard” *OpenType* math font Cambria, but it is useful enough to be
---added.
---
---Note 9: `FractionDelimiterDisplayStyleSize` and `FractionDelimiterSize` do not actually exist in the “standard” *OpenType*
---math font Cambria, but were useful enough to be added.
---
----------------------------------------------------------------
---
---# Math spacing
---
---# Inline surrounding space
---
---Inline math is surrounded by (optional) `mathsurround` spacing but that is a fixed
---dimension. There is now an additional parameter `mathsurroundskip`. When set to a
---non-zero value (or zero with some stretch or shrink) this parameter will replace
---`mathsurround`. By using an additional parameter instead of changing the nature
---of `mathsurround`, we can remain compatible. In the meantime a bit more
---control has been added via `mathsurroundmode`. This directive can take 6 values
---with zero being the default behaviour.
---
---\start
---
---\def\OneLiner#1#2%
--- { `#1`
--- \dontleavehmode\inframed[align=normal,offset=0pt,frame=off]{\mathsurroundmode#1\relax\hsize 100pt x`x`x}
--- \dontleavehmode\inframed[align=normal,offset=0pt,frame=off]{\mathsurroundmode#1\relax\hsize 100pt x `x` x}
--- #2
--- }
---
---\startbuffer
---\mathsurround 10pt
---\mathsurroundskip20pt
---\stopbuffer
---
---\typebuffer \getbuffer
---
--- mode x\`x\`x x \`x\` x effect
---
---\OneLiner{0}{obey `mathsurround` when `mathsurroundskip` is 0pt}
---\OneLiner{1}{only add skip to the left}
---\OneLiner{2}{only add skip to the right}
---\OneLiner{3}{add skip to the left and right}
---\OneLiner{4}{ignore the skip setting, obey `mathsurround`}
---\OneLiner{5}{disable all spacing around math}
---\OneLiner{6}{only apply `mathsurroundskip` when also spacing}
---\OneLiner{7}{only apply `mathsurroundskip` when no spacing}
---
---\stop
---
---Method six omits the surround glue when there is (x)spacing glue present while
---method seven does the opposite, the glue is only applied when there is (x)space
---glue present too. Anything more fancy, like checking the begining or end of a
---paragraph (or edges of a box) would not be robust anyway. If you want that you
---can write a callback that runs over a list and analyzes a paragraph. Actually, in
---that case you could also inject glue (or set the properties of a math node)
---explicitly. So, these modes are in practice mostly useful for special purposes
---and experiments (they originate in a tracker item). Keep in mind that this glue
---is part of the math node and not always treated as normal glue: it travels with
---the begin and end math nodes. Also, method 6 and 7 will zero the skip related
---fields in a node when applicable in the first occasion that checks them
---(linebreaking or packaging).
---
---# Pairwise spacing
---
---Besides the parameters mentioned in the previous sections, there are also 64 new
---primitives to control the math spacing table (as explained in Chapter 18 of the
---*TeX* book). The primitive names are a simple matter of combining two math atom
---types, but for completeness' sake, here is the whole list:
---
---\starttwocolumns
---\startlines
---`Umathordordspacing`
---`Umathordopspacing`
---`Umathordbinspacing`
---`Umathordrelspacing`
---`Umathordopenspacing`
---`Umathordclosespacing`
---`Umathordpunctspacing`
---`Umathordinnerspacing`
---`Umathopordspacing`
---`Umathopopspacing`
---`Umathopbinspacing`
---`Umathoprelspacing`
---`Umathopopenspacing`
---`Umathopclosespacing`
---`Umathoppunctspacing`
---`Umathopinnerspacing`
---`Umathbinordspacing`
---`Umathbinopspacing`
---`Umathbinbinspacing`
---`Umathbinrelspacing`
---`Umathbinopenspacing`
---`Umathbinclosespacing`
---`Umathbinpunctspacing`
---`Umathbininnerspacing`
---`Umathrelordspacing`
---`Umathrelopspacing`
---`Umathrelbinspacing`
---`Umathrelrelspacing`
---`Umathrelopenspacing`
---`Umathrelclosespacing`
---`Umathrelpunctspacing`
---`Umathrelinnerspacing`
---`Umathopenordspacing`
---`Umathopenopspacing`
---`Umathopenbinspacing`
---`Umathopenrelspacing`
---`Umathopenopenspacing`
---`Umathopenclosespacing`
---`Umathopenpunctspacing`
---`Umathopeninnerspacing`
---`Umathcloseordspacing`
---`Umathcloseopspacing`
---`Umathclosebinspacing`
---`Umathcloserelspacing`
---`Umathcloseopenspacing`
---`Umathcloseclosespacing`
---`Umathclosepunctspacing`
---`Umathcloseinnerspacing`
---`Umathpunctordspacing`
---`Umathpunctopspacing`
---`Umathpunctbinspacing`
---`Umathpunctrelspacing`
---`Umathpunctopenspacing`
---`Umathpunctclosespacing`
---`Umathpunctpunctspacing`
---`Umathpunctinnerspacing`
---`Umathinnerordspacing`
---`Umathinneropspacing`
---`Umathinnerbinspacing`
---`Umathinnerrelspacing`
---`Umathinneropenspacing`
---`Umathinnerclosespacing`
---`Umathinnerpunctspacing`
---`Umathinnerinnerspacing`
---\stoplines
---\stoptwocolumns
---
---These parameters are of type `muskip`, so setting a parameter can be done
---like this:
---
---```
---\Umathopordspacing\displaystyle=4mu plus 2mu
---```
---
---They are all initialized by `initex` to the values mentioned in the table
---in Chapter 18 of the *TeX* book.
---
---Note 1: for ease of use as well as for backward compatibility, `thinmuskip`,
---`medmuskip` and `thickmuskip` are treated specially. In their case a
---pointer to the corresponding internal parameter is saved, not the actual `muskip` value. This means that any later changes to one of these three
---parameters will be taken into account.
---
---Note 2: Careful readers will realise that there are also primitives for the items
---marked `*` in the *TeX* book. These will not actually be used as those
---combinations of atoms cannot actually happen, but it seemed better not to break
---orthogonality. They are initialized to zero.
---
---# Skips around display math
---
---The injection of `abovedisplayskip` and `belowdisplayskip` is not
---symmetrical. An above one is always inserted, also when zero, but the below is
---only inserted when larger than zero. Especially the latter makes it sometimes hard
---to fully control spacing. Therefore *LuaTeX* comes with a new directive: `mathdisplayskipmode`. The following values apply:
---
--- value meaning
---
--- 0 normal *TeX* behaviour
--- 1 always (same as 0)
--- 2 only when not zero
--- 3 never, not even when not zero
---
---By default the short skip detection is not adapted to r2l typesetting and that
---hasn't been the case since the start of the project. Changing it could break
---hacks that users came up with but when you set `matheqdirmode` to a positive
---value direction will be taken into account.
---
---\subsection {Nolimit correction}
---
---There are two extra math parameters `Umathnolimitsupfactor` and `Umathnolimitsubfactor` that were added to provide some control over how limits
---are spaced (for example the position of super and subscripts after integral
---operators). They relate to an extra parameter `mathnolimitsmode`. The half
---corrections are what happens when scripts are placed above and below. The
---problem with italic corrections is that officially that correction italic is used
---for above/below placement while advanced kerns are used for placement at the
---right end. The question is: how often is this implemented, and if so, do the
---kerns assume correction too. Anyway, with this parameter one can control it.
---
---
--- \mathnolimitsmode0 `\displaystyle\int\nolimits^0_1`
--- \mathnolimitsmode1 `\displaystyle\int\nolimits^0_1`
--- \mathnolimitsmode2 `\displaystyle\int\nolimits^0_1`
--- \mathnolimitsmode3 `\displaystyle\int\nolimits^0_1`
--- \mathnolimitsmode4 `\displaystyle\int\nolimits^0_1`
--- \mathnolimitsmode8000 `\displaystyle\int\nolimits^0_1`
---
---
--- mode
--- \tttf 0
--- \tttf 1
--- \tttf 2
--- \tttf 3
--- \tttf 4
--- \tttf 8000
---
--- superscript
--- 0
--- font
--- 0
--- 0
--- +ic/2
--- 0
---
--- subscript
--- -ic
--- font
--- 0
--- -ic/2
--- -ic/2
--- 8000ic/1000
---
---
---When the mode is set to one, the math parameters are used. This way a macro
---package writer can decide what looks best. Given the current state of fonts in
---*ConTeXt* we currently use mode 1 with factor 0 for the superscript and 750 for
---the subscripts. Positive values are used for both parameters but the subscript
---shifts to the left. A `mathnolimitsmode` larger that 15 is considered to
---be a factor for the subscript correction. This feature can be handy when
---experimenting.
---
---\subsection {Math italic mess}
---
---The `mathitalicsmode` parameter can be set to 1 to force italic correction
---before noads that represent some more complex structure (read: everything that is
---not an ord, bin, rel, open, close, punct or inner). A value of 2 will enforce the
---old school font code path for all italics. We show a Cambria example.
---
---\starttexdefinition Whatever #1
--- `\mathitalicsmode = #1`
--- \mathitalicsmode#1\ruledhbox{`\left|T^1\right|`}
--- \mathitalicsmode#1\ruledhbox{`\left|T\right|`}
--- \mathitalicsmode#1\ruledhbox{`T+1`}
--- \mathitalicsmode#1\ruledhbox{`T{1\over2}`}
--- \mathitalicsmode#1\ruledhbox{`T\sqrt{1}`}
---
---\stoptexdefinition
---
---\start
--- \switchtobodyfont[cambria]
---
--- \Whatever{0}%
--- \Whatever{1}%
---
---\stop
---
---This kind of parameters relate to the fact that italic correction in *OpenType*
---math is bound to fuzzy rules. So, control is the solution.
---
---\subsection {Script and kerning}
---
---If you want to typeset text in math macro packages often provide something `\text` which obeys the script sizes. As the definition can be anything there is
---a good chance that the kerning doesn't come out well when used in a script. Given
---that the first glyph ends up in a `hbox` we have some control over this.
---And, as a bonus we also added control over the normal sublist kerning. The `mathscriptboxmode` parameter defaults to 1.
---
--- value meaning
---
--- `0` forget about kerning
--- `1` kern math sub lists with a valid glyph
--- `2` also kern math sub boxes that have a valid glyph
---@field 2 only kern math sub boxes with a boundary node # present
---
---Here we show some examples. Of course this doesn't solve all our problems, if
---only because some fonts have characters with bounding boxes that compensate for
---italics, while other fonts can lack kerns.
---
---\startbuffer[1]
--- `T_{\tf fluff}`
---\stopbuffer
---
---\startbuffer[2]
--- `T_{\text{fluff}}`
---\stopbuffer
---
---\startbuffer[3]
--- `T_{\text{\boundary1 fluff}}`
---\stopbuffer
---
---\unexpanded\def\Show#1#2#3%
--- {\doifelsenothing{#3}
--- {\small\tx\typeinlinebuffer[#1]}
--- {\doifelse{#3}{-}
--- {\small\bf\tt mode #2}
--- {\switchtobodyfont[#3]\showfontkerns\showglyphs\mathscriptboxmode#2\relax\inlinebuffer[#1]}}}
--- \Show{1}{0}{} \Show{1}{1}{} \Show{2}{1}{} \Show{2}{2}{} \Show{3}{3}{} \Show{1}{0}{-} \Show{1}{1}{-} \Show{2}{1}{-} \Show{2}{2}{-} \Show{3}{3}{-}
--- modern \Show{1}{0}{modern} \Show{1}{1}{modern} \Show{2}{1}{modern} \Show{2}{2}{modern} \Show{3}{3}{modern}
--- lucidaot \Show{1}{0}{lucidaot} \Show{1}{1}{lucidaot} \Show{2}{1}{lucidaot} \Show{2}{2}{lucidaot} \Show{3}{3}{lucidaot}
--- pagella \Show{1}{0}{pagella} \Show{1}{1}{pagella} \Show{2}{1}{pagella} \Show{2}{2}{pagella} \Show{3}{3}{pagella}
--- cambria \Show{1}{0}{cambria} \Show{1}{1}{cambria} \Show{2}{1}{cambria} \Show{2}{2}{cambria} \Show{3}{3}{cambria}
--- dejavu \Show{1}{0}{dejavu} \Show{1}{1}{dejavu} \Show{2}{1}{dejavu} \Show{2}{2}{dejavu} \Show{3}{3}{dejavu}
---
---Kerning between a character subscript is controlled by `mathscriptcharmode`
---which also defaults to 1.
---
---Here is another example. Internally we tag kerns as italic kerns or font kerns
---where font kerns result from the staircase kern tables. In 2018 fonts like Latin
---Modern and Pagella rely on cheats with the boundingbox, Cambria uses staircase
---kerns and Lucida a mixture. Depending on how fonts evolve we might add some more
---control over what one can turn on and off.
---
---\def\MathSample#1#2#3%
--- {
--- #1
--- #2
--- \showglyphdata \switchtobodyfont[#2,17.3pt]`#3T_{f}`
--- \showglyphdata \switchtobodyfont[#2,17.3pt]`#3\gamma_{e}`
--- \showglyphdata \switchtobodyfont[#2,17.3pt]`#3\gamma_{ee}`
--- \showglyphdata \switchtobodyfont[#2,17.3pt]`#3T_{\tf fluff}`
--- \NR}
---
--- \FL
--- \MathSample{normal}{modern} {\mr}
--- \MathSample{} {pagella} {\mr}
--- \MathSample{} {cambria} {\mr}
--- \MathSample{} {lucidaot}{\mr}
--- \ML
--- \MathSample{bold} {modern} {\mb}
--- \MathSample{} {pagella} {\mb}
--- \MathSample{} {cambria} {\mb}
--- \MathSample{} {lucidaot}{\mb}
---
---
---# Fixed scripts
---
---We have three parameters that are used for this fixed anchoring:
---
--- parameter register
--- `d` `Umathsubshiftdown`
--- `u` `Umathsupshiftup`
--- `s` `Umathsubsupshiftdown`
---
---When we set `mathscriptsmode` to a value other than zero these are used
---for calculating fixed positions. This is something that is needed for instance
---for chemistry. You can manipulate the mentioned variables to achieve different
---effects.
---
---\def\SampleMath#1%
--- {`\mathscriptsmode#1\mathupright CH_2 + CH^+_2 + CH^2_2`}
---
--- mode down up example
---
--- 0 dynamic dynamic \SampleMath{0}
--- 1 `d` `u` \SampleMath{1}
--- 2 `s` `u` \SampleMath{2}
--- 3 `s` `u + s - d` \SampleMath{3}
--- 4 `d + (s-d)/2` `u + (s-d)/2` \SampleMath{4}
--- 5 `d` `u + s - d` \SampleMath{5}
---
---The value of this parameter obeys grouping but applies to the whole current
---formula.
---
---% if needed we can put the value in stylenodes but maybe more should go there
---
---# Penalties: `mathpenaltiesmode`
---
---Only in inline math penalties will be added in a math list. You can force
---penalties (also in display math) by setting:
---
---```
---\mathpenaltiesmode = 1
---```
---
---This primnitive is not really needed in *LuaTeX* because you can use the callback
---`mlist_to_hlist` to force penalties by just calling the regular routine
---with forced penalties. However, as part of opening up and control this primitive
---makes sense. As a bonus we also provide two extra penalties:
---
---```
---\prebinoppenalty = -100 % example value
---\prerelpenalty = 900 % example value
---```
---
---They default to inifinite which signals that they don't need to be inserted. When
---set they are injected before a binop or rel noad. This is an experimental feature.
---
---# Equation spacing: `matheqnogapstep`
---
---By default *TeX* will add one quad between the equation and the number. This is
---hard coded. A new primitive can control this:
---
---\startsyntax
---\matheqnogapstep = 1000
---\stopsyntax
---
---Because a math quad from the math text font is used instead of a dimension, we
---use a step to control the size. A value of zero will suppress the gap. The step
---is divided by 1000 which is the usual way to mimmick floating point factors in
---*TeX*.
---
----------------------------------------------------------------
---
---# Math constructs
---
---\subsection {Unscaled fences}
---
---The `mathdelimitersmode` primitive is experimental and deals with the
---following (potential) problems. Three bits can be set. The first bit prevents an
---unwanted shift when the fence symbol is not scaled (a cambria side effect). The
---second bit forces italic correction between a preceding character ordinal and the
---fenced subformula, while the third bit turns that subformula into an ordinary so
---that the same spacing applies as with unfenced variants. Here we show Cambria
---(with `mathitalicsmode` enabled).
---
---\starttexdefinition Whatever #1
--- `\mathdelimitersmode = #1`
--- \mathitalicsmode1\mathdelimitersmode#1\ruledhbox{\showglyphs\showfontkerns\showfontitalics`f(x)`}
--- \mathitalicsmode1\mathdelimitersmode#1\ruledhbox{\showglyphs\showfontkerns\showfontitalics`f\left(x\right)`}
---
---\stoptexdefinition
---
---\start
--- \switchtobodyfont[cambria]
---
--- \Whatever{0}\Whatever{1}\Whatever{2}\Whatever{3}%
--- \Whatever{4}\Whatever{5}\Whatever{6}\Whatever{7}%
---
---\stop
---
---So, when set to 7 fenced subformulas with unscaled delimiters come out the same
---as unfenced ones. This can be handy for cases where one is forced to use `left` and `right` always because of unpredictable content. As said, it's an
---experimental feature (which somehow fits in the exceptional way fences are dealt
---with in the engine). The full list of flags is given in the next table:
---
--- value meaning
---
--- `"01` don't apply the usual shift
--- `"02` apply italic correction when possible
--- `"04` force an ordinary subformula
--- `"08` no shift when a base character
--- `"10` only shift when an extensible
---
---The effect can depend on the font (and for Cambria one can use for instance `"16`).
---
---\subsection[mathacc]{Accent handling}
---
---*LuaTeX* supports both top accents and bottom accents in math mode, and math
---accents stretch automatically (if this is supported by the font the accent comes
---from, of course). Bottom and combined accents as well as fixed-width math accents
---are controlled by optional keywords following `Umathaccent`.
---
---The keyword `bottom` after `Umathaccent` signals that a bottom accent
---is needed, and the keyword `both` signals that both a top and a bottom
---accent are needed (in this case two accents need to be specified, of course).
---
---Then the set of three integers defining the accent is read. This set of integers
---can be prefixed by the `fixed` keyword to indicate that a non-stretching
---variant is requested (in case of both accents, this step is repeated).
---
---A simple example:
---
---```
---\Umathaccent both fixed 0 0 "20D7 fixed 0 0 "20D7 {example}
---```
---
---If a math top accent has to be placed and the accentee is a character and has a
---non-zero `top_accent` value, then this value will be used to place the
---accent instead of the `skewchar` kern used by *TeX*82.
---
---The `top_accent` value represents a vertical line somewhere in the
---accentee. The accent will be shifted horizontally such that its own `top_accent` line coincides with the one from the accentee. If the `top_accent` value of the accent is zero, then half the width of the accent
---followed by its italic correction is used instead.
---
---The vertical placement of a top accent depends on the `x_height` of the
---font of the accentee (as explained in the *TeX* book), but if a value turns out
---to be zero and the font had a `MathConstants` table, then `AccentBaseHeight` is used instead.
---
---The vertical placement of a bottom accent is straight below the accentee, no
---correction takes place.
---
---Possible locations are `top`, `bottom`, `both` and `center`. When no location is given `top` is assumed. An additional
---parameter `fraction` can be specified followed by a number; a value of for
---instance 1200 means that the criterium is 1.2 times the width of the nucleus. The
---fraction only applies to the stepwise selected shapes and is mostly meant for the
---`overlay` location. It also works for the other locations but then it
---concerns the width.
---