1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16\startmodule[mathatoms]
17
18\setvalue{atom:\number\mathordinarycode }{ord}
19\setvalue{atom:\number\mathoperatorcode }{ope}
20\setvalue{atom:\number\mathbinarycode }{bin}
21\setvalue{atom:\number\mathrelationcode }{rel}
22\setvalue{atom:\number\mathopencode }{ope}
23\setvalue{atom:\number\mathclosecode }{clo}
24\setvalue{atom:\number\mathpunctuationcode }{pun}
25
26
27
28\setvalue{atom:\number\mathfractioncode }{fra}
29\setvalue{atom:\number\mathradicalcode }{rad}
30\setvalue{atom:\number\mathmiddlecode }{mid}
31
32
33
34
35
36
37
38
39
40\setvalue{atom:\number\mathfunctioncode }{fun}
41\setvalue{atom:\number\mathdigitcode }{dig}
42
43\dostepwiserecurse \mathordinarycode \mathdigitcode \plusone {
44 \setmathatomrule \mathbegincode #1 \allmathstyles \mathbegincode #1
45 \setmathatomrule #1 \mathendcode \allmathstyles #1 \mathendcode
46 \dostepwiserecurse \mathordinarycode \mathdigitcode \plusone {
47 \setmathatomrule#1 ##1 \allmathstyles #1 ##1
48 }
49}
50
51\protected\def\showmathatomspacing#1{
52 \startTEXpage[offset=10pt]
53 \showmakeup[mathglue]
54 \bTABLE[align=middle,width=4em]
55 \dostepwiserecurse \mathordinarycode \mathdigitcode \plusone {
56 \ifcsname atom:##1\endcsname
57 \bTR
58 \dostepwiserecurse \mathordinarycode \mathdigitcode \plusone {
59 \ifcsname atom:####1\endcsname
60 \bTD
61 $ #1
62 \mathatom class ##1 {\hpack to 1.5em{\infofont[\hss\getvalue{atom:##1}\hss]}}
63 \mathatom class ####1 {\hpack to 1.5em{\infofont[\hss\getvalue{atom:####1}\hss]}}
64 $
65 \eTD
66 \fi
67 }
68 \eTR
69 \fi
70 }
71 \bTR[frame=off]
72 \bTD[nx=12,height=6ex,align={middle,lohi}]
73 \type{#1}
74 \eTD
75 \eTR
76 \bTR
77 \bTD[nx=12,align=middle]
78 \infofont\hfill
79 tiny : \the\tinymuskip\hfill
80 thin : \the\thinmuskip\hfill
81 med : \the\medmuskip\hfill
82 thick : \the\thickmuskip\hfill\strut
83 \eTD
84 \eTR
85 \eTABLE
86 \stopTEXpage
87}
88
89\stopmodule
90
91\continueifinputfile{smathatoms.mkxl}
92
93\starttext
94
95 \showmathatomspacing{\displaystyle}
96 \showmathatomspacing{\textstyle}
97 \showmathatomspacing{\scriptstyle}
98 \showmathatomspacing{\scriptscriptstyle}
99 \showmathatomspacing{\crampeddisplaystyle}
100 \showmathatomspacing{\crampedtextstyle}
101 \showmathatomspacing{\crampedscriptstyle}
102 \showmathatomspacing{\crampedscriptscriptstyle}
103
104\stoptext
105 |