math-definitions.tex /size: 2074 b    last modification: 2021-10-28 13:50
1% language=us runpath=texruns:manuals/math
2
3\environment math-layout
4
5\startcomponent math-definitions
6
7\startchapter[title=Definitions]
8
9\startsection[title=Special stackers]
10
11There are many math symbols but never enough. Here is an example of how you can
12roll out your own. We start out with nothing:
13
14\startbuffer
15\definemathstackers
16  [nosymbol]
17  [voffset=\zeropoint,
18   hoffset=\zeropoint,
19   mathclass=ord,
20   topoffset=\zeropoint,
21   middlecommand=,
22   color=maincolor]
23\stopbuffer
24
25\typebuffer \getbuffer
26
27You can now use this class of stackers:
28
29\startbuffer
30\startformula
31  \mathover [nosymbol] {"2217} {A}
32  \mathover [nosymbol] {"2218} {A}
33  \mathover [nosymbol] {"2219} {A}
34\stopformula
35\stopbuffer
36
37\typebuffer
38
39This looks like this:
40
41\getbuffer
42
43But we want proper math, which means an an italic nucleus, a properly placed
44accent, a shift of that accent matching the slope or the nucleus, so we actually
45need:
46
47\startbuffer
48\definemathstackers
49  [mysymbol]
50  [voffset=-.30\mathexheight,
51   hoffset=\zeropoint,
52   mathclass=ord,
53   topoffset=.4\mathemwidth,
54   middlecommand=\mathematics,
55   color=maincolor]
56\stopbuffer
57
58\typebuffer \getbuffer
59
60\startbuffer
61\startformula
62  \mathover  [mysymbol]{"2217}       {A}
63  \mathover  [mysymbol]{"2218}       {A}
64  \mathover  [mysymbol]{"2219}       {A}
65  \mathunder [mysymbol]       {"2217}{A}
66  \mathunder [mysymbol]       {"2218}{A}
67  \mathunder [mysymbol]       {"2219}{A}
68  \mathdouble[mysymbol]{"2217}{"2217}{A}
69  \mathdouble[mysymbol]{"2218}{"2218}{A}
70  \mathdouble[mysymbol]{"2219}{"2219}{A}
71\stopformula
72\stopbuffer
73
74We show both over and under variants:
75
76\typebuffer
77
78So this time we get:
79
80\getbuffer
81
82We can now redefine the \quote {interiorset} symbol to use \type {0x2217} instead
83of \type {0x2218}:
84
85\startbuffer
86\definemathover[mysymbol][interiorset]["2217]
87
88\startformula
89    \interiorset{A}^{\interiorset{A}^{\interiorset{A}}}
90\stopformula
91\stopbuffer
92
93\typebuffer
94
95Of course normally you will not use color:
96
97\pushoverloadmode
98\getbuffer
99\popoverloadmode
100
101\stopsection
102
103\stopchapter
104
105\stopcomponent
106