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