1
2
3
4
5
6
7
8
9
10
11
12
13
14\enabletrackers [ pages . timing ]
15
16\enableexperiments [ fonts . compact ]
17
18\usemodule [ s ] [ math characters ]
19
20
21
22
23
24
25
26
27
28\startmodule [ math repertoire ]
29
30
31
32\definecolor [ backgroundcolor ] [ r = . 6 , g = . 6 ]
33\definecolor [ backgroundcolorx ] [ r = . 6 ]
34\definecolor [ backgroundcolory ] [ g = . 6 ]
35\definecolor [ baselinecolor ] [ a = 1 , t = . 5 , s = . 6 ]
36\definecolor [ charactercolor ] [ b = . 6 ]
37\definecolor [ pagecolor ] [ s = . 1 ]
38\definecolor [ nonecolor ] [ s = . 5 ]
39\definecolor [ textcolor ] [ s = . 9 ]
40
41
42
43
44
45
46\setuppapersize
47 [ HD ]
48
49\setuplayout
50 [ backspace = 0 pt ,
51 topspace = 0 pt ,
52 bottomspace = 1 2 0 pt ,
53 bottom = 2 4 pt ,
54 bottomdistance = 5 mm ,
55 header = 0 pt ,
56 footer = 0 pt ,
57 width = middle ,
58 height = middle ]
59
60\definelayer
61 [ page ]
62
63\setuplayer
64 [ page ]
65 [ width = \textwidth ,
66 height = \textheight ]
67
68\setupbackgrounds
69 [ page ]
70 [ background = color ,
71 backgroundcolor = pagecolor ]
72
73\setupbackgrounds
74 [ text ] [ text ]
75 [ bottomframe = on ,
76 framecolor = textcolor ,
77 rulethickness = 0 . 0 2 5 ex ]
78
79\setupmakeup
80 [ standard ]
81 [ pagestate = start ]
82
83\setupinteraction
84 [ state = start ,
85 menu = on ]
86
87\defineinteractionmenu
88 [ ALPHABETS ]
89 [ bottom ]
90
91\defineinteractionmenu
92 [ alphabets ]
93 [ bottom ]
94
95\defineinteractionmenu
96 [ symbols ]
97 [ bottom ]
98
99\setupinteractionmenu
100 [ bottom ]
101 [ before = \vfill ,
102 after = \vfill ,
103 left = \hfill ,
104 right = \hfill ,
105 style = \tt \bf ,
106 distance = 0 pt ,
107 color = textcolor ,
108 contrastcolor = nonecolor ]
109
110\def \showmathcharacterssetrange # 1 # 2 # 3
111 { \writestatus { range } { # 1 : \unihex { # 2 } \unihex { # 3 } }
112 \ifcase # 2 \relax
113 \definereference [ # 1 ] [ notpresent ]
114 \else \ifcase # 3 \relax
115 \definereference [ # 1 ] [ notpresent ]
116 \else
117 \normalexpanded { \definereference [ # 1 ] [ \unihex { # 2 } ] }
118 \fi \fi }
119
120\startinteractionmenu [ bottom ]
121 \startgot [ firstpage ] first \stopgot \quad
122 \startgot [ deltapage ( 1 0 0 ) ] 1 0 0 \stopgot \quad
123 \startgot [ deltapage ( 1 0 ) ] 1 0 \stopgot \quad
124 \startgot [ previouspage ] previous \stopgot \quad
125 \startgot [ nextpage ] next \stopgot \quad
126 \startgot [ deltapage ( 1 0 ) ] 1 0 \stopgot \quad
127 \startgot [ deltapage ( 1 0 0 ) ] 1 0 0 \stopgot \quad
128 \startgot [ lastpage ] last \stopgot
129\stopinteractionmenu
130
131\startinteractionmenu [ ALPHABETS ]
132 \startgot [ U 0 0 0 4 1 ] NORMAL \stopgot \quad
133 \startgot [ U 1 D 4 0 0 ] BOLD \stopgot \quad
134 \startgot [ U 1 D 4 3 4 ] ITALIC \stopgot \quad
135 \startgot [ U 1 D 4 6 8 ] BOLDITALIC \stopgot \quad
136 \startgot [ U 1 D 4 9 C ] SCRIPT \stopgot \quad
137 \startgot [ U 1 D 4 D 0 ] BOLDSCRIPT \stopgot \quad
138 \startgot [ U 1 D 5 0 4 ] FRAKTUR \stopgot \quad
139 \startgot [ U 1 D 5 3 8 ] DOUBLESTRUCK \stopgot \quad
140 \startgot [ U 1 D 5 6 C ] BOLDFRAKTUR \stopgot \quad
141 \startgot [ U 1 D 5 A 0 ] SS NORMAL \stopgot \quad
142 \startgot [ U 1 D 5 D 4 ] SS BOLD \stopgot \quad
143 \startgot [ U 1 D 6 0 8 ] SS ITALIC \stopgot \quad
144 \startgot [ U 1 D 6 3 C ] SS BOLDITALIC \stopgot \quad
145 \startgot [ U 1 D 6 7 0 ] MONOSPACE \stopgot \quad
146 \startgot [ U 0 0 3 9 1 ] GRK NORMAL \stopgot \quad
147 \startgot [ U 1 D 6 A 8 ] GRK BOLD \stopgot \quad
148 \startgot [ U 1 D 6 E 2 ] GRK ITALIC \stopgot \quad
149 \startgot [ U 1 D 7 1 C ] GRK BOLDITALIC \stopgot \quad
150 \startgot [ U 1 D 7 5 6 ] GRK SS BOLD \stopgot \quad
151 \startgot [ U 1 D 7 9 0 ] GRK SS BOLDITALIC \stopgot
152\stopinteractionmenu
153
154\startinteractionmenu [ alphabets ]
155 \startgot [ U 0 0 0 6 1 ] normal \stopgot \quad
156 \startgot [ U 1 D 4 1 A ] bold \stopgot \quad
157 \startgot [ U 1 D 4 4 E ] italic \stopgot \quad
158 \startgot [ U 1 D 4 8 2 ] bolditalic \stopgot \quad
159 \startgot [ U 1 D 4 B 6 ] script \stopgot \quad
160 \startgot [ U 1 D 4 EA ] boldscript \stopgot \quad
161 \startgot [ U 1 D 5 1 E ] fraktur \stopgot \quad
162 \startgot [ U 1 D 5 5 2 ] doublestruck \stopgot \quad
163 \startgot [ U 1 D 5 8 6 ] boldfraktur \stopgot \quad
164 \startgot [ U 1 D 5 BA ] ss normal \stopgot \quad
165 \startgot [ U 1 D 5 EE ] ss bold \stopgot \quad
166 \startgot [ U 1 D 6 2 2 ] ss italic \stopgot \quad
167 \startgot [ U 1 D 6 5 6 ] ss bolditalic \stopgot \quad
168 \startgot [ U 1 D 6 8 A ] monospace \stopgot \quad
169 \startgot [ U 0 0 3 B 1 ] grk normal \stopgot \quad
170 \startgot [ U 1 D 6 C 2 ] grk bold \stopgot \quad
171 \startgot [ U 1 D 6 FC ] grk italic \stopgot \quad
172 \startgot [ U 1 D 7 3 6 ] grk bolditalic \stopgot \quad
173 \startgot [ U 1 D 7 7 0 ] grk ss bold \stopgot \quad
174 \startgot [ U 1 D 7 AA ] grk ss bolditalic \stopgot
175\stopinteractionmenu
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193\startinteractionmenu [ symbols ]
194 \startgot [ U 0 0 0 3 0 ] dig normal \stopgot \quad
195 \startgot [ U 1 D 7 CE ] dig bold \stopgot \quad
196 \startgot [ U 1 D 7 D 8 ] dig doublestruck \stopgot \quad
197 \startgot [ U 1 D 7 E 2 ] dig ss normal \stopgot \quad
198 \startgot [ U 1 D 7 EC ] dig ss bold \stopgot \quad
199 \startgot [ U 1 D 7 F 6 ] dig monospace \stopgot \quad
200 \startgot [ U 0 2 2 0 0 ] operators \stopgot \quad
201 \startgot [ miscellaneousmathematicalsymbolsa ] symbols a \stopgot \quad
202 \startgot [ miscellaneousmathematicalsymbolsb ] symbols b \stopgot \quad
203 \startgot [ supplementalmathematicaloperators ] supplemental \stopgot \quad
204 \startgot [ supplementalarrowsa ] arrows a \stopgot \quad
205 \startgot [ supplementalarrowsb ] arrows b \stopgot \quad
206 \startgot [ supplementalarrowsc ] arrows c \stopgot \quad
207 \removeunwantedspaces
208\stopinteractionmenu
209
210\defineframed
211 [ somedata ]
212 [ background = color ,
213 backgroundcolor = textcolor ,
214
215
216 frame = off ,
217 offset = 1 ex ]
218
219
220
221\unexpanded \def \showmathcharacterstxt # 1
222 { { \tttf # 1 } }
223
224\unexpanded \def \showmathcharacterschr # 1 # 2
225 { \iffontchar \font # 2 \relax
226 \scale
227 [ sx = # 1 , sy = # 1 ]
228 { \dontleavehmode
229 \begingroup
230 \setbox \scratchbox \hbox { \charactercolor \char # 2 }
231 \scratchdimen \wd \scratchbox
232 \ifdim \scratchdimen > \zeropoint
233 \backgroundline [ backgroundcolor ] { \box \scratchbox }
234 \else \ifdim \scratchdimen < \zeropoint
235 \scratchdimen \scratchdimen
236 \setbox \scratchbox \hbox to \scratchdimen { \hss \charactercolor \char # 2 }
237 \backgroundline [ backgroundcolorx ] { \box \scratchbox }
238 \else
239 \setbox \scratchbox \hbox to \emwidth { \hss \charactercolor \char # 2 }
240 \scratchdimen \wd \scratchbox
241 \backgroundline [ backgroundcolory ] { \box \scratchbox }
242 \fi \fi
243 \hskip \scratchdimen
244 \baselinecolor \vrule width \scratchdimen height . 0 5 \exheight depth . 0 5 \exheight
245 \endgroup }
246 \fi }
247
248\unexpanded \def \showmathcharactersmth # 1 # 2
249 { \setbox \scratchbox \hbox { \showmathcharacterschr { # 1 } { # 2 } }
250 \ht \scratchbox \strutht
251 \dp \scratchbox \strutdp
252 \box \scratchbox }
253
254\let \showmathcharactersbodyfonts \empty
255
256\unexpanded \def \showmathcharactersbodyfontentry # 1 # 2
257 { \somedata
258 [ align = { none , middle } , background = , height = 5 cm ]
259 { \begingroup
260 \switchtobodyfont [ # 2 , 1 2 pt ]
261 \definedfont [ MathRoman * math text ]
262 \showmathcharactersmth { 1 0 } { # 1 }
263 \endgroup
264 \vfilll
265 \doifelsemode { crosslink }
266 { \goto { \strut \textcolor \showmathcharacterstxt { # 2 } } [ # 2 : : # 1 ] }
267 { \strut \textcolor \showmathcharacterstxt { # 2 } } }
268 \hskip 1 ex }
269
270\unexpanded \def \showmathcharacterssetbodyfonts # 1
271 { \edef \showmathcharactersbodyfonts { # 1 }
272
273 \def \doshowmathcharacterssetbodyfonts # # 1 { \usebodyfont [ # # 1 , 1 2 pt ] }
274 \processcommacommand [ \showmathcharactersbodyfonts ] \doshowmathcharacterssetbodyfonts }
275
276\unexpanded \def \showmathcharactersbodyfontschars # 1
277 { \processcommacommand [ \showmathcharactersbodyfonts ] { \showmathcharactersbodyfontentry { # 1 } } }
278
279
280
281\unexpanded \def \showmathcharactersstart
282 { \starttext
283 \startstandardmakeup
284 \setupalign [ middle ]
285 \vfil
286
287 \dontleavehmode \scale [ width = . 7 5 \textwidth ] { \strut \color [ textcolor ] { \fontclass } }
288 \vfil
289 \dontleavehmode \scale [ height = . 1 \textheight ] { \strut \color [ baselinecolor ] { \currentdate } }
290 \vfil
291 \vfil
292 \stopstandardmakeup }
293
294\unexpanded \def \showmathcharactersstop
295 { \stoptext }
296
297
298
299\unexpanded \def \showmathcharactersstartentry
300 { \startstandardmakeup }
301
302\unexpanded \def \showmathcharactersstopentry
303 { \tightlayer [ page ]
304 \stopstandardmakeup }
305
306\unexpanded \def \showmathcharactersreference # 1
307 { \setlayer [ page ] { \pagereference [ # 1 ] } }
308
309\unexpanded \def \showmathcharactersentryhexdectit # 1 # 2 # 3
310 { \setlayer
311 [ page ]
312 [ preset = middletop , voffset = 5 mm ]
313 { \somedata [ height = 1 cm ] { \showmathcharacterstxt { # 1 } } }
314 \setlayer
315 [ page ]
316 [ preset = middle , y = 2 cm ]
317 { \showmathcharactersmth { 2 5 } { # 2 } }
318 \setlayer
319 [ page ]
320 [ preset = righttop , offset = 5 mm ]
321 { \somedata [ height = 1 cm ] { \showmathcharacterstxt { # 3 } } }
322 \doifsomething \showmathcharactersbodyfonts
323 { \setlayer
324 [ page ]
325 [ preset = middlebottom , voffset = 5 mm ]
326 { \showmathcharactersbodyfontschars { # 2 } } } }
327
328
329
330\unexpanded \def \showmathcharactersentrywdhtdpic # 1 # 2 # 3 # 4
331 { \setlayer
332 [ page ]
333 [ preset = leftbottom , offset = 5 mm ]
334 { \somedata [ align = normal , width = 5 cm ]
335 { \strut width \hfill \the \dimexpr # 1 \scaledpoint \par
336 \strut height \hfill \the \dimexpr # 2 \scaledpoint \par
337 \strut depth \hfill \the \dimexpr # 3 \scaledpoint \par
338 \strut italic \hfill \the \dimexpr # 4 \scaledpoint } } }
339
340\unexpanded \def \showmathcharactersentryresource # 1
341 { }
342
343
344
345\unexpanded \def \showmathcharactersstartnext
346 { \setlayer
347 [ page ]
348 [ preset = middleleft , hoffset = 5 mm ]
349 \bgroup \vbox \bgroup }
350
351\unexpanded \def \showmathcharactersstopnext
352 { \egroup \egroup }
353
354\unexpanded \def \showmathcharactersnextentry # 1 # 2 # 3
355 { \ifnum # 1 > 1 \vskip \exheight \fi
356 \dontleavehmode \somedata
357 [ align = normal , width = 4 cm ]
358 { \strut \showmathcharacterstxt { # 2 } \hfill \showmathcharacterschr { 2 } { # 3 } } \par }
359
360\unexpanded \def \showmathcharactersnextcycle # 1
361 { \ifnum # 1 > 1 \vskip \exheight \fi
362 \dontleavehmode \somedata
363 [ align = normal , width = 4 cm ]
364 { \strut \showmathcharacterstxt { cycle } } \par }
365
366
367
368\unexpanded \def \showmathcharactersstartvvariants
369 { \setlayer
370 [ page ]
371 [ preset = lefttop , offset = 5 mm ]
372 \bgroup \vbox \bgroup }
373
374\unexpanded \def \showmathcharactersstarthvariants
375 { \setlayer
376 [ page ]
377 [ preset = lefttop , offset = 5 mm ]
378 \bgroup \hbox \bgroup }
379
380\unexpanded \def \showmathcharactersvvariantsentry # 1 # 2 # 3
381 { \ifnum # 1 > 1 \vskip \exheight \fi
382 \dontleavehmode \somedata
383 [ align = middle , width = 4 cm ]
384 { \strut \showmathcharacterstxt { # 2 } \hfilll \showmathcharacterschr { 2 } { # 3 } } }
385
386\unexpanded \def \showmathcharactershvariantsentry # 1 # 2 # 3
387 { \ifnum # 1 > 1 \hskip \exheight \else \dontleavehmode \fi
388 \somedata
389 [ align = { none , middle } , height = 2 cm ]
390 { \strut \showmathcharacterstxt { # 2 } \vfilll \showmathcharacterschr { 2 } { # 3 } } }
391
392\unexpanded \def \showmathcharactersstopvvariants
393 { \egroup \egroup }
394
395\unexpanded \def \showmathcharactersstophvariants
396 { \egroup \egroup }
397
398\unexpanded \def \showmathcharactersbetweennextandvariants
399 { }
400
401
402
403\unexpanded \def \showmathcharactersstartentryclassspec
404 { \setlayer
405 [ page ]
406 [ preset = rightbottom , offset = 5 mm ]
407 \bgroup \somedata [ align = normal , width = 8 cm ] \bgroup }
408
409\unexpanded \def \showmathcharactersstopentryclassspec
410 { \egroup \egroup }
411
412\unexpanded \def \showmathcharactersentryclassname # 1 # 2
413 { \strut { \showmathcharacterstxt # 1 } \hfill \showmathcharacterstxt { # 2 } \par }
414
415
416
417\unexpanded \def \showmathcharactersentrysymbol # 1 # 2
418 { \setlayer
419 [ page ]
420 [ preset = leftbottom , hoffset = 5 mm , voffset = 5 0 mm ]
421 { \somedata
422 [ align = normal , width = 5 cm ]
423 { \showmathcharacterstxt { # 1 } \hfill \showmathcharacterschr { 4 } { # 2 } } } }
424
425
426
427\unexpanded \def \showmathcharactersstartlookupvariants
428 { \setlayer
429 [ page ]
430 [ preset = middleright , hoffset = 5 mm ]
431 \bgroup \vbox \bgroup }
432
433\unexpanded \def \showmathcharactersstoplookupvariants
434 { \egroup \egroup }
435
436\unexpanded \def \showmathcharacterslookupvariant # 1 # 2 # 3 # 4
437 { \ifnum # 1 > 1 \vskip \exheight \fi
438 \somedata
439 [ align = normal , width = 7 cm ]
440 { \showmathcharacterstxt { # 4 : } \showmathcharacterstxt { # 2 } \hfill \showmathcharacterschr { 4 } { # 3 } } }
441
442
443
444
445
446
447\unprotect
448
449\unexpanded \def \showmathfontrepertoire
450 { \dosingleempty \module_math_repertoire_show }
451
452\def \module_math_repertoire_show [ # 1 ]
453 { \showmathfontcharacters [ alternative = , option = , check = yes , # 1 ]
454 \showmathfontcharacters [ alternative = , option = , # 1 ] }
455
456\protect
457
458\stopmodule
459
460\continueifinputfile { s math repertoire . mkiv }
461
462
463
464
465\showmathcharacterssetbodyfonts { newcomputermodern book , lucidaot , cambria , stixtwo , modern , pagella , termes , schola , dejavu }
466
467\starttext
468
469 \doifelse { \getdocumentargument { bodyfont } } { } {
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487 \setupbodyfont [ newcomputermodern book , 1 2 pt ]
488
489 } {
490
491 \normalexpanded { \setupbodyfont [ \getdocumentargument { bodyfont } , 1 2 pt ] }
492
493 }
494
495 \showmathfontrepertoire
496
497\stoptext
498
499 |