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