1
2
3
4
5
6
7
8
9
10
11
12
13
14\startmodule[mathcharacters]
15
16\registerctxluafile{smathcharacters}{}
17
18
19
20
21\startsetups smathcharacters:reset
22
23 \let\showmathcharactersstart \relax
24 \let\showmathcharactersstop \relax
25 \let\showmathcharactersreference \gobbleoneargument
26 \let\showmathcharactersstartentry \relax
27 \let\showmathcharactersstopentry \relax
28 \let\showmathcharactersentryhexdectit \gobblethreearguments
29 \let\showmathcharactersentrywdhtdpic \gobblefourarguments
30 \let\showmathcharactersentryresource \gobbleoneargument
31 \let\showmathcharactersstartnext \relax
32 \let\showmathcharactersnextentry \gobblethreearguments
33 \let\showmathcharactersnextcycle \gobbleonearguments
34 \let\showmathcharactersstopnext \relax
35 \let\showmathcharactersstarthparts \relax
36 \let\showmathcharactershpartsentry \gobblethreearguments
37 \let\showmathcharactersstophparts \relax
38 \let\showmathcharactersstartvparts \relax
39 \let\showmathcharactersvpartsentry \gobblethreearguments
40 \let\showmathcharactersstopvparts \relax
41 \let\showmathcharactersbetweennextandvparts\relax
42 \let\showmathcharactersstartentryclassspec \relax
43 \let\showmathcharactersstopentryclassspec \relax
44 \let\showmathcharactersentryclassname \gobbletwoarguments
45 \let\showmathcharactersentrysymbol \gobbletwoarguments
46 \let\showmathcharactersstartlookupvariants \relax
47 \let\showmathcharacterslookupvariant \gobblefourarguments
48 \let\showmathcharactersstoplookupvariants \relax
49 \let\showmathcharacterssetrange \gobblethreearguments
50
51\stopsetups
52
53\directsetup{smathcharacters:reset}
54
55\startsetups smathcharacters:default
56
57 \directsetup{smathcharacters:reset}
58
59 \unexpanded\def\showmathcharactersstartentry {\blank\startpacked\raggedright}
60 \unexpanded\def\showmathcharactersstopentry {\stoppacked\blank}
61
62 \def\showmathcharactersentryhexdectit##1##2##3
63 {##1:\space{\char##2}\space\ruledhbox{\char##2}\space##3\par
64 \advance\leftskip\emwidth\relax}
65
66 \def\showmathcharactersentrywdhtdpic##1##2##3##4
67 {width:\space##1,\space height:\space##2,\space depth:\space##3,\space italic:\space##4\par}
68
69 \def\showmathcharactersentryresource##1
70 {virtual:\space##1\par}
71
72 \def\showmathcharactersstartnext
73 {\par\begingroup\hangindent\emwidth\hangafter\plushundred\hskip\emwidth\relax
74 next:\space}
75
76 \def\showmathcharactersnextentry##1##2##3
77 {\ifnum##1>\plusone \space=>\space\fi##2\ruledhbox{\char##3}}
78
79 \def\showmathcharactersnextcycle##1
80 {\ifnum##1>\plusone \space=>\space\fi cycle}
81
82 \def\showmathcharactersstopnext
83 {\par\endgroup}
84
85 \def\showmathcharactersstartparts
86 {\par\begingroup\hangindent\emwidth\hangafter\plushundred\hskip\emwidth\relax
87 parts:\space}
88
89 \def\showmathcharacterspartsentry##1##2##3
90 {\ifnum##1>\plusone \space=>\space\fi##2\ruledhbox{\char##3}}
91
92 \def\showmathcharactersstopparts
93 {\par\endgroup}
94
95 \let\showmathcharactersstartvparts\showmathcharactersstartparts
96 \let\showmathcharactersvpartsentry\showmathcharacterspartsentry
97 \let\showmathcharactersstopvparts \showmathcharactersstopparts
98
99 \let\showmathcharactersstarthparts\showmathcharactersstartparts
100 \let\showmathcharactershpartsentry\showmathcharacterspartsentry
101 \let\showmathcharactersstophparts \showmathcharactersstopparts
102
103 \def\showmathcharactersbetweennextandparts
104 {}
105
106 \def\showmathcharactersentryclassname##1##2
107 {mathclass:\space##1,\space mathname:\space##2\par}
108
109 \def\showmathcharactersentrysymbol##1##2
110 {mathsymbol:\space##1\ruledhbox{\char##2}\par}
111
112 \def\showmathcharactersstartlookupvariants
113 {\par\begingroup\hangindent\emwidth\hangafter\plushundred\hskip\emwidth\relax
114 lookupvariants:\space}
115
116 \def\showmathcharacterslookupvariant##1##2##3##4
117 {\ifnum##1>\plusone,\space\fi##2:{\char##3}\space(##4)}
118
119 \def\showmathcharactersstoplookupvariants
120 {\par\endgroup}
121
122\stopsetups
123
124\unprotect
125
126\unexpanded\def\enableshowmathfontvirtual
127 {\ctxlua{fonts.constructors.autocleanup=false}}
128
129\unexpanded\def\showmathfontcharacters
130 {\dosingleempty\module_math_characters_show}
131
132\def\module_math_characters_show[#1]
133 {\begingroup
134 \getdummyparameters
135 [\c!bodyfont=,
136 \c!list=,
137 \c!check=,
138 \c!alternative=default,
139 \c!option=\v!all,
140 #1]
141 \directsetup{smathcharacters:\dummyparameter\c!alternative}
142 \doifelsenothing{\dummyparameter\c!bodyfont}
143 {\definedfont[MathRoman*mathtext]}
144 {\definedfont[\dummyparameter\c!bodyfont]}
145 \dontcomplain
146 \ctxlua{moduledata.math.characters.showlist {
147 number = false,
148 check = "\dummyparameter\c!check",
149 list = "\dummyparameter\c!list",
150 option = "\dummyparameter\c!option",
151 }}
152 \endgroup}
153
154\protect
155
156\stopmodule
157
158\continueifinputfile{smathcharacters.mkiv}
159
160\setuplayout
161 [width=middle,
162 height=middle,
163 topspace=15mm,
164 backspace=15mm,
165 bottomspace=15mm,
166 header=1cm,
167 headerdistance=0.5cm,
168 footer=0pt]
169
170\starttext
171
172 \doifelse {\getdocumentargument{bodyfont}} {} {
173
174 \setupbodyfont[cambria, 12pt]
175
176
177
178
179
180
181
182
183
184
185
186
187
188 } {
189
190 \normalexpanded{\setupbodyfont[\getdocumentargument{bodyfont},12pt]}
191
192 }
193
194 \showmathfontcharacters
195
196\stoptext
197
198 |