1
2
3\environment luametatexstyle
4
5\startdocument[title=Math]
6
7\startsection[title={Introduction}]
8
9There is a lot to tell about math typesetting in \LUAMETATEX\ but plenty is
10covered in articles, progress reports and manuals. Here we limit ourselves to
11some basics. This chapter mostly contains information that is not presented
12elsewhere. Because math in regular \TEX\ is basically frozen and other macro
13packaged depend on that, the extensions we have in \LUAMETATEX\ are mainly useful
14for \CONTEXT. Even there we dont use all features, because completely opening up
15and providing ways to control every aspect also served the purpose of testing: it
16just comes with the package.
17
18This chapter is a variant on the one in the old \LUAMETATEX\ manual and it might
19evolve a bit. We will not discuss the many options that the engine provides, at
20least not now. There is an extensive \quotation {Math in \CONTEXT} that shows the
21state of the art and serves as reference. In due time we might write some more
22about what happens deep down in the engine, although already plenty has been
23published during the upgrade, about dealing with math fonts as well as
24experimenting with new features. Because all gets wrapped in high level
25interfaces there is not that much need (nor audience) for endless explanations
26anyway. There are also examples given in the chapter that discusses all
27primitives. Most \CONTEXT\ users will never see these low level math commands!
28
29\stopsection
30
31\startsection[title={Traditional alongside \OPENTYPE}]
32
33Because we started in 2019 from \LUATEX, by the end of 2021 this chapter started
34with this, even if we already reworked the engine:
35
36\startquotation
37At this point there is no difference between \LUAMETATEX\ and \LUATEX\ with
38respect to math. Well, this might no longer be true because we have more control
39options that define default behavior and also have a more extensive scaling
40model. Anyway, it should not look worse, and maybe even a bit better. The
41handling of mathematics in \LUATEX\ differs quite a bit from how \TEX82 (and
42therefore \PDFTEX) handles math. First, \LUATEX\ adds primitives and extends some
43others so that \UNICODE\ input can be used easily. Second, all of \TEX82s
44internal special values (for example for operator spacing) have been made
45accessible and changeable via control sequences. Third, there are extensions that
46make it easier to use \OPENTYPE\ math fonts. And finally, there are some
47extensions that have been proposed or considered in the past that are now added
48to the engine.
49
50You might be surprised that we dont use all these new control features in
51\CONTEXT\ \LMTX, but who knows what might happen because users drive it. The main
52reason for adding so much is that I decided it made more sense to be complete now
53than gradually add more and more. At some point we should be able to say \quote
54{This is it}. Also, when looking at these features, you need to keep in mind that
55when it comes to math, \LATEX\ is the dominant macro package and it never needed
56these engine features, so most are probably just here for exploration purposes.
57\stopquotation
58
59Although we still process math as \TEX\ does, there have been some fundamental
60changes to the machinery. Most of that is discussed in documents that come with
61\CONTEXT\ and in Mikael Sundqvist math manual. Together we explored some new ways
62to deal with math spacing, penalties, fencing, operators, fractions, atoms and
63other features of the \TEX\ engine. We started from the way \CONTEXT\ used the
64already present functionality combine with sometimes somewhat dirty (but on the
65average working well) tricks.
66
67Much in \LUAMETATEX\ math handling is about microtypography and for us the
68results are quite visible. But, as far as we know, there have never been
69complaints or demands in the direction of the features discussed here. Also,
70\TEX\ math usage outside \CONTEXT\ is rather chiseled in stone (already for
71nearly three decades) so we dont expect other macro packages to use the new
72features anyway. Anyway, after spending a real lot of time on this we both
73decided that were mostly feature complete.
74
75\stopsection
76
77\startsection[title=Intermezzo]
78
79It is important to understand a bit how \TEX\ handles math. The math engine
80is a large subsystem and basically can be divided in two parts: convert
81sequential input into a list of nodes where math related ones actually are
82sort of intermediate and therefore called noads.
83
84In text mode entering \type {abc} results in three glyph nodes and \type {a b
85c} in three glyph nodes separated by (spacing) glue. Successive glyphs can be
86transformed in the font engine later on, just as hyphenation directive can
87be added. Eventually one (normally) gets a mix of glyphs, font kerns from
88a sequence of glyphs
89
90In math mode \type {abc} results in three simple ordinary noads and \type {a b c}
91is equivalent to that: three noads. But \type {a bc} results in two ordinary
92noads where the second one has a sublist of two ordinary noads. Because
93characters have class properties, \type {( a b = c )} results in a simple open
94noad, a simple ordinary, a simple binary, a simple ordinary, a simple relation, a
95simple ordinary and simple close noad. The next samples show a bit of this; in
96order to see the effects of spacing between ordinary atoms set it to \type {9mu}.
97
98\startbuffer
99\typebuffer[sample]
100
101
102\startlinecorrection
103\setmathspacing\mathordinarycode\mathordinarycode\allmathstyles9mu
104\mathgroupingmode\zerocount
105\scale[scale=2000]{\showmakeup[mathglue]\showboxes\mathspacingmode\plusone\getbuffer[sample]}
106\stoplinecorrection
107\blank[2*line]
108\stopbuffer
109
110\startbuffer[sample]
111$a b c$ \quad $a bc$ \quad $abc$
112\stopbuffer
113
114\getbuffer
115
116With \type {\tracingmath 1} we get this logged:
117
118\starttyping
119> \inlinemath=
120\noad[ord][...]
121.\nucleus
122..\mathchar[ord][...], family "0, character "61
123\noad[ord][...]
124.\nucleus
125..\mathchar[ord][...], family "0, character "62
126\noad[ord][...]
127.\nucleus
128..\mathchar[ord][...], family "0, character "63
129
130> \inlinemath=
131\noad[ord][...]
132.\nucleus
133..\mathchar[ord][...], family "0, character "61
134\noad[ord][...]
135.\nucleus
136..\mathchar[ord][...], family "0, character "62
137\noad[ord][...]
138.\nucleus
139..\mathchar[ord][...], family "0, character "63
140
141> \inlinemath=
142\noad[ord][...]
143.\nucleus
144..\mathchar[ord][...], family "0, character "61
145\noad[ord][...]
146.\nucleus
147..\mathchar[ord][...], family "0, character "62
148\noad[ord][...]
149.\nucleus
150..\mathchar[ord][...], family "0, character "63
151\stoptyping
152
153\startbuffer[sample]
154${a} {b} {c}$ \quad ${a} {bc}$ \quad ${abc}$
155\stopbuffer
156
157\getbuffer
158
159If the previous log surprises you, that might be because in \CONTEXT\ we set up
160the engine differently: curly braces dont create ordinary atoms. However, when
161we set \type {\mathgroupingmode 0} we return to what the engine normally does.
162
163\starttyping
164> \inlinemath=
165\noad[ord][...]
166.\nucleus
167..\mathchar[ord][...], family "0, character "61
168\noad[ord][...]
169.\nucleus
170..\mathchar[ord][...], family "0, character "62
171\noad[ord][...]
172.\nucleus
173..\mathchar[ord][...], family "0, character "63
174
175> \inlinemath=
176\noad[ord][...]
177.\nucleus
178..\mathchar[ord][...], family "0, character "61
179\noad[ord][...]
180.\nucleus
181..\submlist[0][...][tracing depth 5 reached]
182
183> \inlinemath=
184\noad[ord][...]
185.\nucleus
186..\submlist[0][...][tracing depth 5 reached]
187\stoptyping
188
189A warning is in place: tracing in \LUAMETATEX\ gets extended when we feel the
190need to gat more feedback from the engine. But it will only be more.
191
192From the first example you can imagine what these sub lists look like: a list of
193ordinary atoms. The final list that is mix of nodes and yet unprocessed noads get
194fed into the mathtohlist function and eventually the noads become glyphs,
195boxes, kerns, glue and whatever makes sense. A lot goes on there: think scripts,
196fractions, fences, accents, radicals, spacing, break control.
197
198An example of more tricky scanning is shown here:
199
200\starttyping
201a 1 \over 2 b
202a {1}\over{2} b
203a {{1}\over{2}} b
204\stoptyping
205
206In this case the \type {\over} makes \TEX\ reconsider the last noad, remove if
207from the current list and save it for later, then scan for a following atom a
208single character turned atom or a braced sequence that then is an ordinary noad.
209In the end a fraction noad is made. When that gets processed later specific
210numerator and denominator styles get applied (explicitly entered style nodes of
211course overload this for the content). The fact that this construct is all about
212(implicit) ordinary noads, themselves captured in noads, combined with the wish
213for enforced consistent positioning of numerator and denominator, plus style
214overload, color support and whatever comes to mind means that in practice one
215will use a \type {\frac} macro that provides all that control. \footnote {There
216are now a \type {\Uover} primitives that look ahead and then of course still
217treat curly braces as math lists to be picked up.}
218
219A similar tricky case is this:
220
221\starttyping
222 ( a ( b c ) d )
223\left ( a \left ( b c \right ) d \right )
224\stoptyping
225
226Here the first line creates a list of noads but the second line create a fenced
227structure that is handled as a whole in order to make the fences match. \footnote
228{Actually instead of such a structure there could have been delimiters with
229backlinks but one never knows what happens with these links when processing
230passes are made so that fragility is avoided.} A fence noad will not break across
231lines as it is boxed and that is the reason why macro packages have these \type
232{\bigg} macros: they explicitly force a size using some trickery. In \LUAMETATEX\
233a fence object can actually be unpacked when the class is configured as such. It
234is one of the many extensions we have.
235
236There are some peculiar cases that one can run into but that actually are
237mentioned in the \TEX\ book. Often these reasons for intentional side effects
238become clear when one thinks of the average usage but unless one is willing to
239spend time on the \quote {fine points of math} they can also interfere with
240intentions. The next bits of code are just for the reader to look at. Try to
241predict the outcome. Watch out: in \LMTX\ the outcome is not what one gets by
242default in \LUATEX, \PDFTEX\ or regular \TEX. \footnote {One can set \typ
243{\mathgroupingmode = 0} to get close.}
244
245\starttyping
246$ 1 {\red } 2$\par
247$ 1 \color[red]{} 2$\par
248$ 1 \mathbin{\red } 2$\par
249$ a b { b} $
250$ a \pm b { b} $
251$ b $
252$ { b} $
253\stoptyping
254
255The message here is that when a user is coding the mindset with respect to
256grouping using curly braces has to be switched to math mode too. And how many
257users really read the relevant chapters of the \TEX\ book a couple of times (as
258much makes only sense after playing with math in \TEX)? Even if one doesnt grasp
259everything its a worthwhile read. Also consider this: did you really ask for an
260ordinary atom when you uses curly braces where no lists were expected? And what
261would have happened when ordinary related spacing had been set to nonzero?
262
263All the above (and plenty more) is why in \CONTEXT\ \LMTX\ we make extensive use
264of some \LUAMETATEX\ features, like: additional atom classes, configurable inter
265atom spacing and penalties, pairwise atom rules that can change classes, class
266based rendering options, more font parameters, configurable style instead of hard
267coded ones in constructs, more granular spacing, etc. That way we get quite
268predictable results but also drop some older (un)expected behavior and side
269effects. It is also why we cannot show many examples in the \LUAMETATEX\ manual:
270it uses \CONTEXT\ and we see no reason to complicate out lives (and spend energy
271on) turning off all the nicely cooperating features (and then for sure forgetting
272one) just for the sake of demos. It also gave us the opportunity to improve
273existing mechanisms andor at least simplify their sometimes complex code.
274
275One last word here about sequences of ordinary atoms: the traditional code path
276feeds ordinary atoms into a ligature and kerning routine and does that when it
277encounters one. However, in \OPENTYPE\ we dont have ligatures not (single) kerns
278so there that doesnt apply. As were not aware of traditional math fonts with
279ligatures and no one is likely to use these fonts with \LUAMETATEX\ the ligature
280code has been disabled. \footnote {It might show up in a different way if we feel
281the need in which case its more related to runtime patches to fonts and class
282bases ligature building.} The kerning has been redone a bit so that it permits us
283to fine tune spacing (which in \CONTEXT\ we control with goodie files). The
284mentioned routine can also add italic correction, but that happens selectively
285because it is driven by specifications and circumstances. It is one of the places
286where the approach differs from the original, if only for practical reasons.
287
288In addition to what we explained above, we mention the \typ {\beginmathgroup} and
289\typ {\endmathgroup} primitives behave like \typ {\begingroup} and \typ {\endgroup}
290but restore a style change inside the group. Style changes are actually injecting
291s special style noad which makes them sort of persistent till the next explicit
292change which can be confusing. This additional grouping model compensates for
293that.
294
295\stopsection
296
297\startsection[title={Unicode math characters}]
298
299For various reasons we need to encode a math character in a 32 bit number and
300because we often also need to keep track of families and classes the range of
301characters is limited to 20 bits. There are upto 64 classes (which is a lot more
302than in \LUATEX) and 64 families (less than in \LUATEX). The upper limit of
303characters is less that what \UNICODE\ offers but for math were okay. If needed
304we can provide less families.
305
306The math primitives from \TEX\ are kept as they are, except for the ones that
307convert from input to math commands: \type {mathcode}, and \type {delcode}. These
308two now allow for the larger character codes argument on the left hand side of
309the equals sign. The number variants of some primitives might be dropped in favor
310of the primitives that read more than one separate value (class, family and
311code). All relevant primitives are explained in the primitives chapter.
312
313A delimiter in traditional \TEX\ combines two definitions: the regular character
314and the way it can become a larger (extensible) one. The small character is just
315like a math character but the larger one can come from a different font (family).
316However, in \OPENTYPE\ math fonts the larger sizes (variants) and extensibles
317(parts) come from the same font. For that reason \LUAMETATEX\ also accepts a math
318character when a delimited specifier is expected. It basically means that we
319could remove delimiters as such from the engine. After all, when we let \LUA\
320load a traditional font we can as well use virtual fonts to handle the variants
321and extensibles, which is indeed the case when we support the jmh fonts.
322
323\stopsection
324
325\startsection[title={Math classes}]
326
327Most characters belong to a so called math class which can be set for each
328character if needed. There are upto 64 classes of which at this moment about 20
329are predefined so, taking some future usage by the engine into account,you can
330assume 32 upto 60 to be available for any purpose. The number of families has
331been reduced from 256 to 64 which is plenty for daily use in an \OPENTYPE\ setup.
332If we ever need to expand the \UNICODE\ range there will be less families or we
333just go for a larger internal record. The values of begin and end classes and the
334number of classes can be fetched from the \LUA\ status table. There are callbacks
335that makes it possible to report user classes when there is the need.
336
337\stopsection
338
339\startsection[title=Setting up the engine]
340
341Rendering math has long been dominated by \TEX\ but that changed when \MICROSOFT\
342came with \OPENTYPE\ math: an implementation as well as a font. Some of that was
343modeled after \TEX\ and some was dictated (we think) by the way word processors
344deal with math. For instance, traditional \TEX\ math has a limited set of glyph
345properties and therefore has a somewhat complex interplay between width and
346italic correction. There are no kerns, contrary to \OPENTYPE\ math fonts that
347provides staircase kerns. Interestingly \TEX\ does have some ligature building
348going on in the engine.
349
350In traditional \TEX\ italic correction gets added to the width and selectively
351removed later (or compensated by some shift andor cheating with the box
352width). When we started with \LUATEX\ we had to gamble quite a bit about how to
353apply parameters and glyph properties which resulted in different code paths,
354heuristics, etc. That worked on the average but fonts are often not perfect and
355when served as an example for another one the bad bits can be inherited. That
356said, over time the descriptions improved and this is what the \OPENTYPE\
357specification has to say about italic correction now \footnote {\type
358{https:docs.microsoft.comenustypographyopentypespecmath}}:
359
360\startitemize [n]
361 \startitem
362 When a run of slanted characters is followed by a straight character
363 (such as an operator or a delimiter), the italics correction of the last
364 glyph is added to its advance width.
365 \stopitem
366 \startitem
367 When positioning limits on an Nary operator (e.g., integral sign), the
368 horizontal position of the upper limit is moved to the right by half the
369 italics correction, while the position of the lower limit is moved to the
370 left by the same distance.
371 \stopitem
372 \startitem
373 When positioning superscripts and subscripts, their default horizontal
374 positions are also different by the amount of the italics correction of
375 the preceding glyph.
376 \stopitem
377\stopitemize
378
379The first rule is complicated by the fact that \quote {followed} is vague: in
380\TEX\ the sequence \typ {$ a b c def $} results in six separate atoms, separated
381by inter atom spacing. The characters in these atoms are the nucleus and there
382can be a super andor subscript attached and in \LUAMETATEX\ also a prime,
383superprescript andor subprescript.
384
385The second rule comes from \TEX\ and one can wonder why the available top accent
386anchor is not used. Maybe because bottom accent anchors are missing? Anyway,
387were stuck with this now.
388
389The third rule also seems to come from \TEX. Take the \quote {\it f} character:
390in \TEX\ fonts that one has a narrow width and part sticks out (in some even at
391the left edge). That means that when the subscript gets attached it will move
392inwards relative to the real dimensions. Before the superscript an italic
393correction is added so what that correction is nonzero the scripts are
394horizontally shifted relative to each other.
395
396Now look at this specification of staircase kerns \footnote {Idem.}:
397
398\startnarrower
399 The \type {MathKernInfo} table provides mathematical kerning values used for
400 kerning of subscript and superscript glyphs relative to a base glyph. Its
401 purpose is to improve spacing in situations such as omega with superscript f
402 or capital V with subscript capital A.
403
404 Mathematical kerning is height dependent; that is, different kerning amounts
405 can be specified for different heights within a glyph’s vertical extent. For
406 any given glyph, different values can be specified for four corner positions,
407 topright, toleft, etc., allowing for different kerning adjustments
408 according to whether the glyph occurs as a subscript, a superscript, a base
409 being kerned with a subscript, or a base being kerned with a superscript.
410\stopnarrower
411
412Again were talking super and subscripts and should we now look at the italic
413correction or assume that the kerns do the job? This is a mixed bag because
414scripts are not always (single) characters. We have to guess a bit here. After
415years of experimenting we came to the conclusion that it will never be okay so
416thats why we settled on controls and runtime fixes to fonts.
417
418This means that processing math is controlled by \typ {\mathfontcontrol}, a
419numeric bitset parameter. The recommended bits are marked with a star but it
420really depends on the macro package to set up the machinery well. Of course one
421can just enable all and see what happens. \footnote {This model was more granular
422and could even be font (and character) specific but that was dropped because
423fonts are too inconsistent and an occasional fit is more robust that a generally
424applied rule.} A list of possible control bits can be found in the primitives
425chapter where we discuss this parameter.
426
427So, to summarize: the reason for this approach is that traditional and \OPENTYPE\
428fonts have different approaches (especially when it comes to dealing with the
429width and italic corrections) and is even more complicated by the fact that the
430fonts are often inconsistent (within and between). In \CONTEXT\ we deal with this
431by runtime fixes to fonts. In any case the Cambria font is taken as reference.
432
433{\em It is important to notice that in \CONTEXT\ we no longer use italic
434correction at all. After many experiments Mikael Sundvist and I settled on a
435different approach where we use true widths, proper anchors, a new set of corner
436kerns, additional parameters and more. We tweak the fonts to match this model
437which in our opinion gives better results and less interference. We could
438actually simplify the engine and kick italics out of math but for the moment we
439keep it around so that we can show improvements in manuals and articles.}
440
441\stopsection
442
443\startsection[title={Math styles}]
444
445It is possible to discover the math style that will be used for a formula in an
446expandable fashion (while the math list is still being read). To make this
447possible, \LUATEX\ adds the new primitive: \typ {\mathstyle}. This is a \quote
448{convert command} like e.g. \typ {\romannumeral}: its value can only be read,
449not set. Beware that contrary to \LUATEX\ this is now a proper number so you need
450to use \type {\number} or \type {\the} in order to serialize it.
451
452The returned value is between 0 and 7 (in math mode), or $1$ (all other modes).
453For easy testing, the eight math style commands have been altered so that they can
454be used as numeric values, so you can write code like this:
455
456\starttyping
457\ifnum\mathstyle=\textstyle
458 \message{normal text style}
459\else \ifnum\mathstyle=\crampedtextstyle
460 \message{cramped text style}
461\fi \fi
462\stoptyping
463
464Sometimes you wont get what you expect so a bit of explanation might help to
465understand what happens. When math is parsed and expanded it gets turned into a
466linked list. In a second pass the formula will be build. This has to do with the
467fact that in order to determine the automatically chosen sizes (in for instance
468fractions) following content can influence preceding sizes. A side effect of this
469is for instance that one cannot change the definition of a font family (and
470thereby reusing numbers) because the number that got used is stored and used in
471the second pass (so changing \type {\fam 12} midformula spoils over to
472preceding use of that family).
473
474The style switching primitives like \type {\textstyle} are turned into nodes so the
475styles set there are frozen. The \type {\mathchoice} primitive results in four
476lists being constructed of which one is used in the second pass. The fact that
477some automatic styles are not yet known also means that the \type {\mathstyle}
478primitive expands to the current style which can of course be different from the
479one really used. Its a snapshot of the first pass state. As a consequence in the
480following example you get a style number (first pass) typeset that can actually
481differ from the used style (second pass). In the case of a math choice used
482ungrouped, the chosen style is used after the choice too, unless you group.
483
484\startbuffer[1]
485 [a:\number\mathstyle]\quad
486 \bgroup
487 \mathchoice
488 {\bf \scriptstyle (x:d :\number\mathstyle)}
489 {\bf \scriptscriptstyle (x:t :\number\mathstyle)}
490 {\bf \scriptscriptstyle (x:s :\number\mathstyle)}
491 {\bf \scriptscriptstyle (x:ss:\number\mathstyle)}
492 \egroup
493 \quad[b:\number\mathstyle]\quad
494 \mathchoice
495 {\bf \scriptstyle (y:d :\number\mathstyle)}
496 {\bf \scriptscriptstyle (y:t :\number\mathstyle)}
497 {\bf \scriptscriptstyle (y:s :\number\mathstyle)}
498 {\bf \scriptscriptstyle (y:ss:\number\mathstyle)}
499 \quad[c:\number\mathstyle]\quad
500 \bgroup
501 \mathchoice
502 {\bf \scriptstyle (z:d :\number\mathstyle)}
503 {\bf \scriptscriptstyle (z:t :\number\mathstyle)}
504 {\bf \scriptscriptstyle (z:s :\number\mathstyle)}
505 {\bf \scriptscriptstyle (z:ss:\number\mathstyle)}
506 \egroup
507 \quad[d:\number\mathstyle]
508\stopbuffer
509
510\startbuffer[2]
511 [a:\number\mathstyle]\quad
512 \begingroup
513 \mathchoice
514 {\bf \scriptstyle (x:d :\number\mathstyle)}
515 {\bf \scriptscriptstyle (x:t :\number\mathstyle)}
516 {\bf \scriptscriptstyle (x:s :\number\mathstyle)}
517 {\bf \scriptscriptstyle (x:ss:\number\mathstyle)}
518 \endgroup
519 \quad[b:\number\mathstyle]\quad
520 \mathchoice
521 {\bf \scriptstyle (y:d :\number\mathstyle)}
522 {\bf \scriptscriptstyle (y:t :\number\mathstyle)}
523 {\bf \scriptscriptstyle (y:s :\number\mathstyle)}
524 {\bf \scriptscriptstyle (y:ss:\number\mathstyle)}
525 \quad[c:\number\mathstyle]\quad
526 \begingroup
527 \mathchoice
528 {\bf \scriptstyle (z:d :\number\mathstyle)}
529 {\bf \scriptscriptstyle (z:t :\number\mathstyle)}
530 {\bf \scriptscriptstyle (z:s :\number\mathstyle)}
531 {\bf \scriptscriptstyle (z:ss:\number\mathstyle)}
532 \endgroup
533 \quad[d:\number\mathstyle]
534\stopbuffer
535
536\typebuffer[1]
537
538This gives:
539
540\blank $\displaystyle \getbuffer[1]$ \blank
541\blank $\textstyle \getbuffer[1]$ \blank
542
543Using \type {\begingroup} \unknown\ \type {\endgroup} instead gives:
544
545\blank $\displaystyle \getbuffer[2]$ \blank
546\blank $\textstyle \getbuffer[2]$ \blank
547
548This might look wrong but its just a side effect of \type {\mathstyle} expanding
549to the current (first pass) style and the number being injected in the list that
550gets converted in the second pass. It all makes sense and it illustrates the
551importance of grouping. In fact, the math choice style being effective afterwards
552has advantages. It would be hard to get it otherwise.
553
554So far for the more \LUATEX ish approach. One problem with \type {\mathstyle} is
555that when you got it, and want to act upon it, you need to remap it onto say \type
556{\scriptstyle} which can be done with an eight branched \type {\ifcase}. This is
557why we also have a more efficient alternative that you can use in macros:
558
559\starttyping
560\normalexpand{ ... \givenmathstyle\the\mathstyle ...}
561\normalexpand{ ... \givenmathstyle\the\mathstackstyle ...}
562\stoptyping
563
564This new primitive \typ {\givenmathstyle} accepts a numeric value. The \typ
565{\mathstackstyle} primitive is just a bonus (it complements \type {\mathstack}).
566
567The styles that the different math components and their sub components start out
568with are no longer hard coded but can be set at runtime:
569
570\starttabulate
571\FL
572\BC primitive name \BC default \NC \NR
573\TL
574\NC \type {\Umathoverlinevariant} \NC cramped \NC \NR
575\NC \type {\Umathunderlinevariant} \NC normal \NC \NR
576\NC \type {\Umathoverdelimitervariant} \NC small \NC \NR
577\NC \type {\Umathunderdelimitervariant} \NC small \NC \NR
578\NC \type {\Umathdelimiterovervariant} \NC normal \NC \NR
579\NC \type {\Umathdelimiterundervariant} \NC normal \NC \NR
580\NC \type {\Umathhextensiblevariant} \NC normal \NC \NR
581\NC \type {\Umathvextensiblevariant} \NC normal \NC \NR
582\NC \type {\Umathfractionvariant} \NC cramped \NC \NR
583\NC \type {\Umathradicalvariant} \NC cramped \NC \NR
584\NC \type {\Umathdegreevariant} \NC doublesuperscript \NC \NR
585\NC \type {\Umathaccentvariant} \NC cramped \NC \NR
586\NC \type {\Umathtopaccentvariant} \NC cramped \NC \NR
587\NC \type {\Umathbottomaccentvariant} \NC cramped \NC \NR
588\NC \type {\Umathoverlayaccentvariant} \NC cramped \NC \NR
589\NC \type {\Umathnumeratorvariant} \NC numerator \NC \NR
590\NC \type {\Umathdenominatorvariant} \NC denominator \NC \NR
591\NC \type {\Umathsuperscriptvariant} \NC superscript \NC \NR
592\NC \type {\Umathsubscriptvariant} \NC subscript \NC \NR
593\NC \type {\Umathprimevariant} \NC superscript \NC \NR
594\NC \type {\Umathstackvariant} \NC numerator \NC \NR
595\LL
596\stoptabulate
597
598These defaults remap styles are as follows:
599
600\starttabulate[Tlll]
601\FL
602\BC default \BC result \BC mapping \NC \NR
603\TB
604\NC cramped \NC cramp the style \NC D D T T S S SS SS \NC \NR
605\NC subscript \NC smaller and cramped \NC S S S S SS SS SS SS \NC \NR
606\NC small \NC smaller \NC S S S S SS SS SS SS \NC \NR
607\NC superscript \NC smaller \NC S S S S SS SS SS SS \NC \NR
608\NC smaller \NC smaller unless already SS \NC S S S S SS SS SS SS \NC \NR
609\NC numerator \NC smaller unless already SS \NC S S S S SS SS SS SS \NC \NR
610\NC denominator \NC smaller, all cramped \NC S S S S SS SS SS SS \NC \NR
611\NC doublesuperscript \NC smaller, keep cramped \NC S S S S SS SS SS SS \NC \NR
612\LL
613\stoptabulate
614
615The main reason for opening this up was that it permits experiments and removed
616hard coded internal values. But as these defaults served well for decades there
617are no real reasons to change them.
618
619There are a few math commands in \TEX\ where the style that will be used is not
620known straight from the start. These commands (\type {\over}, \type {\atop},
621\typ {\overwithdelims}, \typ {\atopwithdelims}) would therefore normally return
622wrong values for \type {\mathstyle}. To fix this, \LUATEX\ introduces a special
623prefix command: \type {\mathstack}:
624
625\starttyping
626$\mathstack {a \over b}$
627\stoptyping
628
629The \type {\mathstack} command will scan the next brace and start a new math group
630with the correct (numerator) math style. The \typ {\mathstackstyle} primitive
631relates to this feature.
632
633\LUATEX\ has four new primitives to set the cramped math styles directly:
634
635\starttyping
636\crampeddisplaystyle
637\crampedtextstyle
638\crampedscriptstyle
639\crampedscriptscriptstyle
640\stoptyping
641
642These additional commands are not all that valuable on their own, but they come
643in handy as arguments to the math parameter settings that will be added shortly.
644
645Because internally the eight styles are represented as numbers some of the new
646primitives that relate to them also work with numbers and often you can use them
647mixed. The \typ {\tomathstyle} prefix converts a symbolic style into a number so
648\typ {\number \tomathstyle \crampedscriptstyle} gives\number \tomathstyle
649\crampedscriptstyle.
650
651In Eijkhouts \quotation {\TEX\ by Topic} the rules for handling styles in scripts
652are described as follows:
653
654\startitemize
655\startitem
656 In any style superscripts and subscripts are taken from the next smaller style.
657 Exception: in display style they are in script style.
658\stopitem
659\startitem
660 Subscripts are always in the cramped variant of the style; superscripts are only
661 cramped if the original style was cramped.
662\stopitem
663\startitem
664 In an \type {..\over..} formula in any style the numerator and denominator are
665 taken from the next smaller style.
666\stopitem
667\startitem
668 The denominator is always in cramped style; the numerator is only in cramped
669 style if the original style was cramped.
670\stopitem
671\startitem
672 Formulas under a \type {\sqrt} or \type {\overline} are in cramped style.
673\stopitem
674\stopitemize
675
676In \LUATEX\ one can set the styles in more detail which means that you sometimes
677have to set both normal and cramped styles to get the effect you want. (Even) if
678we force styles in the script using \typ {\scriptstyle} and \typ
679{\crampedscriptstyle} we get this:
680
681\startbuffer[demo]
682\starttabulate
683\FL
684\BC style \BC example \NC \NR
685\TL
686\NC default \NC $b{x=xx}{x=xx}$ \NC \NR
687\NC script \NC $b{\scriptstyle x=xx}{\scriptstyle x=xx}$ \NC \NR
688\NC crampedscript \NC $b{\crampedscriptstyle x=xx}{\crampedscriptstyle x=xx}$ \NC \NR
689\LL
690\stoptabulate
691\stopbuffer
692
693\getbuffer[demo]
694
695Now we set the following parameters using \type {\setmathspacing} that accepts two
696class identifier, a style and a value.
697
698\startbuffer[setup]
699\setmathspacing 0 3 \scriptstyle = 30mu
700\setmathspacing 0 3 \scriptstyle = 30mu
701\stopbuffer
702
703\typebuffer[setup]
704
705This gives a different result:
706
707\start\getbuffer[setup,demo]\stop
708
709But, as this is not what is expected (visually) we should say:
710
711\startbuffer[setup]
712\setmathspacing 0 3 \scriptstyle = 30mu
713\setmathspacing 0 3 \scriptstyle = 30mu
714\setmathspacing 0 3 \crampedscriptstyle = 30mu
715\setmathspacing 0 3 \crampedscriptstyle = 30mu
716\stopbuffer
717
718\typebuffer[setup]
719
720Now we get:
721
722\start\getbuffer[setup,demo]\stop
723
724\stopsection
725
726\startsection[title={Math parameters}]
727
728In \LUATEX, the font dimension parameters that \TEX\ used in math typesetting are
729now accessible via primitive commands. In fact, refactoring of the math engine
730has resulted in turning some hard codes properties into parameters.
731
732{\em The next needs checking ...}
733
734\starttabulate
735\FL
736\BC primitive name \BC description \NC \NR
737\TL
738\NC \type {\Umathquad} \NC the width of 18 mus \NC \NR
739\NC \type {\Umathaxis} \NC height of the vertical center axis of
740 the math formula above the baseline \NC \NR
741\NC \type {\Umathoperatorsize} \NC minimum size of large operators in display mode \NC \NR
742\NC \type {\Umathoverbarkern} \NC vertical clearance above the rule \NC \NR
743\NC \type {\Umathoverbarrule} \NC the width of the rule \NC \NR
744\NC \type {\Umathoverbarvgap} \NC vertical clearance below the rule \NC \NR
745\NC \type {\Umathunderbarkern} \NC vertical clearance below the rule \NC \NR
746\NC \type {\Umathunderbarrule} \NC the width of the rule \NC \NR
747\NC \type {\Umathunderbarvgap} \NC vertical clearance above the rule \NC \NR
748\NC \type {\Umathradicalkern} \NC vertical clearance above the rule \NC \NR
749\NC \type {\Umathradicalrule} \NC the width of the rule \NC \NR
750\NC \type {\Umathradicalvgap} \NC vertical clearance below the rule \NC \NR
751\NC \type {\Umathradicaldegreebefore}\NC the forward kern that takes place before placement of
752 the radical degree \NC \NR
753\NC \type {\Umathradicaldegreeafter} \NC the backward kern that takes place after placement of
754 the radical degree \NC \NR
755\NC \type {\Umathradicaldegreeraise} \NC this is the percentage of the total height and depth of
756 the radical sign that the degree is raised by; it is
757 expressed in \type {percents}, so 60\% is expressed as the
758 integer $60$ \NC \NR
759\NC \type {\Umathstackvgap} \NC vertical clearance between the two
760 elements in an \type {\atop} stack \NC \NR
761\NC \type {\Umathstacknumup} \NC numerator shift upward in \type {\atop} stack \NC \NR
762\NC \type {\Umathstackdenomdown} \NC denominator shift downward in \type {\atop} stack \NC \NR
763\NC \type {\Umathfractionrule} \NC the width of the rule in a \type {\over} \NC \NR
764\NC \type {\Umathfractionnumvgap} \NC vertical clearance between the numerator and the rule \NC \NR
765\NC \type {\Umathfractionnumup} \NC numerator shift upward in \type {\over} \NC \NR
766\NC \type {\Umathfractiondenomvgap} \NC vertical clearance between the denominator and the rule \NC \NR
767\NC \type {\Umathfractiondenomdown} \NC denominator shift downward in \type {\over} \NC \NR
768\NC \type {\Umathfractiondelsize} \NC minimum delimiter size for \type {\...withdelims} \NC \NR
769\NC \type {\Umathlimitabovevgap} \NC vertical clearance for limits above operators \NC \NR
770\NC \type {\Umathlimitabovebgap} \NC vertical baseline clearance for limits above operators \NC \NR
771\NC \type {\Umathlimitabovekern} \NC space reserved at the top of the limit \NC \NR
772\NC \type {\Umathlimitbelowvgap} \NC vertical clearance for limits below operators \NC \NR
773\NC \type {\Umathlimitbelowbgap} \NC vertical baseline clearance for limits below operators \NC \NR
774\NC \type {\Umathlimitbelowkern} \NC space reserved at the bottom of the limit \NC \NR
775\NC \type {\Umathoverdelimitervgap} \NC vertical clearance for limits above delimiters \NC \NR
776\NC \type {\Umathoverdelimiterbgap} \NC vertical baseline clearance for limits above delimiters \NC \NR
777\NC \type {\Umathunderdelimitervgap} \NC vertical clearance for limits below delimiters \NC \NR
778\NC \type {\Umathunderdelimiterbgap} \NC vertical baseline clearance for limits below delimiters \NC \NR
779\NC \type {\Umathsubshiftdrop} \NC subscript drop for boxes and subformulas \NC \NR
780\NC \type {\Umathsubshiftdown} \NC subscript drop for characters \NC \NR
781\NC \type {\Umathsupshiftdrop} \NC superscript drop (raise, actually) for boxes and subformulas \NC \NR
782\NC \type {\Umathsupshiftup} \NC superscript raise for characters \NC \NR
783\NC \type {\Umathsubsupshiftdown} \NC subscript drop in the presence of a superscript \NC \NR
784\NC \type {\Umathsubtopmax} \NC the top of standalone subscripts cannot be higher than this
785 above the baseline \NC \NR
786\NC \type {\Umathsupbottommin} \NC the bottom of standalone superscripts cannot be less than
787 this above the baseline \NC \NR
788\NC \type {\Umathsupsubbottommax} \NC the bottom of the superscript of a combined super and subscript
789 be at least as high as this above the baseline \NC \NR
790\NC \type {\Umathsubsupvgap} \NC vertical clearance between super and subscript \NC \NR
791\NC \type {\Umathspaceafterscript} \NC additional space added after a super or subscript \NC \NR
792\NC \type {\Umathconnectoroverlapmin}\NC minimum overlap between parts in an extensible recipe \NC \NR
793\LL
794\stoptabulate
795
796In addition to the above official \OPENTYPE\ font parameters we have these (the
797undefined will get presets, quite likely zero):
798
799\starttabulate
800\FL
801\BC primitive name \BC description \NC \NR
802\TL
803\NC \type {\Umathconnectoroverlapmin} \NC \NC \NR
804\NC \type {\Umathsubsupshiftdown} \NC \NC \NR
805\NC \type {\Umathfractiondelsize} \NC \NC \NR
806\NC \type {\Umathnolimitsupfactor} \NC a multiplier for the way limits are shifted up and down \NC \NR
807\NC \type {\Umathnolimitsubfactor} \NC a multiplier for the way limits are shifted up and down \NC \NR
808\NC \type {\Umathaccentbasedepth} \NC the complement of \type {\Umathaccentbaseheight} \NC \NR
809\NC \type {\Umathflattenedaccentbasedepth} \NC the complement of \type {\Umathflattenedaccentbaseheight} \NC \NR
810\NC \type {\Umathspacebeforescript} \NC \NC \NR
811\NC \type {\Umathprimeraise} \NC \NC \NR
812\NC \type {\Umathprimeraisecomposed} \NC \NC \NR
813\NC \type {\Umathprimeshiftup} \NC the prime variant of \type {\Umathsupshiftup} \NC \NR
814\NC \type {\Umathprimespaceafter} \NC the prescript variant of \type {\Umathspaceafterscript} \NC \NR
815\NC \type {\Umathprimeshiftdrop} \NC the prime variant of \type {\Umathsupshiftdrop} \NC \NR
816\NC \type {\Umathskeweddelimitertolerance} \NC \NC \NR
817\NC \type {\Umathaccenttopshiftup} \NC the amount that a top accent is shifted up \NC \NR
818\NC \type {\Umathaccentbottomshiftdown} \NC the amount that a bottom accent is shifted down \NC \NR
819\NC \type {\Umathaccenttopovershoot} \NC \NC \NR
820\NC \type {\Umathaccentbottomovershoot} \NC \NC \NR
821\NC \type {\Umathaccentsuperscriptdrop} \NC \NC \NR
822\NC \type {\Umathaccentsuperscriptpercent} \NC \NC \NR
823\NC \type {\Umathaccentextendmargin} \NC margins added to automatically extended accents \NC \NR
824\NC \type {\Umathflattenedaccenttopshiftup} \NC the amount that a wide top accent is shifted up \NC \NR
825\NC \type {\Umathflattenedaccentbottomshiftdown} \NC the amount that a wide bottom accent is shifted down \NC \NR
826\NC \type {\Umathdelimiterpercent} \NC \NC \NR
827\NC \type {\Umathdelimitershortfall} \NC \NC \NR
828\NC \type {\Umathradicalextensiblebefore} \NC \NC \NR
829\NC \type {\Umathradicalextensibleafter} \NC \NC \NR
830\LL
831\stoptabulate
832
833These relate to the font parameters and in \CONTEXT\ we assign some different
834defaults and tweak them in the goodie files:
835
836\starttabulate[TTc]
837\FL
838\BC font parameter \BC primitive name \BC default \NC \NR
839\TL
840\NC MinConnectorOverlap \NC \type {\Umathconnectoroverlapmin} \NC 0 \NC \NR
841\NC SubscriptShiftDownWithSuperscript \NC \type {\Umathsubsupshiftdown} \NC inherited \NC \NR
842\NC FractionDelimiterSize \NC \type {\Umathfractiondelsize} \NC undefined \NC \NR
843\NC FractionDelimiterDisplayStyleSize \NC \type {\Umathfractiondelsize} \NC undefined \NC \NR
844\NC NoLimitSubFactor \NC \type {\Umathnolimitsupfactor} \NC 0 \NC \NR
845\NC NoLimitSupFactor \NC \type {\Umathnolimitsubfactor} \NC 0 \NC \NR
846\NC AccentBaseDepth \NC \type {\Umathaccentbasedepth} \NC reserved \NC \NR
847\NC FlattenedAccentBaseDepth \NC \type {\Umathflattenedaccentbasedepth} \NC reserved \NC \NR
848\NC SpaceBeforeScript \NC \type {\Umathspacebeforescript} \NC 0 \NC \NR
849\NC PrimeRaisePercent \NC \type {\Umathprimeraise} \NC 0 \NC \NR
850\NC PrimeRaiseComposedPercent \NC \type {\Umathprimeraisecomposed} \NC 0 \NC \NR
851\NC PrimeShiftUp \NC \type {\Umathprimeshiftup} \NC 0 \NC \NR
852\NC PrimeShiftUpCramped \NC \type {\Umathprimeshiftup} \NC 0 \NC \NR
853\NC PrimeSpaceAfter \NC \type {\Umathprimespaceafter} \NC 0 \NC \NR
854\NC PrimeBaselineDropMax \NC \type {\Umathprimeshiftdrop} \NC 0 \NC \NR
855\NC SkewedDelimiterTolerance \NC \type {\Umathskeweddelimitertolerance} \NC 0 \NC \NR
856\NC AccentTopShiftUp \NC \type {\Umathaccenttopshiftup} \NC undefined \NC \NR
857\NC AccentBottomShiftDown \NC \type {\Umathaccentbottomshiftdown} \NC undefined \NC \NR
858\NC AccentTopOvershoot \NC \type {\Umathaccenttopovershoot} \NC 0 \NC \NR
859\NC AccentBottomOvershoot \NC \type {\Umathaccentbottomovershoot} \NC 0 \NC \NR
860\NC AccentSuperscriptDrop \NC \type {\Umathaccentsuperscriptdrop} \NC 0 \NC \NR
861\NC AccentSuperscriptPercent \NC \type {\Umathaccentsuperscriptpercent} \NC 0 \NC \NR
862\NC AccentExtendMargin \NC \type {\Umathaccentextendmargin} \NC 0 \NC \NR
863\NC FlattenedAccentTopShiftUp \NC \type {\Umathflattenedaccenttopshiftup} \NC undefined \NC \NR
864\NC FlattenedAccentBottomShiftDown \NC \type {\Umathflattenedaccentbottomshiftdown} \NC undefined \NC \NR
865\NC DelimiterPercent \NC \type {\Umathdelimiterpercent} \NC 0 \NC \NR
866\NC DelimiterShortfall \NC \type {\Umathdelimitershortfall} \NC 0 \NC \NR
867\LL
868\stoptabulate
869
870These parameters not only provide a bit more control over rendering, they also
871can be used in compensating issues in font, because no font is perfect. Some are
872the side effects of experiments and they have CamelCase companions in the \type
873{MathConstants} table. For historical reasons the names are a bit inconsistent as
874some originate in \TEX\ so we prefer to keep those names. Not many users will
875mess around with these font parameters anyway. \footnote {I wonder if some names
876should change, so that decision is pending.}
877
878Each of the parameters in this section can be set by a command like this:
879
880\starttyping
881\Umathquad\displaystyle=1em
882\stoptyping
883
884they obey grouping, and you can use \type {\the\Umathquad\displaystyle} if
885needed.
886
887There are quite some parameters that can be set and there are eight styles, which means a lot
888of keying in. For that reason is is possible to set parameters groupwise:
889
890\starttabulate[lcccccccc]
891\FL
892\BC primitive name \BC D \BC D \BC T \BC T \BC S \BC S \BC SS \BC SS \NC \NR
893\TL
894\NC \type {\alldisplaystyles} \NC$$\NC$ $\NC \NC \NC \NC \NC \NC \NC \NR
895\NC \type {\alltextstyles} \NC \NC \NC$$\NC$ $\NC \NC \NC \NC \NC \NR
896\NC \type {\allscriptstyles} \NC \NC \NC \NC \NC$$\NC$ $\NC \NC \NC \NR
897\NC \type {\allscriptscriptstyles} \NC \NC \NC \NC \NC \NC \NC$ $\NC$ $\NC \NR
898\NC \type {\allmathstyles} \NC$$\NC$ $\NC$$\NC$ $\NC$$\NC$ $\NC$ $\NC$ $\NC \NR
899\NC \type {\allmainstyles} \NC \NC \NC \NC \NC \NC \NC \NC \NC \NR
900\NC \type {\allsplitstyles} \NC$$\NC$ $\NC$$\NC$ $\NC$$\NC$ $\NC$ $\NC$ $\NC \NR
901\NC \type {\allunsplitstyles} \NC \NC \NC \NC \NC$$\NC$ $\NC$ $\NC$ $\NC \NR
902\NC \type {\alluncrampedstyles} \NC$$\NC \NC$$\NC \NC$$\NC \NC$ $\NC \NC \NR
903\NC \type {\allcrampedstyles} \NC \NC$ $\NC \NC$ $\NC \NC$ $\NC \NC$ $\NC \NR
904\LL
905\stoptabulate
906
907These groups are especially handy when you set up inter atom spacing, pre and
908post atom penalties and atom rules.
909
910We already introduced the font specific math parameters but we tell abit more
911about them and how they relate to the original \TEX\ font dimensions.
912
913While it is nice to have these math parameters available for tweaking, it would
914be tedious to have to set each of them by hand. For this reason, \LUATEX\
915initializes a bunch of these parameters whenever you assign a font identifier to
916a math family based on either the traditional math font dimensions in the font
917(for assignments to math family2 and3 using \TFMbased fonts like \type
918{cmsy} and \type {cmex}), or based on the named values in a potential \type
919{MathConstants} table when the font is loaded via Lua. If there is a \type
920{MathConstants} table, this takes precedence over font dimensions, and in that
921case no attention is paid to which family is being assigned to: the \type
922{MathConstants} tables in the last assigned family sets all parameters.
923
924In the table below, the oneletter style abbreviations and symbolic tfm font
925dimension names match those used in the \TeX book. Assignments to \typ
926{\textfont} set the values for the cramped and uncramped display and text styles,
927\typ {\scriptfont} sets the script styles, and \typ {\scriptscriptfont} sets the
928scriptscript styles, so we have eight parameters for three font sizes. In the
929\TFM\ case, assignments only happen in family2 and family3 (and of course only
930for the parameters for which there are font dimensions).
931
932Besides the parameters below, \LUATEX\ also looks at the \quote {space} font
933dimension parameter. For math fonts, this should be set to zero.
934
935\def\MathLine#1#2#3#4#5
936 {\TB
937 \NC \llap{\high{\tx #2\enspace}}\tt \type {#1} \NC \tt #5 \NC \NR
938 \NC \tx #3 \NC \tt #4 \NC \NR}
939
940\starttabulate[ll]
941\FL
942\BC variable style \BC tfm opentype \NC \NR
943\TL
944\MathLine{\Umathaxis} {} {} {AxisHeight} {axisheight}
945\MathLine{\Umathaccentbaseheight} {} {} {AccentBaseHeight} {xheight}
946\MathLine{\Umathflattenedaccentbaseheight}{} {} {FlattenedAccentBaseHeight} {xheight}
947\MathLine{\Umathoperatorsize} {6} {D, D} {DisplayOperatorMinHeight} {\emdash}
948\MathLine{\Umathfractiondelsize} {9} {D, D} {FractionDelimiterDisplayStyleSize} {delim1}
949\MathLine{\Umathfractiondelsize} {9} {T, T, S, S, SS, SS}{FractionDelimiterSize} {delim2}
950\MathLine{\Umathfractiondenomdown} {} {D, D} {FractionDenominatorDisplayStyleShiftDown}{denom1}
951\MathLine{\Umathfractiondenomdown} {} {T, T, S, S, SS, SS}{FractionDenominatorShiftDown} {denom2}
952\MathLine{\Umathfractiondenomvgap} {} {D, D} {FractionDenominatorDisplayStyleGapMin} {3*defaultrulethickness}
953\MathLine{\Umathfractiondenomvgap} {} {T, T, S, S, SS, SS}{FractionDenominatorGapMin} {defaultrulethickness}
954\MathLine{\Umathfractionnumup} {} {D, D} {FractionNumeratorDisplayStyleShiftUp} {num1}
955\MathLine{\Umathfractionnumup} {} {T, T, S, S, SS, SS}{FractionNumeratorShiftUp} {num2}
956\MathLine{\Umathfractionnumvgap} {} {D, D} {FractionNumeratorDisplayStyleGapMin} {3*defaultrulethickness}
957\MathLine{\Umathfractionnumvgap} {} {T, T, S, S, SS, SS}{FractionNumeratorGapMin} {defaultrulethickness}
958\MathLine{\Umathfractionrule} {} {} {FractionRuleThickness} {defaultrulethickness}
959\MathLine{\Umathskewedfractionhgap} {} {} {SkewedFractionHorizontalGap} {mathquad2}
960\MathLine{\Umathskewedfractionvgap} {} {} {SkewedFractionVerticalGap} {mathxheight}
961\MathLine{\Umathlimitabovebgap} {} {} {UpperLimitBaselineRiseMin} {bigopspacing3}
962\MathLine{\Umathlimitabovekern} {1} {} {0} {bigopspacing5}
963\MathLine{\Umathlimitabovevgap} {} {} {UpperLimitGapMin} {bigopspacing1}
964\MathLine{\Umathlimitbelowbgap} {} {} {LowerLimitBaselineDropMin} {bigopspacing4}
965\MathLine{\Umathlimitbelowkern} {1} {} {0} {bigopspacing5}
966\MathLine{\Umathlimitbelowvgap} {} {} {LowerLimitGapMin} {bigopspacing2}
967\MathLine{\Umathoverdelimitervgap} {} {} {StretchStackGapBelowMin} {bigopspacing1}
968\MathLine{\Umathoverdelimiterbgap} {} {} {StretchStackTopShiftUp} {bigopspacing3}
969\MathLine{\Umathunderdelimitervgap} {} {} {StretchStackGapAboveMin} {bigopspacing2}
970\MathLine{\Umathunderdelimiterbgap} {} {} {StretchStackBottomShiftDown} {bigopspacing4}
971\MathLine{\Umathoverbarkern} {} {} {OverbarExtraAscender} {defaultrulethickness}
972\MathLine{\Umathoverbarrule} {} {} {OverbarRuleThickness} {defaultrulethickness}
973\MathLine{\Umathoverbarvgap} {} {} {OverbarVerticalGap} {3*defaultrulethickness}
974\MathLine{\Umathquad} {1} {} {<fontsize(f)>} {mathquad}
975\MathLine{\Umathradicalkern} {} {} {RadicalExtraAscender} {defaultrulethickness}
976\MathLine{\Umathradicalrule} {2} {} {RadicalRuleThickness} {<not set>}
977\MathLine{\Umathradicalvgap} {3} {D, D} {RadicalDisplayStyleVerticalGap} {defaultrulethicknessabs(mathxheight)4}
978\MathLine{\Umathradicalvgap} {3} {T, T, S, S, SS, SS}{RadicalVerticalGap} {defaultrulethicknessabs(defaultrulethickness)4}
979\MathLine{\Umathradicaldegreebefore} {2} {} {RadicalKernBeforeDegree} {<not set>}
980\MathLine{\Umathradicaldegreeafter} {2} {} {RadicalKernAfterDegree} {<not set>}
981\MathLine{\Umathradicaldegreeraise} {2,7}{} {RadicalDegreeBottomRaisePercent} {<not set>}
982\MathLine{\Umathspaceafterscript} {4} {} {SpaceAfterScript} {scriptspace}
983\MathLine{\Umathstackdenomdown} {} {D, D} {StackBottomDisplayStyleShiftDown} {denom1}
984\MathLine{\Umathstackdenomdown} {} {T, T, S, S, SS, SS}{StackBottomShiftDown} {denom2}
985\MathLine{\Umathstacknumup} {} {D, D} {StackTopDisplayStyleShiftUp} {num1}
986\MathLine{\Umathstacknumup} {} {T, T, S, S, SS, SS}{StackTopShiftUp} {num3}
987\MathLine{\Umathstackvgap} {} {D, D} {StackDisplayStyleGapMin} {7*defaultrulethickness}
988\MathLine{\Umathstackvgap} {} {T, T, S, S, SS, SS}{StackGapMin} {3*defaultrulethickness}
989\MathLine{\Umathsubshiftdown} {} {} {SubscriptShiftDown} {sub1}
990\MathLine{\Umathsubshiftdrop} {} {} {SubscriptBaselineDropMin} {subdrop}
991\MathLine{\Umathsubsupshiftdown} {8} {} {SubscriptShiftDownWithSuperscript} {\emdash}
992\MathLine{\Umathsubtopmax} {} {} {SubscriptTopMax} {abs(mathxheight*4)5}
993\MathLine{\Umathsubsupvgap} {} {} {SubSuperscriptGapMin} {4*defaultrulethickness}
994\MathLine{\Umathsupbottommin} {} {} {SuperscriptBottomMin} {abs(mathxheight4)}
995\MathLine{\Umathsupshiftdrop} {} {} {SuperscriptBaselineDropMax} {supdrop}
996\MathLine{\Umathsupshiftup} {} {D} {SuperscriptShiftUp} {sup1}
997\MathLine{\Umathsupshiftup} {} {T, S, SS,} {SuperscriptShiftUp} {sup2}
998\MathLine{\Umathsupshiftup} {} {D, T, S, SS} {SuperscriptShiftUpCramped} {sup3}
999\MathLine{\Umathsupsubbottommax} {} {} {SuperscriptBottomMaxWithSubscript} {abs(mathxheight*4)5}
1000\MathLine{\Umathunderbarkern} {} {} {UnderbarExtraDescender} {defaultrulethickness}
1001\MathLine{\Umathunderbarrule} {} {} {UnderbarRuleThickness} {defaultrulethickness}
1002\MathLine{\Umathunderbarvgap} {} {} {UnderbarVerticalGap} {3*defaultrulethickness}
1003\MathLine{\Umathconnectoroverlapmin} {5} {} {MinConnectorOverlap} {0}
1004\LL
1005\stoptabulate
1006
1007A few notes:
1008
1009\startitemize[n]
1010
1011\startitem
1012 \OPENTYPE\ fonts set \typ {\Umathlimitabovekern} and \typ
1013 {\Umathlimitbelowkern} to zero and set \typ {\Umathquad} to the font size of
1014 the used font, because these are not supported in the \type {MATH} table.
1015\stopitem
1016
1017\startitem
1018 Traditional \TFM\ fonts do not set \typ {\Umathradicalrule} because \TEX82\
1019 uses the height of the radical instead. When this parameter is indeed not set
1020 when \LUATEX\ has to typeset a radical, a backward compatibility mode will
1021 kick in that assumes that an oldstyle \TEX\ font is used. Also, they do not
1022 set \typ {\Umathradicaldegreebefore}, \typ {\Umathradicaldegreeafter}, and \typ
1023 {\Umathradicaldegreeraise}. These are then automatically initialized to
1024 $518$quad, $1018$quad, and 60.
1025\stopitem
1026
1027\startitem
1028 If \TFM\ fonts are used, then the \typ {\Umathradicalvgap} is not set until
1029 the first time \LUATEX\ has to typeset a formula because this needs
1030 parameters from both family2 and family3. This provides a partial backward
1031 compatibility with \TEX82, but that compatibility is only partial: once the
1032 \typ {\Umathradicalvgap} is set, it will not be recalculated any more.
1033\stopitem
1034
1035\startitem
1036 When \TFM\ fonts are used a similar situation arises with respect to \typ
1037 {\Umathspaceafterscript}: it is not set until the first time \LUATEX\ has to
1038 typeset a formula. This provides some backward compatibility with \TEX82. But
1039 once the \typ {\Umathspaceafterscript} is set, \typ {\scriptspace} will never
1040 be looked at again.
1041\stopitem
1042
1043\startitem
1044 Traditional \TFM\ fonts set \typ {\Umathconnectoroverlapmin} to zero because
1045 \TEX82\ always stacks extensibles without any overlap.
1046\stopitem
1047
1048\startitem
1049 The \typ {\Umathoperatorsize} is only used in \typ {\displaystyle}, and is only
1050 set in \OPENTYPE\ fonts. In \TFM\ font mode, it is artificially set to one
1051 scaled point more than the initial attempts size, so that always the \quote
1052 {first next} will be tried, just like in \TEX82.
1053\stopitem
1054
1055\startitem
1056 The \typ {\Umathradicaldegreeraise} is a special case because it is the only
1057 parameter that is expressed in a percentage instead of a number of scaled
1058 points.
1059\stopitem
1060
1061\startitem
1062 \typ {SubscriptShiftDownWithSuperscript} does not actually exist in the
1063 \quote {standard} \OPENTYPE\ math font Cambria, but it is useful enough to be
1064 added.
1065\stopitem
1066
1067\startitem
1068 \typ {FractionDelimiterDisplayStyleSize} and \typ {FractionDelimiterSize}
1069 do not actually exist in the \quote {standard} \OPENTYPE\ math font Cambria,
1070 but were useful enough to be added.
1071\stopitem
1072
1073\stopitemize
1074
1075As this mostly refers to \LUATEX\ there is more to tell about how \LUAMETATEX\
1076deals with it. However, it is enough to know that much more behavior is
1077configurable.
1078
1079You can let the engine ignore a parameter with \typ {\setmathignore}, like:
1080
1081\starttyping
1082\setmathignore \Umathspacebeforescript 1
1083\setmathignore \Umathspaceafterscript 1
1084\stoptyping
1085
1086Be aware of the fact that a global setting can get unnoticed by users because
1087there is no warning that some parameter is ignored.
1088
1089There are a couple of parameters that dont relate to the font but are more generally
1090influencing the appearances. Some were added for experimenting.
1091
1092{\em This is not complete}
1093
1094\starttabulate[ll]
1095\FL
1096\BC primitive \BC meaning \NC \NR
1097\TL
1098\type {\Umathextrasubpreshift} \NC \NR
1099\type {\Umathextrasubprespace} \NC \NR
1100\type {\Umathextrasubshift} \NC \NR
1101\type {\Umathextrasubspace} \NC \NR
1102\type {\Umathextrasuppreshift} \NC \NR
1103\type {\Umathextrasupprespace} \NC \NR
1104\type {\Umathextrasupshift} \NC \NR
1105\type {\Umathextrasupspace} \NC \NR
1106\type {\Umathprimeshiftdrop} \NC \NR
1107\LL
1108\stoptabulate
1109
1110\stopsection
1111
1112\startsection[title={Math spacing}]
1113
1114Besides the parameters mentioned in the previous sections, there are also
1115primitives to control the math spacing table (as explained in Chapter18 of the
1116\TEX book). This happens per class pair. Because we have many possible classes,
1117we no longer have the many primitives that \LUATEX\ has but you can define then
1118using the generic \type {\setmathspacing} primitive:
1119
1120\starttyping
1121\def\Umathordordspacing {\setmathspacing 0 0 }
1122\def\Umathordordopenspacing {\setmathspacing 0 4 }
1123\stoptyping
1124
1125These parameters are (normally) of type \type {\muskip}, so setting a parameter can
1126be done like this:
1127
1128\starttyping
1129\setmathspacing 1 0 \displaystyle=4mu plus 2mu
1130\stoptyping
1131
1132The atom pairs known by the engine are all initialized by \type {initex} to the
1133values mentioned in the table in Chapter18 of the \TEX book.
1134
1135For ease of use as well as for backward compatibility, \typ {\thinmuskip}, \typ
1136{\medmuskip} and \typ {\thickmuskip} are treated specially. In their case a pointer
1137to the corresponding internal parameter is saved, not the actual \type {\muskip}
1138value. This means that any later changes to one of these three parameters will be
1139taken into account. As a bonus we also introduced the \typ {\tinymuskip} and \typ
1140{\pettymuskip} primitives, just because we consider these fundamental, but they
1141are not assigned internally to atom spacing combinations.
1142
1143In \LUAMETATEX\ we go a bit further. Any named dimension, glue and mu glue
1144register as well as the constants with these properties can be bound to a pair by
1145prefixing \typ {\setmathspacing} by \type {\inherited}.
1146
1147Careful readers will realize that there are also primitives for the items marked
1148\type {*} in the \TEX book. These will actually be used because we pose no
1149restrictions. However, you can enforce the remapping rules to conform to the
1150rules of \TEX\ (or yourself).
1151
1152Every class has a set of spacing parameters and the more classes you define the more
1153pairwise spacing you need to define. However, you can default to an existing class.
1154By default all spacing is zero and you can get rid of the defaults inherited from
1155good old \TEX\ with \typ {\resetmathspacing}. You can alias class spacing to an exiting
1156class with \type {\letmathspacing}:
1157
1158\starttyping
1159\letmathspacing class displayclass textclass scriptclass scriptscriptclass
1160\stoptyping
1161
1162Instead you can copy spacing with \type {\copymathspacing}:
1163
1164\starttyping
1165\copymathspacing class parentclass
1166\stoptyping
1167
1168Specific paring happens with \type {\setmathspacing}:
1169
1170\starttyping
1171\setmathspacing leftclass rightclass style value
1172\stoptyping
1173
1174Unless we have a frozen parameter, the prefix \type {\inherited} makes it possible
1175to have a more dynamic relationship: the used value resolves to the current value
1176of the given register. Possible values are the usual mu skip register, a regular
1177skip or dimension register, or just some mu skip value.
1178
1179A similar set of primitives deals with rules. These remap pairs onto other pairs, so
1180\typ {\setmathatomrule} looks like:
1181
1182\starttyping
1183\setmathatomrule oldleftclass oldrightclass newleftclass newrightclass
1184\stoptyping
1185
1186The \type {\letmathatomrule} and \type {\copymathatomrule} primitives take two
1187classes where the second is the parent.
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199The \type {\setmathprepenalty} and \type {\setmathpostpenalty} primitives take a
1200class and penalty (integer) value. These are injected before and after atoms with
1201the given class where a penalty of 10000 is a signal to ignore it.
1202
1203The engine control options for a class can be set with \type {\setmathoptions}. The
1204possible options are discussed elsewhere. This primitive takes a class number and
1205an integer (bitset). For all these setters the \CONTEXT\ math setup gives examples.
1206
1207Math is processed in two passes. The first pass is needed to intercept for
1208instance \type {\over}, one of the few \TEX\ commands that actually has a
1209preceding argument. There are often lots of curly braces used in math and these
1210can result in a nested run of the math sub engine. However, you need to be aware
1211of the fact that some properties are kind of global to a formula and the last
1212setting (for instance a family switch) wins. This also means that a change (or
1213again, the last one) in math parameters affects the whole formula. In
1214\LUAMETATEX\ we have changed this model a bit. One can argue that this introduces
1215an incompatibility but its hard to imagine a reason for setting the parameters
1216at the end of a formula run and assume that they also influence what goes in
1217front.
1218
1219\startbuffer
1220$
1221 x \subscript {}
1222 \frozen\Umathsubshiftdown\textstyle 0pt x \subscript {0}
1223 {\frozen\Umathsubshiftdown\textstyle 5pt x \subscript {5}}
1224 x \subscript {0}
1225 {\frozen\Umathsubshiftdown\textstyle 15pt x \subscript {15}}
1226 x \subscript {0}
1227 {\frozen\Umathsubshiftdown\textstyle 20pt x \subscript {20}}
1228 x \subscript {0}
1229 \frozen\Umathsubshiftdown\textstyle 10pt x \subscript {10}
1230 x \subscript {0}
1231$
1232\stopbuffer
1233
1234\typebuffer
1235
1236The \type {\frozen} prefix does the magic: it injects information in the
1237math list about the set parameter.
1238
1239In \LUATEX\ 1.10 the last setting, the \type {10pt} drop wins, but in
1240\LUAMETATEX\ you will see each local setting taking effect. The implementation
1241uses a new node type, parameters nodes, so you might encounter these in an
1242unprocessed math list. The result looks as follows:
1243
1244\blank \getbuffer \blank
1245
1246The \type {\mathatom} primitive is the generic one and it accepts a couple of
1247keywords:
1248
1249{\em to be checked}
1250
1251\starttabulate[lTll]
1252\FL
1253\BC keyword \BC argument \NC meaning \NC \NR
1254\TL
1255\NC attr \NC int int \NC attributes to be applied to this atom \NC \NR
1256\NC leftclass \NC class \NC the left edge class that determines spacing etc \NC \NR
1257\NC rightclass \NC class \NC the right edge class that determines spacing etc \NC \NR
1258\NC class \NC class \NC the general class \NC \NR
1259\NC unpack \NC \NC unpack this atom in inline math \NC \NR
1260\NC source \NC int \NC a symbolic index of the resulting box \NC \NR
1261\NC textfont \NC \NC use the current text font \NC \NR
1262\NC mathfont \NC \NC use the current math font \NC \NR
1263\NC limits \NC \NC put scripts on top and below \NC \NR
1264\NC nolimits \NC \NC force scripts to be postscripts \NC \NR
1265\NC nooverflow \NC \NC keep (extensible) within target dimensions \NC \NR
1266\NC options \NC int \NC bitset with options \NC \NR
1267\NC void \NC \NC discard content and ignore dimensions \NC \NR
1268\NC phantom \NC \NC discard content but retain dimensions \NC \NR
1269\LL
1270\stoptabulate
1271
1272To what extend the options kick in depends on the class as well where and how the
1273atom is used.
1274
1275The original \TEX\ engines has three atom modifiers: \type {\displaylimits}, \type
1276{\limits}, and \type {\nolimits}. These look back to the last atom and set a limit
1277related signal. Just to be consistent we have some more of that: \typ
1278{\Umathadapttoleft}, \typ {\Umathadapttoright}, \typ {\Umathuseaxis}, \typ
1279{\Umathnoaxis}, \typ {\Umathphantom}, \typ {\Umathvoid}, \typ {\Umathsource}, \typ
1280{\Umathopenupheight}, \typ {\Umathopenupdepth}, \typ {\Umathlimits}, \typ
1281{\Umathnolimits}. The last two are equivalent to the lowercase ones with the
1282similar names. Al these modifiers are cheap primitives and one can wonder if they
1283are needed but that also now also applies to the original three. We could stick
1284to one modifier that takes an integer but lets not diverge too much from the
1285original concept.
1286
1287The \type {\nonscript} primitive injects a glue node that signals that the next
1288glue is to be ignored when we are in script or scriptscript mode. The \typ
1289{\noatomruling} does the same but this time the signal is that no interatom
1290rules need to be applied.
1291
1292\stopsection
1293
1294\startsection[title={Fonts}]
1295
1296When we started with \LUATEX\ there was only Cambria as \OPENTYPE\ math font.
1297However, as soon as we could load a wide font, and basic math handling was
1298adapted to handle a fonts passed via \LUA, in \CONTEXT\ we switched to \OPENTYPE\
1299math exclusively. This was possible because at the same time virtual fonts were
1300integrated in the engine. Because the way \TEX\ approaches math differs from
1301\OPENTYPE\ we had code paths that could handle both and were somewhat complex.
1302Later these code paths were split more visible and detailed control over specific
1303features was introduced. The reason for this came from the fact that the Latin
1304Modern Math as well as additional fonts were a mix of \OPENTYPE\ and traditional
1305(metric wise). Inconsistencies were handles by \CONTEXT\ when loading and passing
1306fonts and runtime patching was our way out. There is also some juggling of math
1307lists in \LUA\ involved.
1308
1309In \LUAMETATEX\ much more control was added alongside many new features in
1310rendering math. Although by making decisions with respect to fonts in the end we
1311could potentially use a much simpler code base. However we keep what we have
1312because we need to write articles, manuals, presentations etc.\ that show the
1313differences. We settled on the fact that fonts are what they are and wont
1314change. Font specific tweaks are dealt with in a math font goodie file: most
1315tweaks are generic and applied to all fonts, some are optional, and many can be
1316tuned by parameters. In the end one can argue that we render math a bit different
1317due to different font and character properties; for instance we got rid of italic
1318correction and often deal with kerning, variants and extensibles a bit different.
1319
1320A consequence of this is that we will not describe in detail what happens in the
1321math engine, first of all because we dont expect other macro packages to follow
1322\CONTEXT\ in the way it deals with rendering math and the \LUATEX\ kind of hybrid
1323approach is likely good enough because after all there was never demand for more
1324advanced math rendering nor attempts to extend the engines in that area. This is
1325why \LUAMETATEX\ tries to be \LUATEX\ compatible when it comes to the basics
1326required by potential other usage than \CONTEXT. However, we might eventually
1327drop some eight bit font related features, simply because one can pass them
1328wrapped in a \UNICODE\ and \OPENTYPE\ math disguise. This is to be decided.
1329
1330The process of upgrading math is described in manuals, articles and presentations
1331by the authors. There one can find a discussion about decisions made.
1332
1333\stopsection
1334
1335\startsection[title={Scripts}]
1336
1337\startbuffer[show:3]
1338\startlinecorrection[blank]
1339 \scale[s=3]\bgroup
1340 \switchtobodyfont[modern]
1341 \showmakeup[glyph,continuation]
1342 \getbuffer
1343 \egroup
1344\stoplinecorrection
1345\stopbuffer
1346
1347The \LUAMETATEX\ engine has native support for prescripts and primes. Here we
1348dive a bit into the former. We start with a regular sub and superscript example:
1349
1350\startbuffer
1351\im { F {a} {b} }
1352\stopbuffer
1353
1354\typebuffer \getbuffer[show:3]
1355
1356Depending on how the font is set up, a subscript might get a (negative) kern.
1357Kerning at the top left of the nucleus is ignored, because one never sees it in
1358for instance chemistry:
1359
1360\startbuffer
1361\im { F {a} {b} {c} {d} }
1362\stopbuffer
1363
1364\typebuffer \getbuffer[show:3]
1365
1366There can be multiple pre and postscripts. In traditional \TEX\ one sometimes
1367has to inject fake nuclei but in \LUAMETATEX\ this is done automatically. These
1368are called continuation atoms.
1369
1370\startbuffer
1371\im { F
1372 {a} {b}
1373 {a} {b}
1374} \quad
1375\im { F
1376 {a} {b} {c} {d}
1377 {a} {b} {c} {d}
1378}
1379\stopbuffer
1380
1381\typebuffer \getbuffer[show:3]
1382
1383You will notice that the subscript no longer aligns, a feature that deals with
1384rendering tensors. these features are controlled by the (four byte) \prm
1385{mathdoublescriptmode} parameter. In \CONTEXT\ this one is set up as follows:
1386
1387\starttyping
1388\mathdoublescriptmode
1389 "\tohexadecimal\numexpr
1390 \inheritclassdoublescriptmodecode
1391 \discardshapekerndoublescriptmodecode
1392 \realignscriptsdoublescriptmodecode
1393 \reorderprescriptsdoublescriptmodecode
1394 \relax
1395 \tohexadecimal\mathcontinuationcode
1396 \tohexadecimal\mathcontinuationcode
1397 \tohexadecimal\mathcontinuationcode
1398\stoptyping
1399
1400The first byte set the options, the second the subtype of the continuation node
1401and the last two set the left and right class values. In \CONTEXT\ we have a
1402dedicated continuation class (\mono{0x\tohexadecimal\mathcontinuationcode}). So,
1403current value of this parameter is \mono{0x\tohexadecimal\mathdoublescriptmode},
1404but we can do this:
1405
1406\startbuffer[temp]
1407\advance\mathdoublescriptmode
1408 "\tohexadecimal\discardshapekerndoublescriptmodecode 000000
1409\stopbuffer
1410
1411\typebuffer[temp]
1412
1413and get:
1414
1415{\getbuffer[temp,show:3]}
1416
1417\startbuffer
1418\im { F
1419 {a} {b}
1420 {c}
1421 {c}
1422}
1423\stopbuffer
1424
1425\typebuffer \getbuffer[show:3]
1426
1427The next set of examples demonstrates that the \type {\noscript} injects a bogus
1428atom that breaks the alignment chain.
1429
1430\startbuffer
1431\im { F {a}
1432 {a} {a} {a}
1433} \quad
1434\im { F {a}
1435 \noscript {a} {a} {a}
1436} \quad
1437\im { F {a}
1438 {a} \noscript {a} {a}
1439} \quad
1440\im { F {a}
1441 {a} {a} \noscript {a} {a}
1442}
1443\stopbuffer
1444
1445\typebuffer \getbuffer[show:3]
1446
1447\startbuffer
1448\im { F {a} {a}
1449 {a} {a} {a}
1450} \quad
1451\im { F {a} {a}
1452 \noscript {a} {a} {a}
1453} \quad
1454\im { F {a} {a}
1455 {a} \noscript {a} {a}
1456} \quad
1457\im { F {a} {a}
1458 {a} {a} \noscript {a} {a}
1459}
1460\stopbuffer
1461
1462\typebuffer \getbuffer[show:3]
1463
1464A more useful application of this is the following:
1465
1466\startbuffer
1467\im {F
1468 {a} \noscript
1469 {b} \noscript
1470 {c} \noscript
1471 {d}
1472}
1473\stopbuffer
1474
1475\typebuffer \getbuffer[show:3]
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571\stopsection
1572
1573\stopdocument
1574 |