summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/math
diff options
context:
space:
mode:
Diffstat (limited to 'doc/context/sources/general/manuals/math')
-rw-r--r--doc/context/sources/general/manuals/math/math-alignments.tex297
-rw-r--r--doc/context/sources/general/manuals/math/math-definitions.tex101
-rw-r--r--doc/context/sources/general/manuals/math/math-features.tex78
-rw-r--r--doc/context/sources/general/manuals/math/math-input.tex100
-rw-r--r--doc/context/sources/general/manuals/math/math-introduction.tex13
-rw-r--r--doc/context/sources/general/manuals/math/math-layout.tex26
-rw-r--r--doc/context/sources/general/manuals/math/math-mkiv.tex5
-rw-r--r--doc/context/sources/general/manuals/math/math-numbering.tex55
-rw-r--r--doc/context/sources/general/manuals/math/math-oddities.tex176
-rw-r--r--doc/context/sources/general/manuals/math/math-spacing.tex348
-rw-r--r--doc/context/sources/general/manuals/math/math-suboptimal.tex40
-rw-r--r--doc/context/sources/general/manuals/math/math-tricks.tex819
12 files changed, 2049 insertions, 9 deletions
diff --git a/doc/context/sources/general/manuals/math/math-alignments.tex b/doc/context/sources/general/manuals/math/math-alignments.tex
new file mode 100644
index 000000000..bb2801b8a
--- /dev/null
+++ b/doc/context/sources/general/manuals/math/math-alignments.tex
@@ -0,0 +1,297 @@
+\environment math-layout
+
+\startcomponent math-alignments
+
+\startchapter[title=Alignments and such]
+
+\startsection[title=Using ampersands]
+
+When you come from plain \TEX, using ampersands probably comes as a custom, like in:
+
+\startbuffer
+\startformula
+\bordermatrix {
+ a & b & c & d \cr
+ e & f & G & h \cr
+ i & j & k & l \cr
+}
+\stopformula
+\stopbuffer
+
+\typebuffer \getbuffer
+
+or:
+
+\startbuffer
+\startformula
+\bbordermatrix {
+ a & b & c & d \cr
+ e & f & G & h \cr
+ i & j & k & l \cr
+}
+\stopformula
+\stopbuffer
+
+\typebuffer \getbuffer
+
+A more \CONTEXT\ way is this:
+
+\startbuffer
+\startformula
+\startbordermatrix
+ \NC a \NC b \NC c \NC d \NR
+ \NC e \NC f \NC G \NC h \NR
+ \NC i \NC j \NC k \NC l \NR
+\stopbordermatrix
+\stopformula
+\stopbuffer
+
+\typebuffer \getbuffer
+
+and:
+
+\startbuffer
+\startformula
+\startbbordermatrix
+ \NC a \NC b \NC c \NC d \NR
+ \NC e \NC f \NC G \NC h \NR
+ \NC i \NC j \NC k \NC l \NR
+\stopbbordermatrix
+\stopformula
+\stopbuffer
+
+\typebuffer \getbuffer
+
+Just that you know. In general ampersands in \CONTEXT\ text mode are just that:
+ampersands, not something alignment related.
+
+\stopsection
+
+\startsection[title=Locations]
+
+The \type {location} feature gives some control over the alignment of alignments.
+The following examples are taken from an email exchange with Henri Menke.
+
+\startbuffer
+\startplaceformula
+ \startformula
+ \startmathalignment[location=top]
+ \NC a + b \NC= c + d \NR
+ \NC a + b \NC= c + d \NR
+ \NC a + b \NC= c + d \NR
+ \stopmathalignment
+ \quad\text{or}\quad
+ \startmathalignment[location=center]
+ \NC a + b \NC= c + d \NR
+ \NC a + b \NC= c + d \NR
+ \NC a + b \NC= c + d \NR
+ \stopmathalignment
+ \quad\text{or}\quad
+ \startmathalignment[location=bottom]
+ \NC a + b \NC= c + d \NR
+ \NC a + b \NC= c + d \NR
+ \NC a + b \NC= c + d \NR
+ \stopmathalignment
+ \stopformula
+\stopplaceformula
+\stopbuffer
+
+\typebuffer \getbuffer
+
+Numbering works ok for a single mathalignment
+
+\startbuffer
+\startplaceformula
+ \startformula
+ \startmathalignment[number=auto]
+ \NC a + b \NC= c + d \NR
+ \NC a + b \NC= c + d \NR
+ \NC a + b \NC= c + d \NR
+ \stopmathalignment
+ \stopformula
+\stopplaceformula
+\stopbuffer
+
+\typebuffer \getbuffer
+
+But for one with a location the results are suboptimal:
+
+\startbuffer
+\startplaceformula
+ \startformula
+ \startmathalignment[location=center,number=auto]
+ \NC a + b \NC= c + d \NR
+ \NC a + b \NC= c + d \NR
+ \NC a + b \NC= c + d \NR
+ \stopmathalignment
+ \stopformula
+\stopplaceformula
+\stopbuffer
+
+\typebuffer \getbuffer
+
+Here is a real example:
+
+\startbuffer
+\startplaceformula
+ \startformula
+ U_2 = \frac{1}{2!}
+ \int_0^\beta \diff\tau_1 \int_0^\beta \diff\tau_2\;
+ \sum_{\startsubstack k_1,q_1 \NR k_2,q_2 \stopsubstack}
+ \Bigl\langle
+ \startmathalignment[location=top,align=left]
+ \NC
+ \mathcal T \Bigl[
+ c_{k_1}^\dagger (\tau_1)
+ \Delta_{k_1,q_1}^r c_{-k_1}^* (\tau_1) + c_{-q_1}^T (\tau_1)
+ \Delta_{k_1,q_1}^{r\dagger} c_{q_1} (\tau_1)
+ \Bigr]
+ \NR
+ \NC
+ \times \Bigl[
+ c_{k_2}^\dagger(\tau_2) \Delta_{k_2,q_2}^r c_{-k_2}^*
+ (\tau_2) + c_{-q_2}^T (\tau_2) \Delta_{k_2,q_2}^{r\dagger}
+ c_{q_2} (\tau_2)
+ \Bigr] \Bigr\rangle .
+ \NR
+ \stopmathalignment
+ \stopformula
+\stopplaceformula
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\stopsection
+
+\startsection[title=Tuning alignments]
+
+Again a few examples of manipulating alignments. It really helps to play
+with examples if you want to get an idea what is possible.
+
+\startbuffer
+\startformula
+ \startalign[m=2,align={middle}]
+ \NC \text to 6cm{} \NC x = 0 \NR
+ \stopalign
+\stopformula
+
+\startformula
+ \startalign[m=2,align={middle}]
+ \NC \text to 6cm{One\hfill} \NC a = 1 \NR
+ \NC \text to 6cm{One Two\hfill} \NC b = 2 \NR
+ \NC \text to 6cm{One Two Three\hfill} \NC c = 3 \NR
+ \stopalign
+\stopformula
+
+\startformula
+ \startalign[m=2,align={left}]
+ \NC \text to 6cm{One\hfill} \NC a = 1 \NR
+ \NC \text to 6cm{One Two\hfill} \NC b = 2 \NR
+ \NC \text to 6cm{One Two Three\hfill} \NC c = 3 \NR
+ \stopalign
+\stopformula
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startbuffer
+\startformula
+ \startalign[m=2,align={middle}]
+ \NC \text to 6cm{} \NC x = 0 \NR
+ \stopalign
+\stopformula
+
+\startformula
+ \startalign[m=2,align={middle}]
+ \NC \text to 6cm{One} \NC a = 1 \NR
+ \NC \text to 6cm{One Two} \NC b = 2 \NR
+ \NC \text to 6cm{One Two Three} \NC c = 3 \NR
+ \stopalign
+\stopformula
+
+\startformula
+ \startalign[m=2,align={left}]
+ \NC \text to 6cm{One} \NC a = 1 \NR
+ \NC \text to 6cm{One Two} \NC b = 2 \NR
+ \NC \text to 6cm{One Two Three} \NC c = 3 \NR
+ \stopalign
+\stopformula
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startbuffer
+\startformula
+ \startalign[m=2,align={middle}]
+ \NC \text{} \NC x = 0 \NR
+ \stopalign
+\stopformula
+
+\startformula
+ \startalign[m=2,align={middle}]
+ \NC \text{One} \NC a = 1 \NR
+ \NC \text{One Two} \NC b = 2 \NR
+ \NC \text{One Two Three} \NC c = 3 \NR
+ \stopalign
+\stopformula
+
+\startformula
+ \startalign[m=2,align={left}]
+ \NC \text{One} \NC a = 1 \NR
+ \NC \text{One Two} \NC b = 2 \NR
+ \NC \text{One Two Three} \NC c = 3 \NR
+ \stopalign
+\stopformula
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\stopsection
+
+\startsection[title={Splitting over pages}]
+
+Because formula placement has positioning options a formula gets
+wrapped in a box. As a consequence formulas will not break across
+pages. This can be an issue with alignments. There is an experimental
+option for this (the result is shown in \in {figure} [fig:splitalign]):
+
+\startbuffer[demo]
+\usemodule[art-01]
+\setupbodyfont[13pt]
+\starttext
+ \input tufte
+ \startplaceformula
+ \startsplitformula
+ \startalign
+ \NC a \EQ b \NR[+]
+ \NC \EQ d \NR
+ \NC c \EQ f \NR[+]
+ \NC \EQ g \NR
+ \NC \EQ h \NR[+]
+ \dorecurse{100}{\NC \EQ i + #1 - #1\NR[+]}%
+ \NC \EQ x \NR
+ \stopalign
+ \stopsplitformula
+ \stopplaceformula
+ \input tufte
+\stoptext
+\stopbuffer
+
+\typebuffer[demo]
+
+\startplacefigure[title={Splitting an alignment.},reference=fig:splitalign]
+ \startcombination[nx=4,ny=1]
+ {\typesetbuffer[demo][page=1,width=\measure{combination}]} {}
+ {\typesetbuffer[demo][page=2,width=\measure{combination}]} {}
+ {\typesetbuffer[demo][page=3,width=\measure{combination}]} {}
+ {\typesetbuffer[demo][page=4,width=\measure{combination}]} {}
+ \stopcombination
+\stopplacefigure
+
+\stoptext
+
+\stopsection
+
+\stopchapter
+
+\stopcomponent
diff --git a/doc/context/sources/general/manuals/math/math-definitions.tex b/doc/context/sources/general/manuals/math/math-definitions.tex
new file mode 100644
index 000000000..d8903121a
--- /dev/null
+++ b/doc/context/sources/general/manuals/math/math-definitions.tex
@@ -0,0 +1,101 @@
+\environment math-layout
+
+\startcomponent math-definitions
+
+\startchapter[title=Definitions]
+
+\startsection[title=Special stackers]
+
+There are many math symbols but never enough. Here is an example of how you can
+roll out your own. We start out with nothing:
+
+\startbuffer
+\definemathstackers
+ [nosymbol]
+ [voffset=\zeropoint,
+ hoffset=\zeropoint,
+ mathclass=ord,
+ topoffset=\zeropoint,
+ middlecommand=,
+ color=maincolor]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+You can now use this class of stackers:
+
+\startbuffer
+\startformula
+ \mathover [nosymbol] {"2217} {A}
+ \mathover [nosymbol] {"2218} {A}
+ \mathover [nosymbol] {"2219} {A}
+\stopformula
+\stopbuffer
+
+\typebuffer
+
+This looks like this:
+
+\getbuffer
+
+But we want proper math, which means an an italic nucleus, a properly placed
+accent, a shift of that accent matching the slope or the nucleus, so we actually
+need:
+
+\startbuffer
+\definemathstackers
+ [mysymbol]
+ [voffset=-.30\mathexheight,
+ hoffset=\zeropoint,
+ mathclass=ord,
+ topoffset=.4\mathemwidth,
+ middlecommand=\mathematics,
+ color=maincolor]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\startbuffer
+\startformula
+ \mathover [mysymbol]{"2217} {A}
+ \mathover [mysymbol]{"2218} {A}
+ \mathover [mysymbol]{"2219} {A}
+ \mathunder [mysymbol] {"2217}{A}
+ \mathunder [mysymbol] {"2218}{A}
+ \mathunder [mysymbol] {"2219}{A}
+ \mathdouble[mysymbol]{"2217}{"2217}{A}
+ \mathdouble[mysymbol]{"2218}{"2218}{A}
+ \mathdouble[mysymbol]{"2219}{"2219}{A}
+\stopformula
+\stopbuffer
+
+We show both over and under variants:
+
+\typebuffer
+
+So this time we get:
+
+\getbuffer
+
+We can now redefine the \quote {interiorset} symbol to use
+\type {0x2217} instead of \type {0x2218}:
+
+\startbuffer
+\definemathover[mysymbol][interiorset]["2217]
+
+\startformula
+ \interiorset{A}^{\interiorset{A}^{\interiorset{A}}}
+\stopformula
+\stopbuffer
+
+\typebuffer
+
+Of course normally you will not use color:
+
+\getbuffer
+
+\stopsection
+
+\stopchapter
+
+\stopcomponent
diff --git a/doc/context/sources/general/manuals/math/math-features.tex b/doc/context/sources/general/manuals/math/math-features.tex
index 3869c575e..863493804 100644
--- a/doc/context/sources/general/manuals/math/math-features.tex
+++ b/doc/context/sources/general/manuals/math/math-features.tex
@@ -122,6 +122,84 @@ show the plus sign.
\stopsection
+\startsection[title=Script kerning]
+
+Text in math is somewhat special. First of all, a math font is not a text fonts
+because the characters and glyphs have a different purpose. Text features are
+normally not present (and often not even wanted). Anyway, you can force a text
+font, but that doesn't mean you will get for instance kerning. You can force a
+box which in turn will trigger font processing, but then you normally loose the
+script related size properties. So we end up with some juggling possibly combined
+with user intervention, and that is what the \type {\text} macro does.
+
+But still there is the kern between a variable and its subscript to consider,
+something that normally is dealt with with staircase kerns, an \OPENTYPE\ math
+speciality. But, as we progress over the math list, and we bind a subscript to a
+variable, that subscript can be anything: a simple character, or more characters
+(a list) or something wrapped in a box. There is simply no universal solution
+that we can hard code because sometimes you don't want that special kerning. This
+is why in \LUATEX\ the integer variable \type {\mathscriptboxmode} controls the
+way this is dealt with.
+
+\starttabulate[|l|p|]
+\NC \type {0} \NC forget about kerning \NC \NR
+\NC \type {1} \NC kern math sub lists with a valid glyph (default in the engine) \NC \NR
+\NC \type {2} \NC also kern math sub boxes that have a valid glyph (default in \CONTEXT) \NC \NR
+\NC \type {3} \NC only kern math sub boxes with a boundary node present \NC \NR
+\stoptabulate
+
+Here we show some examples of how this parameter controls kerning. Watch the
+difference between a simple font switch and a text wrapped in a box. There are
+differences between fonts: some fonts have kerns, some don't. When present kerns
+are passed to the engine without further user intervention.
+
+\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}
+ {\typeinlinebuffer[#1]}
+ {\doifelse{#3}{-}
+ {\type{mode #2}}
+ {\switchtobodyfont[#3,big]\setstrut\strut\showfontkerns\showglyphs\mathscriptboxmode#2\relax\inlinebuffer[#1]}}}
+
+% \starttabulate[|lT|c|c|c|c|c|]
+% \NC \NC \Show{1}{0}{} \NC\Show{1}{1}{} \NC \Show{2}{1}{} \NC \Show{2}{2}{} \NC \Show{3}{3}{} \NC \NR
+% \NC \NC \Show{1}{0}{-} \NC\Show{1}{1}{-} \NC \Show{2}{1}{-} \NC \Show{2}{2}{-} \NC \Show{3}{3}{-} \NC \NR
+% \NC modern \NC \Show{1}{0}{modern} \NC\Show{1}{1}{modern} \NC \Show{2}{1}{modern} \NC \Show{2}{2}{modern} \NC \Show{3}{3}{modern} \NC \NR
+% \NC lucidaot \NC \Show{1}{0}{lucidaot} \NC\Show{1}{1}{lucidaot} \NC \Show{2}{1}{lucidaot} \NC \Show{2}{2}{lucidaot} \NC \Show{3}{3}{lucidaot} \NC \NR
+% \NC pagella \NC \Show{1}{0}{pagella} \NC\Show{1}{1}{pagella} \NC \Show{2}{1}{pagella} \NC \Show{2}{2}{pagella} \NC \Show{3}{3}{pagella} \NC \NR
+% \NC cambria \NC \Show{1}{0}{cambria} \NC\Show{1}{1}{cambria} \NC \Show{2}{1}{cambria} \NC \Show{2}{2}{cambria} \NC \Show{3}{3}{cambria} \NC \NR
+% \NC dejavu \NC \Show{1}{0}{dejavu} \NC\Show{1}{1}{dejavu} \NC \Show{2}{1}{dejavu} \NC \Show{2}{2}{dejavu} \NC \Show{3}{3}{dejavu} \NC \NR
+% \stoptabulate
+
+\def\ShowMore#1#2%
+ {\subsubject{\Show{#1}{#2}{} (\Show{#1}{#2}{-})}
+ \starttabulate[|lT|c|c|c|c|c|]
+ \NC modern \NC \Show{#1}{#2}{modern} \NC \NR
+ \NC lucidaot \NC \Show{#1}{#2}{lucidaot} \NC \NR
+ \NC pagella \NC \Show{#1}{#2}{pagella} \NC \NR
+ \NC cambria \NC \Show{#1}{#2}{cambria} \NC \NR
+ \NC dejavu \NC \Show{#1}{#2}{dejavu} \NC \NR
+ \stoptabulate}
+
+\ShowMore{1}{0}
+\ShowMore{1}{1}
+\ShowMore{2}{1}
+\ShowMore{2}{2}
+\ShowMore{3}{3}
+
+\stopsection
+
\stopchapter
\stopcomponent
diff --git a/doc/context/sources/general/manuals/math/math-input.tex b/doc/context/sources/general/manuals/math/math-input.tex
new file mode 100644
index 000000000..d395e1865
--- /dev/null
+++ b/doc/context/sources/general/manuals/math/math-input.tex
@@ -0,0 +1,100 @@
+% language=uk
+
+\environment math-layout
+
+\startcomponent math-input
+
+\startchapter[title=Inputting math]
+
+\startsection[title=Collapsing]
+
+When in text mode you enter a combination of combining accent and character, a
+composed character is assumed and often you then get one shape in your document.
+A similar feature is available in math mode. After some discussion and analysis
+of the potential clashes and confusion (thanks to Aditya Mahajan) we settled on a
+combination of methods: so called math lists entries that we entered in the
+character database and|/|or so called special sequences that are part of
+\UNICODE. In the next tables we use \type {ml} for math list and \type {sp} for
+specials. Collapsing mode \type {1} only uses the specials, while \type {2} first
+checks the specials and then the math lists, and \type {3} does the reverse.
+
+In the database you can find this (a few fields have been omitted):
+
+\starttyping
+[0x2260] = {
+ adobename = "notequal",
+ category = "sm",
+ description = "NOT EQUAL TO",
+ mathlist = { 0x2F, 0x3D },
+ mathspec = {
+ {
+ class = "relation",
+ name = "neq",
+ },
+ {
+ class = "relation",
+ name = "ne",
+ },
+ },
+ specials = { "char", 0x3D, 0x338 },
+ unicodeslot = 0x2260,
+}
+\stoptyping
+
+and
+
+\starttyping
+[0x2261] = {
+ adobename = "equivalence",
+ category = "sm",
+ description = "IDENTICAL TO",
+ mathclass = "relation",
+ mathextensible = "h",
+ mathname = "equiv",
+ mathlist = { 0x3D, 0x3D },
+ unicodeslot = 0x2261,
+}
+\stoptyping
+
+Here are a few examples:
+
+\def\Test#1%
+ {\NC \bf \type{$#1$}
+ \NC \setupmathematics[collapsing=0] $#1$
+ \NC \setupmathematics[collapsing=1] $#1$
+ \NC \setupmathematics[collapsing=2] $#1$
+ \NC \setupmathematics[collapsing=3] $#1$ \NC \NR}
+
+\starttabulate[|c|cp|cp|cp|cp|]
+ \NC \BC \ttbf 0 \BC \ttbf 1 (sp) \BC \ttbf 2 (sp ml) \BC \ttbf 3 (ml sp) \BC \NR
+ \Test{==}
+ \Test{/=}
+ \Test{>=}
+\stoptabulate
+
+A complete list of collapses can be generated after loading one of the tracing
+modules:
+
+\startbuffer
+\usemodule[math-ligatures]
+\stopbuffer
+
+\typebuffer \getbuffer
+
+This provides the command:
+
+\startbuffer
+\showmathligatures
+\stopbuffer
+
+\typebuffer
+
+which gives:
+
+\start \switchtobodyfont[8pt] \getbuffer \stop
+
+\stopsection
+
+\stopchapter
+
+\stopcomponent
diff --git a/doc/context/sources/general/manuals/math/math-introduction.tex b/doc/context/sources/general/manuals/math/math-introduction.tex
index f5d241004..de7c0a960 100644
--- a/doc/context/sources/general/manuals/math/math-introduction.tex
+++ b/doc/context/sources/general/manuals/math/math-introduction.tex
@@ -7,7 +7,18 @@
This manual is not a systematic discussion about math in \CONTEXT\ but more a
collection of wrap|-|ups. The file also serves as testcase. The content can
change over time and can also serve as a trigger for discussions on the mailing
-list. Suggestions are welcome.
+list. Content gets added sort of random. Suggestions are welcome.
+
+We discuss high level as well as low level commands. Some of the low level
+commands (primitives) are wrapped in high level commands but you can of course
+always revert to bare \TEX.
+
+I won't go into much detail about typesetting beautiful math, for that I refer to
+the \TEX book. \footnote {The most beautiful math is not typeset by \TEX\ anyway:
+just search on YouTube for \quotation {Mathematics} by Hollie McNish, the
+Metropole Orkest (conducted by Jules Buckley) and Martin Pyper.}
+
+% https://www.youtube.com/watch?v=SB8_2Yuj8Og
\startlines
Hans Hagen
diff --git a/doc/context/sources/general/manuals/math/math-layout.tex b/doc/context/sources/general/manuals/math/math-layout.tex
index 92ced8f22..83137444d 100644
--- a/doc/context/sources/general/manuals/math/math-layout.tex
+++ b/doc/context/sources/general/manuals/math/math-layout.tex
@@ -1,10 +1,17 @@
\startenvironment math-layout
-\switchtobodyfont [modern]
-\switchtobodyfont [dejavu]
-\switchtobodyfont [cambria]
-\switchtobodyfont[lucidaot]
-\switchtobodyfont [xits]
+\enabledirectives[fontgoodies.mathkerning]
+
+\usebodyfont [modern]
+\usebodyfont [cambria]
+\usebodyfont [lucidaot]
+\usebodyfont [xits]
+\usebodyfont [stixtwo]
+\usebodyfont [dejavu]
+\usebodyfont [pagella]
+\usebodyfont [termes]
+\usebodyfont [bonum]
+\usebodyfont [schola]
\setupbodyfont
[pagella]
@@ -32,21 +39,24 @@
height=middle,
width=middle]
+\definecolor[maincolor] [darkmagenta]
+\definecolor[extracolor][darkyellow]
+
\setuphead
[chapter]
[header=high,
style=\bfc,
- color=darkmagenta]
+ color=maincolor]
\setuphead
[section]
[style=\bfb,
- color=darkmagenta]
+ color=maincolor]
\setuphead
[subsection]
[style=\bfa,
- color=darkmagenta]
+ color=maincolor]
\usemodule[abr-02]
diff --git a/doc/context/sources/general/manuals/math/math-mkiv.tex b/doc/context/sources/general/manuals/math/math-mkiv.tex
index f36b1032d..11fb4ca1c 100644
--- a/doc/context/sources/general/manuals/math/math-mkiv.tex
+++ b/doc/context/sources/general/manuals/math/math-mkiv.tex
@@ -31,12 +31,17 @@
\stopfrontmatter
\startbodymatter
+ \component math-input
+ \component math-definitions
\component math-spacing
\component math-framing
\component math-numbering
\component math-combining
\component math-features
+ \component math-alignments
+ \component math-suboptimal
\component math-tricks
+ \component math-oddities
\stopbodymatter
\stopdocument
diff --git a/doc/context/sources/general/manuals/math/math-numbering.tex b/doc/context/sources/general/manuals/math/math-numbering.tex
index 64f766628..1576e17bb 100644
--- a/doc/context/sources/general/manuals/math/math-numbering.tex
+++ b/doc/context/sources/general/manuals/math/math-numbering.tex
@@ -69,6 +69,61 @@ are some examples:
\typebuffer \getbuffer
+In the next examples we demonstrate how we can avoid numbering, pass a reference as key,
+use assignments instead and add a title or suffix.
+
+\startbuffer
+\startplaceformula
+ \startformula e=mc^2 \stopformula
+\stopplaceformula
+\startplaceformula[-]
+ \startformula e=mc^2 \stopformula
+\stopplaceformula
+\startplaceformula[p]
+ \startformula e=mc^2 \stopformula
+\stopplaceformula
+\startplaceformula[reference=foo]
+ \startformula e=mc^2 \stopformula
+\stopplaceformula
+\startplaceformula[title=whatever]
+ \startformula e=mc^2 \stopformula
+\stopplaceformula
+\startplaceformula[suffix=q]
+ \startformula e=mc^2 \stopformula
+\stopplaceformula
+\startplaceformula[r]
+ \startformula e=mc^2 \stopformula
+\stopplaceformula
+\stopbuffer
+
+\typebuffer \getbuffer
+
+If you want consistent spacing you can enforce this:
+
+\startbuffer
+\startplaceformula[s]
+ \startformula e=mc^2 \stopformula
+\stopplaceformula
+\startplaceformula[-]
+ \startformula e=mc^2 \stopformula
+\stopplaceformula
+\startplaceformula[-]
+ \startformula e=mc^2 \stopformula
+\stopplaceformula
+\setupformulas[numberstrut=always]
+\startplaceformula[-]
+ \startformula e=mc^2 \stopformula
+\stopplaceformula
+\startplaceformula[-]
+ \startformula e=mc^2 \stopformula
+\stopplaceformula
+\stopbuffer
+
+\typebuffer \start \showstruts \getbuffer \stop
+
+Possible values for \type {numberstrut} are \type {yes} (the default), \type
+{always} and \type {no}.
+
\stopchapter
\stopcomponent
diff --git a/doc/context/sources/general/manuals/math/math-oddities.tex b/doc/context/sources/general/manuals/math/math-oddities.tex
new file mode 100644
index 000000000..015a30126
--- /dev/null
+++ b/doc/context/sources/general/manuals/math/math-oddities.tex
@@ -0,0 +1,176 @@
+% language=uk
+
+\environment math-layout
+
+\startcomponent math-oddities
+
+\startchapter[title=Things you might forget]
+
+\startsection[title=Ampersands]
+
+You can skip this, but if you continue reading, here is some low level plain code
+(don't use this in \CONTEXT):
+
+\starttyping
+\def\matrix#1%
+ {\null
+ \,
+ \vcenter
+ {\normalbaselines
+ \ialign{\hfil$##$\hfil && \quad\hfil$##$\hfil\crcr
+ \mathstrut\crcr
+ \noalign{\kern-\baselineskip}
+ #1\crcr
+ \mathstrut\crcr
+ \noalign{\kern-\baselineskip}}}%
+ \,}
+\stoptyping
+
+You see the \type {&} here and it's the alignment cell separator. The special
+meaning of these characters is determined by the so called catcode. Here we have:
+
+\starttyping
+\catcode"26=4
+\stoptyping
+
+Character \type {0x26} is the ampersand. In \CONTEXT\ this character can be used
+in text mode because we never use it as alignment character, which is something
+typical \TEX. The same is true for \type {^} and \type {_}. So, effectively we
+have (for instance):
+
+\starttyping
+\catcode"26=12
+\stoptyping
+
+In order to still get this \type {&} supported as alignment character in math
+mode, we have to jump through some hoops. Think of this (again, don't do this in
+\CONTEXT):
+
+\starttyping
+\bgroup
+ \global\mathcode"26="8000
+
+ \catcode"26=4
+
+ \xdef\normalmathaligntab{&}
+
+ \catcode"26=13
+
+ \global\everymath{\def&{\normalmathaligntab}}
+\egroup
+\stoptyping
+
+Before we go on you should realize that we never use the \type {&} in \CONTEXT\
+as separator. The sole reason for dealing with this issue is that users can have
+their own code that uses the ampersand that way. In \CONTEXT\ we do things like:
+
+\starttyping
+\startformula
+ \startmatrix
+ \NC 1 \NC 2 \NR
+ \NC 3 \NC 4 \NR
+ \stopmatrix
+\stopformula
+\stoptyping
+
+Where \type {\NC} can be more powerful than a \type {&}. Anyhow, the reason for
+discussing this here is that there can be surprises. In a running text you can do
+this:
+
+\starttyping
+A & B
+\stoptyping
+
+Which procces okay and gives the ampersand as glyph. The following is also okay:
+
+\starttyping
+$A \Umathchar"2"0"26 B$
+\stoptyping
+
+However, the next one:
+
+\starttyping
+$A \char"26 B$
+\stoptyping
+
+fails with a \type {Misplaced alignment tab character &}. The reason is that
+where in text mode \TEX's parser will turn the \type {\char} into a character
+node and carry on afterwards, in math mode it will treat this inpout as were it a
+directly input character, so the above is like, where the \type {&} has active
+properties and becomes the sparator ampersand which then triggers the error:
+
+\starttyping
+$A & B$
+\stoptyping
+
+This means that we cannot have a definition like:
+
+\starttyping
+\def\AND{\char"26\relax}
+\stoptyping
+
+that can be used in math mode, which is why the \CWEB\ macros do:
+
+\starttyping
+\def\AND{\def\AND{\mathchar"2026\relax}\AND}
+\stoptyping
+
+Back to the plain example. The \type {\matrix} command has to be wrapped in
+math mode and therefore the \type {&} will adapt, while in most \CONTEXT\
+constructs that use alignment, we're not in math mode at all when we start
+with the alignment. Therefore the \type {&} will be just an ampersand in most
+\CONTEXT\ cases.
+
+So to summarize: don't expect \type {\char"26} to work out well in math mode
+because all kind of magic kicks in. These are the more obscure features and side
+effects of \TEX\ dealing with input and it's really hard to predict how \TEX\
+will see the ampersand you entered. You need to know the internals and even then
+it's non trivial. Take
+
+\starttyping
+\startformula
+\startalign
+ \NC x \NR
+ \NC x \NR
+\stopalign
+\stopformula
+\stoptyping
+
+versus:
+
+\starttyping
+\startformula
+\startalign
+ & x \NR
+ & x \NR
+\stopalign
+\stopformula
+\stoptyping
+
+versus:
+
+\starttyping
+\startformula
+\startalign
+ \NC x & y \NR
+ \NC x & y \NR
+\stopalign
+\stopformula
+\stoptyping
+
+The first case works as expected, the second one treats the \type {&} as text and
+the third one, as we enter math mode with \type {\NC}, depends on circumstances.
+If you use just \CONTEXT\ math coding, you can say:
+
+\starttyping
+\setupmathematics
+ [ampersand=normal]
+\stoptyping
+
+And always render an ampersand (although a math one in math mode).
+
+\stopsection
+
+\stopchapter
+
+\stopcomponent
diff --git a/doc/context/sources/general/manuals/math/math-spacing.tex b/doc/context/sources/general/manuals/math/math-spacing.tex
index 3412a3abc..913a90d9e 100644
--- a/doc/context/sources/general/manuals/math/math-spacing.tex
+++ b/doc/context/sources/general/manuals/math/math-spacing.tex
@@ -1,3 +1,5 @@
+% language=uk
+
\environment math-layout
\startcomponent math-spacing
@@ -392,6 +394,352 @@ Of course better is to fix the font.
\stopsection
+\startsection[title=Multiline]
+
+Inline formulas can span lines but display math normally sits on one line unless
+one uses alignment mechanisms. Take this:
+
+\startbuffer[demo]
+\startformula
+ x\dorecurse{30}{ + #1x^{#1x}} = 10
+\stopformula
+\stopbuffer
+
+\typebuffer[demo]
+
+\par \start \setupformula[split=no] \getbuffer[demo] \stop \par
+
+You can set \type {split} to \type {yes} using \type {\setupformula} and get the
+following:
+
+\par \start \setupformula[split=yes] \getbuffer[demo] \stop \par
+
+Maybe nicer is to also set \type {align} to \type {flushleft}:
+
+\par \start \setupformula[split=yes,align=flushleft] \getbuffer[demo] \stop \par
+
+If you want the binary operators to start the lines you can set this:
+
+\startbuffer[setup]
+\setupmathematics[setups=math:spacing:split]
+\setupformulas[split=yes,align=flushleft]
+\stopbuffer
+
+\typebuffer[setup]
+
+\par \start \getbuffer[setup,demo] \stop \par
+
+You can prevent a split with a large penalty. Here is a test that yuou can run
+to play with this feature:
+
+\starttyping
+\dostepwiserecurse {30} {100} {1} {
+ \hsize \dimexpr 40pt + #1pt \relax
+ \startformula
+ y = a \dorecurse {50} {
+ \penalty 10000 {\bf + ##1b}
+ + ##1c^2
+ }
+ \stopformula
+ \page
+}
+\stoptyping
+
+There is an experimental alignment mechanism available. Watch the following
+examples:
+
+\startbuffer[demo]
+before
+ \startformula
+ z + 3y = \alignhere x
+ \dorecurse{20}{ + #1x^{#1x}}
+ \stopformula
+inbetween
+ \startformula
+ z + 3y \alignhere = 1
+ \dorecurse{4}{
+ \dorecurse{#1}{+ #1x^{##1x}}
+ \ifnum#1<4\breakhere\fi
+ }
+ \stopformula
+after
+\stopbuffer
+
+\typebuffer[demo]
+
+\startbuffer[setup]
+\setupformula
+ [split=no]
+\stopbuffer
+
+\typebuffer[setup] \start \getbuffer[setup,demo] \stop
+
+\startbuffer[setup]
+\setupformula
+ [split=yes,
+ align=flushleft]
+\stopbuffer
+
+\typebuffer[setup] \start \getbuffer[setup,demo] \stop
+
+\startbuffer[setup]
+\setupformula
+ [split=yes,
+ align=flushleft,
+ hang=auto]
+\stopbuffer
+
+\typebuffer[setup] \start \getbuffer[setup,demo] \stop
+
+\startbuffer[setup]
+\setupformula
+ [split=yes,
+ align=flushleft,
+ hang=auto,
+ distance=1em]
+\stopbuffer
+
+\typebuffer[setup] \start \getbuffer[setup,demo] \stop
+
+\startbuffer[setup]
+\setupformula
+ [split=yes,
+ align=flushleft,
+ hang=yes,
+ distance=2em]
+\stopbuffer
+
+\typebuffer[setup] \start \getbuffer[setup,demo] \stop
+
+\startbuffer[setup]
+\setupformula
+ [split=yes,
+ align=flushleft,
+ hang=yes,
+ distance=2em,
+ interlinespace=1.5\lineheight]
+\stopbuffer
+
+\typebuffer[setup] \start \getbuffer[setup,demo] \stop
+
+If you want to split over pages, you can say:
+
+\starttyping
+\setupformula
+ [split=page,
+ align=middle]
+\stoptyping
+
+but that is rather experimental (especially in combination with other
+number placement related options).
+
+\stopsection
+
+\startsection[title=Scripts]
+
+Superscripts and subscripts are typeset in a smaller size than their nucleus. You
+can influence that as follows:
+
+\startbuffer
+\startformula
+x^{2} = x^{\textstyle 2}
+ = x^{\scriptstyle 2}
+ = x^{\scriptscriptstyle 2}
+\stopformula
+\stopbuffer
+
+\typebuffer \getbuffer
+
+You can also use macros instead of a \type {^} and \type {_}, as in:
+
+\startbuffer
+\startformula
+x \superscript {2} =
+x \superscript {\textstyle 2} =
+x \superscript {\scriptstyle 2} =
+x \superscript {\scriptscriptstyle 2} =
+x \nosuperscript {2}
+\stopformula
+\stopbuffer
+
+\typebuffer \getbuffer
+
+The \type {\nosuperscript} primitive makes sure that we get the same size as the
+nucleus.
+
+\startbuffer
+\startformula
+x \superscript {2} \subscript {i} =
+x \nosuperscript {2} \subscript {i} =
+x \superscript {2} \nosubscript {i} =
+x \nosuperscript {2} \nosubscript {i}
+\stopformula
+\stopbuffer
+
+\typebuffer \getbuffer
+
+\stopsection
+
+\startsection[title=Text accents]
+
+You can put an accent over a character:
+
+\startbuffer
+$\grave{x} \neq \grave{i}$\quad
+$\ddot {x} \neq \ddot {i}$\quad
+$\bar {x} \neq \bar {i}$\quad
+$\acute{x} \neq \acute{i}$\quad
+$\hat {x} \neq \hat {i}$\quad
+$\check{x} \neq \check{i}$\quad
+$\breve{x} \neq \breve{i}$\quad
+$\dot {x} \neq \dot {i}$\quad
+$\ring {x} \neq \ring {i}$\quad
+$\tilde{x} \neq \tilde{i}$\quad
+$\dddot{x} \neq \dddot{i}$\quad
+\stopbuffer
+
+\typebuffer
+
+This comes out as: \inlinebuffer. For regular text you can better use proper composed
+\UTF\ encoded characters.
+
+\stopsection
+
+\startsection[title=Directions]
+
+Math has its own direction control:
+
+\starttexdefinition unexpanded MathTest #1#2#3
+ \ruledvbox \bgroup
+ \mathdir#1\relax
+ \textdir#2\relax
+ \pardir #3\relax
+ \hsize=30mm
+ \startformula
+ a^2+b^2=c^2
+ \stopformula
+ \egroup
+\stoptexdefinition
+
+\starttexdefinition unexpanded MathShow #1#2#3#4
+ \hbox \bgroup
+ \infofont #1 : m=#2 t=#3 p=#4
+ \egroup
+\stoptexdefinition
+
+\startbuffer
+\startcombination[nx=4,ny=2,distance=1cm]
+ {\MathTest{TLT}{TLT}{TLT}} {\MathShow1{TLT}{TLT}{TLT}}
+ {\MathTest{TLT}{TLT}{TRT}} {\MathShow2{TLT}{TLT}{TRT}}
+ {\MathTest{TLT}{TRT}{TLT}} {\MathShow3{TLT}{TRT}{TLT}}
+ {\MathTest{TLT}{TRT}{TRT}} {\MathShow4{TLT}{TRT}{TRT}}
+ {\MathTest{TRT}{TLT}{TLT}} {\MathShow5{TRT}{TLT}{TLT}}
+ {\MathTest{TRT}{TLT}{TRT}} {\MathShow6{TRT}{TLT}{TRT}}
+ {\MathTest{TRT}{TRT}{TLT}} {\MathShow7{TRT}{TRT}{TLT}}
+ {\MathTest{TRT}{TRT}{TRT}} {\MathShow8{TRT}{TRT}{TRT}}
+\stopcombination
+\stopbuffer
+
+\typebuffer
+
+Normally you will not control directions this way but use the proper parameters
+in layout related setup commands.
+
+\startlinecorrection
+\getbuffer
+\stoplinecorrection
+
+\stopsection
+
+\startsection[title=Surround]
+
+The spacing around inline formulas is consistent with other
+spacing but it can be enlarged. We just show a few examples:
+
+\startbuffer[demo]
+\hsize 20em
+We have
+\dorecurse {8} {%
+ \ifcase#1\or\else and \fi
+ $x+#1$ and $x-#1$ and $x \times #1$
+}
+\removeunwantedspaces .
+\par
+\stopbuffer
+
+\typebuffer[demo]
+
+\blank \start \getbuffer[demo] \stop
+
+\startbuffer[setup]
+\setupmathematics
+ [textdistance=2pt plus 1pt minus 1pt]
+\stopbuffer
+
+\typebuffer[setup]
+
+\blank \start \getbuffer[setup,demo] \stop
+
+\startbuffer[setup]
+\setupmathematics
+ [textdistance=4pt plus 2pt minus 2pt]
+\stopbuffer
+
+\typebuffer[setup]
+
+\blank \start \getbuffer[setup,demo] \stop
+
+\stopsection
+
+\startsection[title=Choices]
+
+The next examples are generated using this macro:
+
+\startbuffer
+\starttexdefinition unexpanded Test#1#2
+
+ \begingroup
+
+ \showmakeup[depth]
+
+ \def\TestA{\dontleavehmode\ruledhbox{\dorecurse{8}{before }}}
+ \def\TestB{\dontleavehmode\ruledhbox{\dorecurse{8}{after }}}
+ \def\TestC{\dorecurse{18}{x+}x}
+
+ \setdisplaymathspacemodel[3]
+ \setupalign[flushleft] 1\space:\space\TestA \par
+ \startformula #2 \TestC \stopformula \par
+ \setupalign[flushleft] 2\space:\space\TestB \par
+
+ \setdisplaymathspacemodel[4]
+
+ \vskip#1\lineheight
+
+ \setupalign[flushright] \TestA\space:\space2 \par
+ \startformula #2 \TestC \stopformula \par
+ \setupalign[flushright] \TestB\space:\space2 \par
+
+ \endgroup
+
+\stoptexdefinition
+\stopbuffer
+
+\typebuffer \getbuffer
+
+It demonstrates the often hard decisions that we have to make with regards to
+spacing. On the one hand we want to be adaptive, on the other hand we want to be
+consistent, for instance in the depth of lines. These examples overlay the two
+variants (which is of course font and style dependent).
+
+\Test{-4.70}{} \blank[2*line]
+\Test{-6.00}{\frac{1}{2}} \blank[2*line]
+\Test{-6.55}{\frac{1}{\frac{1}{2}}}
+
+One side effect of these options is that at some point we need to choose a
+default and then easily forget about the other variants.
+
+\stopsection
+
\stopchapter
\stopcomponent
diff --git a/doc/context/sources/general/manuals/math/math-suboptimal.tex b/doc/context/sources/general/manuals/math/math-suboptimal.tex
new file mode 100644
index 000000000..9f4e94730
--- /dev/null
+++ b/doc/context/sources/general/manuals/math/math-suboptimal.tex
@@ -0,0 +1,40 @@
+\environment math-layout
+
+\startcomponent math-subtoptimal
+
+\startchapter[title=Suboptimal]
+
+\startsection[title=Extensibles]
+
+Extensibles are implemented as follows: we start with the default shape, and when
+that doesn't cover the body of text, a next size is chosen. When we run out of
+sizes, a glyph is made from snippets (often a start glyph, overlapping middle
+pieces and an end piece. Of course a font needs to provide these variants and
+snippets.
+
+However, the quality of the coverage can differ per font. Here we show how Latin
+Modern, Pagella, Cambria, Lucida and Dejavu look like:
+
+\starttexdefinition ShowSample #1#2
+ \start
+ \showglyphs
+ \switchtobodyfont [#1]
+ \dontleavehmode#2: \dorecurse{50}{$\vec{\blackrule[width=##1pt]}$\space}\unskip
+ \par
+ \stop
+\stoptexdefinition
+
+\ShowSample{modern} {Latin Modern} \blank
+\ShowSample{pagella} {Pagella} \blank
+\ShowSample{cambria} {Cambria} \blank
+\ShowSample{lucidaot}{Lucida} \blank
+\ShowSample{dejavu} {Dejavu}
+
+Of course fonts can be improved (or patched) and these samples might come out
+better compared to previous renderings.
+
+\stopsection
+
+\stopchapter
+
+\stopcomponent
diff --git a/doc/context/sources/general/manuals/math/math-tricks.tex b/doc/context/sources/general/manuals/math/math-tricks.tex
new file mode 100644
index 000000000..7efcec50b
--- /dev/null
+++ b/doc/context/sources/general/manuals/math/math-tricks.tex
@@ -0,0 +1,819 @@
+\environment math-layout
+
+\startcomponent math-tricks
+
+\startchapter[title=Tricks]
+
+\startsection[title=Introduction]
+
+Math support in \CONTEXT\ is wrapped around basic \TEX\ primitives and
+unfortunately not all we want is easy to configure. This is not surprising
+because the original ideas behind \TEX\ are that one makes a style per book and a
+one macro package \quote {we-can-do-it-all} approach is not what Don Knuth had in
+mind at that time.
+
+So, for instance support for configurable spacing per math element, coloring of
+specific (sub) elements, simple switching of whatever combination of alignments
+and number placement, these all take quite a bit of code and hackery.
+
+Even configuring something seemingly trivial as fractions or top, bottom, left,
+middle and right fences take some effort. This is because the engine uses
+information from fonts to combine shapes and paste the content and ornaments to
+together.
+
+For that reason already in \MKII\ but more extensively in \MKIV\ we did a lot of
+these things in wrapper macros. When the math renderer was finalized for
+\OPENTYPE\ math some extra control was added that can make these things easier.
+However, because we go a bit beyond what is possible using this new functionality
+these new mechanisms are not yet used in \MKIV, but they might be eventually.
+Here we just show some of the (newer) low level trickery. For details about what
+was already possible in pure \TEX, we refer to the ultimate references: the \TeX
+book (by Donald Knuth) and \TeX\ by Topic (by Victor Eijkhout).
+
+\stopsection
+
+\startsection[title=Kerning]
+
+Kerning in \OPENTYPE\ math is not the same as in traditional \TEX: instead of a
+single value, we have staircase kerns, that is, depending on the location (left
+or right) and the vertical position, at discrete distances between depth and
+height. In addition there is italic correction but that is only applied in
+certain cases, one of which is the script location.
+
+Unfortunately not all fonts follow the same route. Some fonts have a true width
+and a moderate italic correction is added to it (of at all), while other fonts
+lie about the width and depend on an excessive italic correction to compensate
+for that.
+
+\definemeasure[quarter][\dimexpr(\textwidth-3em)/4\relax]
+
+\def\TestKern#1%
+ {\scale
+ [width=\measure{quarter}]
+ {\hbox to 50pt{\hss\showboxes\switchtobodyfont[#1]$V_i^i = W_i^i$\hss}}}
+
+\startlinecorrection
+\startcombination[nx=4,ny=2,distance=1em]
+ {\TestKern {modern}} {\infofont modern}
+ {\TestKern {cambria}} {\infofont cambria}
+ {\TestKern{lucidaot}} {\infofont lucida}
+ {\TestKern {dejavu}} {\infofont dejavu}
+ {\TestKern {pagella}} {\infofont pagella}
+ {\TestKern {termes}} {\infofont termes}
+ {\TestKern {bonum}} {\infofont bonum}
+ {\TestKern {schola}} {\infofont schola}
+\stopcombination
+\stoplinecorrection
+
+I will not discuss the details because when a font gets updated, it might look
+better or worse. These fonts were loaded with the following directive set:
+
+\starttyping
+\enabledirectives[fontgoodies.mathkerning]
+\stoptyping
+
+An example of a fontgoodie that fixed the kerning is \type {pagella-math.lfg}. Here
+is the relevant bit:
+
+\starttyping
+local kern_200 = { bottomright = { { kern = -200 } } }
+local kern_100 = { bottomright = { { kern = -100 } } }
+
+return {
+ .....
+ mathematics = {
+ .....
+ kerns = {
+ [0x1D449] = kern_200, -- 𝑉
+ [0x1D44A] = kern_100, -- 𝑊
+ },
+ .....
+ }
+}
+\stoptyping
+
+This fixes the real bad kerning of Pagella Math which at least in 2017 was not
+(yet) fixed. When the fonts are frozen we can start makling permanent runtime
+fixes like this.
+
+\stopsection
+
+\startsection[title=Primes]
+
+Primes are a pain in the butt. The reason for this is that they are independent
+characters on the one hand but can be seen as a superscript on the other. Let's
+first look at the symbols at the three sizes that are used in math.
+
+\startbuffer[prime]
+$
+ {\textstyle \char"2032}
+ {\scriptstyle \char"2032}
+ {\scriptscriptstyle\char"2032}
+\quad
+ {\textstyle \char"FE931}
+ {\scriptstyle \char"FE931}
+ {\scriptscriptstyle\char"FE931}
+\quad
+ {\textstyle \char"FE932}
+ {\scriptstyle \char"FE932}
+ {\scriptscriptstyle\char"FE932}
+$
+\stopbuffer
+
+\typebuffer[prime]
+
+We blow up the characters a bit and get this:
+
+\startlinecorrection
+\scale[scale=5000]{\showglyphs\inlinebuffer[prime]}
+\stoplinecorrection
+
+\def\TestPrime#1%
+ {\scale
+ [width=\measure{quarter}]
+ {\ruledhbox to 65pt{%
+ \hss
+ \showglyphs
+ \switchtobodyfont[#1]%
+ \inlinebuffer[prime]%
+ \hss}}}
+
+The first set is the normal prime character scaled to the text, script and
+scriptscriptsize. The second set shows the characters (at three sizes) as they
+are in the font. The largest character is raised while the other two are closer
+to the baseline. In some fonts the smaller sizes arenot smaller at all. The last
+set is a variant of the the first set but we made them into virtual characters
+with a displacement and different dimensions. Those are the ones we use as
+primes.
+
+\startlinecorrection
+\startcombination[nx=4,ny=2,distance=1em]
+ {\TestPrime {modern}} {\infofont modern}
+ {\TestPrime {cambria}} {\infofont cambria}
+ {\TestPrime{lucidaot}} {\infofont lucida}
+ {\TestPrime {dejavu}} {\infofont dejavu}
+ {\TestPrime {pagella}} {\infofont pagella}
+ {\TestPrime {termes}} {\infofont termes}
+ {\TestPrime {bonum}} {\infofont bonum}
+ {\TestPrime {schola}} {\infofont schola}
+\stopcombination
+\stoplinecorrection
+
+Next we show how primes show up in real math. The examples
+explain themselves.
+
+\startbuffer
+{\textstyle f = g} \quad
+{\scriptstyle f = g} \quad
+{\scriptscriptstyle f = g}
+\stopbuffer
+
+\typebuffer
+
+\startlinecorrection
+\scale[scale=2000]{\showglyphs$\inlinebuffer$}
+\stoplinecorrection
+
+\startbuffer
+{\textstyle f_i' = g_i'} \quad
+{\scriptstyle f_i' = g_i'} \quad
+{\scriptscriptstyle f_i' = g_i'}
+\stopbuffer
+
+\typebuffer
+
+\startlinecorrection
+\scale[scale=2000]{\showglyphs$\inlinebuffer$}
+\stoplinecorrection
+
+\startbuffer
+{\textstyle f^{\char"2032}(0) = g^{\char"2032}(0)} \quad
+{\scriptstyle f^{\char"2032}(0) = g^{\char"2032}(0)} \quad
+{\scriptscriptstyle f^{\char"2032}(0) = g^{\char"2032}(0)}
+\stopbuffer
+
+\typebuffer
+
+\startlinecorrection
+\scale[scale=2000]{\showglyphs$\inlinebuffer$}
+\stoplinecorrection
+
+\startbuffer
+{\textstyle f'(0) = g'(0)} \quad
+{\scriptstyle f'(0) = g'(0)} \quad
+{\scriptscriptstyle f'(0) = g'(0)}
+\stopbuffer
+
+\typebuffer
+
+\startlinecorrection
+\scale[scale=2000]{\showglyphs$\inlinebuffer$}
+\stoplinecorrection
+
+\startbuffer
+{\textstyle f^{\char"2032}(0) = g^{\char"2032}(0)} \quad
+{\scriptstyle f^{\char"2032}(0) = g^{\char"2032}(0)} \quad
+{\scriptscriptstyle f^{\char"2032}(0) = g^{\char"2032}(0)}
+\stopbuffer
+
+\typebuffer
+
+\startlinecorrection
+\scale[scale=2000]{\showglyphs$\inlinebuffer$}
+\stoplinecorrection
+
+\startbuffer
+{\textstyle f^{\char"2032}(0) = g^{\char"2032}(0)} \quad
+{\scriptstyle f^{\char"2032}(0) = g^{\char"2032}(0)} \quad
+{\scriptscriptstyle f^{\char"2032}(0) = g^{\char"2032}(0)}
+\stopbuffer
+
+\typebuffer
+
+\startlinecorrection
+\scale[scale=2000]{\showglyphs$\inlinebuffer$}
+\stoplinecorrection
+
+The prime analyzer can deal with sizes, subscripts but also converts a sequence
+of upright quotes into one unicode symbol. So,
+
+\startbuffer
+f'_i \neq f''_i \neq f'''_i \neq f''''_i
+\stopbuffer
+
+\typebuffer
+
+becomes:
+
+\startlinecorrection
+\scale[scale=4000]{\showglyphs$\inlinebuffer$}
+\stoplinecorrection
+
+\stopsection
+
+\startsection[title=Radicals]
+
+Sometimes users complain about the look of a radical symbol. This is however a matter
+of design. Some fonts let the shape start more below the baseline than others. Soem go
+more straight up than relatives in another font. When largers sizes are needed, some
+fonts offer smaller than others. Just look at the different desings:
+
+\def\TestRadical#1%
+ {\NC
+ \type{#1}\blackrule[width=0pt,height=2.5ex,depth=2ex]\NC
+ \switchtobodyfont[#1]\scale[scale=2000]{\showglyphs$\surd $}\NC
+ \switchtobodyfont[#1]\scale[scale=2000]{\showglyphs$\sqrt{} $}\NC
+ \switchtobodyfont[#1]\scale[scale=2000]{\showglyphs$\sqrt{.}$}\NC
+ \switchtobodyfont[#1]\scale[scale=2000]{\showglyphs$\sqrt{x}$}\NC
+ \switchtobodyfont[#1]\scale[scale=2000]{\showglyphs$\surd \sqrt{} \sqrt{.} \sqrt{x}$}\NC
+ \NR}
+
+\starttabulate[|l|c|c|c|c|c|]
+ \NC \NC \type{\surd} \NC \type{\sqrt{}} \NC \type{\sqrt{.}} \NC \type{\sqrt{x}} \NC \NR
+ \TestRadical{modern}
+ \TestRadical{cambria}
+ \TestRadical{lucidaot}
+ \TestRadical{dejavu}
+ \TestRadical{pagella}
+ \TestRadical{termes}
+ \TestRadical{bonum}
+ \TestRadical{schola}
+\stoptabulate
+
+The automatic scaling doesn't always work out as expected but on the average is
+okay. Keep in mind that often the content is not that extreme.
+
+\def\TestRadical#1%
+ {\NC
+ \type{#1}\NC
+ \switchtobodyfont[#1]\showglyphs$\sqrt{\blackrule[width=1em,height=1.0ex,color=darkgray]}$\NC
+ \switchtobodyfont[#1]\showglyphs$\sqrt{\blackrule[width=1em,height=1.5ex,color=darkgray]}$\NC
+ \switchtobodyfont[#1]\showglyphs$\sqrt{\blackrule[width=1em,height=2.0ex,color=darkgray]}$\NC
+ \switchtobodyfont[#1]\showglyphs$\sqrt{\blackrule[width=1em,height=2.5ex,color=darkgray]}$\NC
+ \switchtobodyfont[#1]\showglyphs$\sqrt{\blackrule[width=1em,height=3.0ex,color=darkgray]}$\NC
+ \switchtobodyfont[#1]\showglyphs$\sqrt{\blackrule[width=1em,height=3.5ex,color=darkgray]}$\NC
+ \switchtobodyfont[#1]\showglyphs$\sqrt{\blackrule[width=1em,height=4.0ex,color=darkgray]}$\NC
+ \switchtobodyfont[#1]\showglyphs$\sqrt{\blackrule[width=1em,height=4.5ex,color=darkgray]}$\NC
+ \NR}
+
+\starttabulate[|l|c|c|c|c|c|c|c|c|]
+ \NC \NC 1.0ex \NC 1.5ex \NC 2.0ex \NC 2.5ex \NC 3.0ex \NC 3.5ex \NC 4.0ex \NC 4.5ex \NC \NR
+ \TestRadical{modern}
+ \TestRadical{cambria}
+ \TestRadical{lucidaot}
+ \TestRadical{dejavu}
+ \TestRadical{pagella}
+ \TestRadical{termes}
+ \TestRadical{bonum}
+ \TestRadical{schola}
+\stoptabulate
+
+In Lucida (the version at the time of writing this) we have to correct the threshold
+a bit in the goodie file:
+
+\starttyping
+local function FixRadicalDisplayStyleVerticalGap(value,target,original)
+ local o = original.mathparameters.RadicalVerticalGap -- 50
+ return 2 * o * target.parameters.factor
+end
+
+return {
+ .....
+ mathematics = {
+ .....
+ parameters = {
+ RadicalDisplayStyleVerticalGap =
+ FixRadicalDisplayStyleVerticalGap,
+ },
+ .....
+ },
+}
+\stoptyping
+
+\stopsection
+
+\startsection[title=Integrals]
+
+A curious exception in the math system is the integral sign. Its companions are
+the summation and product signs, but integral has as extra property that it has a
+slant. In \LUATEX\ there is rather advanced control over how the (optional)
+scripts are positioned (which relates to italic correction) but in \CONTEXT\ we
+only make limited use of that. The main reason is that we also need to support
+additional features like color. Therefore integrals are handled by the extensible
+mechanism.
+
+The size of an integral is more of less fixed but you can enlarge to your
+liking. One reason for this is that you might want a consistent size across
+formulas. Let's use the following setup:
+
+\startbuffer[setup]
+\setupmathextensible
+ [integral]
+ [rightoffset=-1mu,
+ exact=yes,
+ factor=2]
+
+\let\int\integral
+\stopbuffer
+
+\typebuffer[setup]
+
+We use the following exmaple:
+
+\startbuffer[demo]
+\ruledhbox{$\integral f\frac{1}{2} $}\quad
+\ruledhbox{$\integral[rightoffset=3mu] f\frac{1}{2} $}\quad
+\ruledhbox{$\integral[exact=no] f\frac{1}{2} $}\quad
+\ruledhbox{$\integral f\frac{\frac{1}{2}}{x} $}\quad
+\ruledhbox{$\integral[exact=no] f\frac{\frac{1}{2}}{x} $}\quad
+\ruledhbox{$\integral[factor=1] f\frac{1}{2} $}\quad
+\ruledhbox{$\integral[factor=3] f\frac{\frac{1}{2}}{x} $}\quad
+\ruledhbox{$\integral[factor=3] f\frac{1}{2} $}\quad
+\ruledhbox{$\int f\frac{1}{2} $}% bonus
+\stopbuffer
+
+\typebuffer[demo]
+
+This renders as:
+
+\dontleavehmode\hbox{\getbuffer[setup,demo]}
+
+\stopsection
+
+\startsection[title=Fancy fences]
+
+Here I only show an example of fences drawn by \METAPOST. For the implementation
+you can consult the library file \type {meta-imp-mat.mkiv} in the \CONTEXT\
+distribution.
+
+\startbuffer[setup]
+\useMPlibrary[mat]
+
+\setupmathstackers
+ [both] % vfenced]
+ [color=darkred,
+ alternative=mp]
+
+\setupmathstackers
+ [top]
+ [color=darkred,
+ alternative=mp]
+
+\setupmathstackers
+ [bottom]
+ [color=darkred,
+ alternative=mp]
+\stopbuffer
+
+\typebuffer[setup]
+
+We keep the demo simple:
+
+\startbuffer[demo]
+$ \overbracket {a+b+c+d} \quad
+ \underbracket {a+b+c+d} \quad
+ \doublebracket {a+b+c+d} \quad
+ \overparent {a+b+c+d} \quad
+ \underparent {a+b+c+d} \quad
+ \doubleparent {a+b+c+d} $ \blank
+$ \overbrace {a+b+c+d} \quad
+ \underbrace {a+b+c+d} \quad
+ \doublebrace {a+b+c+d} \quad
+ \overbar {a+b+c+d} \quad
+ \underbar {a+b+c+d} \quad
+ \doublebar {a+b+c+d} $ \blank
+$ \overleftarrow {a+b+c+d} \quad
+ \overrightarrow {a+b+c+d} \quad
+ \underleftarrow {a+b+c+d} \quad
+ \underrightarrow {a+b+c+d} $ \blank
+\stopbuffer
+
+\typebuffer[demo]
+
+Or visualized:
+
+\start
+\getbuffer[setup,demo]
+\stop
+
+\stopsection
+
+\startsection[title=Combined characters]
+
+We have some magic built with respect to sequences of characters. They are derived
+from information in the character database that ships with \CONTEXT\ and are
+implemented as a sort of ligatures. Some are defined in \UNICODE, others are
+defined explicitly.
+
+\usemodule[math-ligatures]
+
+\start
+ \switchtobodyfont[small]
+ \showmathligatures
+\stop
+
+\stopsection
+
+\startsection[title=Middle class fences]
+
+The next examples are somewhat obscure. They are a side effect of some extensions
+to the engine that were introduced to control spacing around the \type {\middle}
+class fences. Actually there is no real middle class and spacing was somewhat
+hard codes when \type {\middle} was added to \ETEX. In \LUATEX\ we have
+introduced keywords to some primitives that control spacing and other properties.
+This permits better control over spacing than messing around with (for instance)
+injected \type {\mathrel} commands that can have their own side effects.
+
+\startbuffer
+\def\Middle{\middle|}
+\def\Riddle{\Umiddle class 5 |}
+\def\Left {\left (}
+\def\Right {\right )}
+\def\Rel {\mathrel{}}
+\def\Per {\mathrel{.}}
+\stopbuffer
+
+\startbuffer[1a]
+$ a b $
+\stopbuffer
+\startbuffer[1b]
+$ \Rel a\Rel b\Rel $
+\stopbuffer
+
+\startbuffer[2a]
+$ a b $
+\stopbuffer
+\startbuffer[2b]
+$ \Per a\Per b\Per $
+\stopbuffer
+
+\startbuffer[3a]
+$\Left a \Middle b \Right$
+\stopbuffer
+\startbuffer[3b]
+$\Left\Rel a \Middle\Rel b\Rel\Right$
+\stopbuffer
+
+\startbuffer[4a]
+$\Left a \Middle b \Right$
+\stopbuffer
+\startbuffer[4b]
+$\Left\Rel a \Middle\Per b\Per\Right$
+\stopbuffer
+
+\startbuffer[5a]
+$\Left a \Middle b \Right$
+\stopbuffer
+\startbuffer[5b]
+$\Left\Rel a\Rel\Middle\Rel b\Rel\Right$
+\stopbuffer
+
+\startbuffer[6a]
+$\Left a \Middle b \Right$
+\stopbuffer
+\startbuffer[6b]
+$\Left\Per a\Per\Middle\Per b\Per\Right$
+\stopbuffer
+
+\startbuffer[7a]
+$\Left a \Riddle b \Right$
+\stopbuffer
+\startbuffer[7b]
+$\Left\Rel a \Riddle\Rel b\Rel\Right$
+\stopbuffer
+
+\startbuffer[8a]
+$\Left a \Riddle b \Right$
+\stopbuffer
+\startbuffer[8b]
+$\Left\Rel a \Riddle\Per b\Per\Right$
+\stopbuffer
+
+\startbuffer[9a]
+$\Left a \Riddle b \Right$
+\stopbuffer
+\startbuffer[9b]
+$\Left\Rel a\Rel\Riddle\Rel b\Rel\Right$
+\stopbuffer
+
+\startbuffer[10a]
+$\Left a \Riddle b \Right$
+\stopbuffer
+\startbuffer[10b]
+$\Left\Per a\Per\Riddle\Per b\Per\Right$
+\stopbuffer
+
+We use the following definitions:
+
+\typebuffer
+
+Applied to samples these give the following outcome and spacing:
+
+\start
+ \getbuffer
+
+ \starttabulate
+ \NC \ruledhbox{\typeinlinebuffer[1a]} \NC \showglyphs \inlinebuffer[1a] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[1b]} \NC \showglyphs \inlinebuffer[1b] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[2a]} \NC \showglyphs \inlinebuffer[2a] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[2b]} \NC \showglyphs \inlinebuffer[2b] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[3a]} \NC \showglyphs \inlinebuffer[3a] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[3b]} \NC \showglyphs \inlinebuffer[3b] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[4a]} \NC \showglyphs \inlinebuffer[4a] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[4b]} \NC \showglyphs \inlinebuffer[4b] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[5a]} \NC \showglyphs \inlinebuffer[5a] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[5b]} \NC \showglyphs \inlinebuffer[5b] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[6a]} \NC \showglyphs \inlinebuffer[6a] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[6b]} \NC \showglyphs \inlinebuffer[6b] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[7a]} \NC \showglyphs \inlinebuffer[7a] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[7b]} \NC \showglyphs \inlinebuffer[7b] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[8a]} \NC \showglyphs \inlinebuffer[8a] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[8b]} \NC \showglyphs \inlinebuffer[8b] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[9a]} \NC \showglyphs \inlinebuffer[9a] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[9b]} \NC \showglyphs \inlinebuffer[9b] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[10a]} \NC \showglyphs \inlinebuffer[10a] \NC \NR
+ \NC \ruledhbox{\typeinlinebuffer[10b]} \NC \showglyphs \inlinebuffer[10b] \NC \NR
+ \stoptabulate
+\stop
+
+\stopsection
+
+\startsection[title=Auto|-|punctuation]
+
+\def\TestA#1#2#3%
+ {\ifnum#1=0 \type{#2}\else\setupmathematics[autopunctuation={#2}]$#3$\fi}
+
+\def\TestB#1#2%
+ {\NC \TestA{#1}{no} {#2}
+ \NC \TestA{#1}{yes} {#2}
+ \NC \TestA{#1}{yes,semicolon}{#2}
+ \NC \TestA{#1}{all} {#2}
+ \NC \TestA{#1}{all,semicolon}{#2}
+ \NC \NR}
+
+The \type {\setupmathematics} command has an option \type {autopunctuation} that
+influences the way spacing after punctuatuon is handled, especially in cases like
+the following (coordinates and such):
+
+\starttabulate[|c|c|c|c|c|]
+ \TestB{0}{}
+ \TestB{1}{(1,2)=(1, 2)}
+ \TestB{1}{(1.2)=(1. 2)}
+ \TestB{1}{(1;2)=(1; 2)}
+\stoptabulate
+
+\stopsection
+
+\stopcomponent
+
+% \enabletrackers[math.makeup=boxes]
+
+% \startTEXpage[offset=10pt]
+% $\displaystyle {{1}\normalover{2}}+x$\quad $\crampeddisplaystyle {{1}\normalover{2}}+x$\blank
+% $\textstyle {{1}\normalover{2}}+x$\quad $\crampedtextstyle {{1}\normalover{2}}+x$\blank
+% $\scriptstyle {{1}\normalover{2}}+x$\quad $\crampedscriptstyle {{1}\normalover{2}}+x$\blank
+% $\scriptscriptstyle {{1}\normalover{2}}+x$\quad $\crampedscriptscriptstyle{{1}\normalover{2}}+x$\blank
+% \stopTEXpage
+
+% \startTEXpage[offset=10pt]
+% $e=mc^2$
+% \stopTEXpage
+
+% \startTEXpage[offset=10pt]
+% $\sqrt{\frac{1}{2}+x}$
+% \stopTEXpage
+
+% \startTEXpage[offset=10pt]
+% $\int^0_1{\frac{1}{2}+x}$
+% \stopTEXpage
+
+% \startTEXpage[offset=10pt]
+% $\displaystyle\the\everydisplay\int^0_1{\frac{1}{2}+x}$
+% \stopTEXpage
+
+% \startbuffer
+% ${}^2_2x^3_4 {}^2x_4$
+% \stopbuffer
+
+% % d : \Umathsubshiftdown
+% % u : \Umathsupshiftup
+% % s : \Umathsubsupshiftdown
+
+% \startTEXpage[offset=10pt]
+% \starttabulate[|T||cT|cT|]
+% \NC 0 \NC \mathscriptsmode 0 \inlinebuffer \NC dynamic \NC dynamic \NC \NR \TB
+% \NC 1 \NC \mathscriptsmode 1 \inlinebuffer \NC d \NC u \NC \NR \TB
+% \NC 2 \NC \mathscriptsmode 2 \inlinebuffer \NC s \NC u \NC \NR \TB
+% \NC 3 \NC \mathscriptsmode 3 \inlinebuffer \NC s \NC u + s − d \NC \NR \TB
+% \NC 4 \NC \mathscriptsmode 4 \inlinebuffer \NC d + (s − d)/2 \NC u + (s − d)/2 \NC \NR \TB
+% \NC 5 \NC \mathscriptsmode 5 \inlinebuffer \NC d \NC u + s − d \NC \NR
+% \stoptabulate
+% \stopTEXpage
+
+% \startTEXpage[offset=10pt] \tt
+% \starttabulate[|l|ck1|ck1|ck1|ck1|ck1|ck1|]
+% \NC
+% \NC \mathnolimitsmode0 $\displaystyle\int\nolimits^0_1$
+% \NC \mathnolimitsmode1 $\displaystyle\int\nolimits^0_1$
+% \NC \mathnolimitsmode2 $\displaystyle\int\nolimits^0_1$
+% \NC \mathnolimitsmode3 $\displaystyle\int\nolimits^0_1$
+% \NC \mathnolimitsmode4 $\displaystyle\int\nolimits^0_1$
+% \NC \mathnolimitsmode8000 $\displaystyle\int\nolimits^0_1$
+% \NC \NR
+% \TB
+% \NC \bf mode
+% \NC 0
+% \NC 1
+% \NC 2
+% \NC 3
+% \NC 4
+% \NC 8000
+% \NC \NR
+% \NC \bf superscript
+% \NC 0
+% \NC font
+% \NC 0
+% \NC 0
+% \NC +ic/2
+% \NC 0
+% \NC \NR
+% \NC \bf subscript
+% \NC -ic
+% \NC font
+% \NC 0
+% \NC -ic/2
+% \NC -ic/2
+% \NC 8000ic/1000
+% \NC \NR
+% \stoptabulate
+% \stopTEXpage
+
+{ } \bgroup \egroup \begingroup \endgroup
+
+\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
+
+% % \bgroup .. \egroup
+
+% \startTEXpage[offset=10pt]
+% $\displaystyle \getbuffer[1]$ \blank
+% $\textstyle \getbuffer[1]$
+% \stopTEXpage
+
+% % \begingroup .. \endgroup
+
+% \startTEXpage[offset=10pt]
+% $\displaystyle \getbuffer[2]$ \blank
+% $\textstyle \getbuffer[2]$
+% \stopTEXpage
+
+
+% \startTEXpage[offset=10pt]
+% $\Uleft ( x \Umiddle\| \Uright )$
+% $\Uleft height 3ex ( x \Umiddle\| \Uright height 3ex )$
+% $\Uleft axis height 3ex ( x \Umiddle\| \Uright axis height 3ex )$
+% $\Uleft axis height 3ex depth 1ex ( x \Umiddle\| \Uright axis height 3ex depth 1ex )$
+% \stopTEXpage
+
+% \startTEXpage[offset=10pt]
+% $\Uvextensible ( \frac{1}{x}$
+% $\Uvextensible height 3ex ( \frac{1}{x}$
+% $\Uvextensible axis height 3ex ( \frac{1}{x}$
+% $\Uvextensible axis height 3ex depth 1ex ( \frac{1}{x}$
+% $\Uvextensible exact axis height 3ex depth 1ex ( \frac{1}{x}$
+% \stopTEXpage
+
+% \startTEXpage[offset=10pt]
+% \ruledhbox{$\Uhextensible "0 "23DE$}
+% \ruledhbox{$\Uhextensible width 3ex "0 "23DE$}
+% \ruledhbox{$\Uhextensible middle width 3ex "0 "23DE$}
+% \ruledhbox{$\Uhextensible left width 3ex "0 "23DE$}
+% \ruledhbox{$\Uhextensible right width 3ex "0 "23DE$}
+% \stopTEXpage
+
+% \startTEXpage[offset=10pt]
+% \ruledhbox{$\Umathaccent "0 "0 "23DE {1+x}$}
+% \ruledhbox{$\Umathaccent fixed "0 "0 "23DE {1+x}$}
+% \ruledhbox{$\Umathaccent top "0 "0 "23DE {1+x}$}
+% \ruledhbox{$\Umathaccent bottom "0 "0 "23DF {1+x}$}
+% \ruledhbox{$\Umathaccent both "0 "0 "23DE "0 "0 "23DF {1+x}$}
+% \ruledhbox{$\Umathaccent overlay "0 "0 "23DE {1+x}$}
+% \ruledhbox{$\Umathaccent top "0 "0 "23DE fraction 800 {1+x}$}
+% \stopTEXpage
+
+% \startTEXpage[offset=10pt]
+% ${ {1} \Uskewed / {2} }$
+% ${ {1} \Uskewed / exact {2} }$
+% ${ {1} \Uskewed / noaxis {2} }$
+% ${ {1} \Uskewed / exact noaxis {2} }$
+% ${ {1} \Uskewedwithdelims / () {2} }$
+% ${ {1} \Uskewedwithdelims / () exact {2} }$
+% ${ {1} \Uskewedwithdelims / () noaxis {2} }$
+% ${ {1} \Uskewedwithdelims / () exact noaxis {2} }$
+% \stopTEXpage
+
+% \disabletrackers[math.makeup]
+
+% \stopchapter
+%
+% \stopcomponent
+
+% A \type {\matheqnogapstep} factor that determines the gap between formula and
+% equation number.
+%
+% A \type {\mathdisplayskipmode} directive that controls display skips: 1 = always,
+% 2 = only when not zero, 3 = never.
+%
+% \mathstyle
+%
+% \suppressmathparerror
+