math-ttv.lua /size: 30 Kb    last modification: 2023-12-21 09:44
1if not modules then modules = { } end modules ['math-ttv'] = {
2    version   = 1.001,
3    comment   = "traditional tex vectors, companion to math-vfu.lua",
4    author    = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
5    copyright = "PRAGMA ADE / ConTeXt Development Team",
6    license   = "see context related readme files",
7    dataonly  = true,
8}
9
10local vfmath        = fonts.handlers.vf.math
11local setletters    = vfmath.setletters
12local setdigits     = vfmath.setdigits
13
14local mathencodings = fonts.encodings.math
15
16-- varphi is part of the alphabet, contrary to the other var*s'
17
18mathencodings["large-to-small"] = {
19    [0x00028] = 0x00, -- (
20    [0x00029] = 0x01, -- )
21    [0x0005B] = 0x02, -- [
22    [0x0005D] = 0x03, -- ]
23    [0x0230A] = 0x04, -- lfloor
24    [0x0230B] = 0x05, -- rfloor
25    [0x02308] = 0x06, -- lceil
26    [0x02309] = 0x07, -- rceil
27    [0x0007B] = 0x08, -- {
28    [0x0007D] = 0x09, -- }
29    [0x027E8] = 0x0A, -- <
30    [0x027E9] = 0x0B, -- >
31    [0x0007C] = 0x0C, -- |
32 -- [0x0]     = 0x0D, -- lVert rVert Vert
33 -- [0x0002F] = 0x0E, -- /
34    [0x0005C] = 0x0F, -- \
35 -- [0x0]     = 0x3A, -- lgroup
36 -- [0x0]     = 0x3B, -- rgroup
37 -- [0x0]     = 0x3C, -- arrowvert
38 -- [0x0]     = 0x3D, -- Arrowvert
39    [0x02195] = 0x3F, -- updownarrow
40 -- [0x0]     = 0x40, -- lmoustache
41 -- [0x0]     = 0x41, -- rmoustache
42    [0x0221A] = 0x70, -- sqrt
43    [0x021D5] = 0x77, -- Updownarrow
44    [0x02191] = 0x78, -- uparrow
45    [0x02193] = 0x79, -- downarrow
46    [0x021D1] = 0x7E, -- Uparrow
47    [0x021D3] = 0x7F, -- Downarrow
48    [0x0220F] = 0x59, -- prod
49    [0x02210] = 0x61, -- coprod
50    [0x02211] = 0x58, -- sum
51    [0x0222B] = 0x5A, -- intop
52    [0x0222E] = 0x49, -- ointop
53 -- [0xFE302] = 0x62, -- widehat
54 -- [0xFE303] = 0x65, -- widetilde
55    [0x00302] = 0x62, -- widehat
56    [0x00303] = 0x65, -- widetilde
57    [0x022C0] = 0x5E, -- bigwedge
58    [0x022C1] = 0x5F, -- bigvee
59    [0x022C2] = 0x5C, -- bigcap
60    [0x022C3] = 0x5B, -- bigcup
61    [0x02044] = 0x0E, -- /
62}
63
64mathencodings["large-to-small-private"] = {
65    [0xFE07A] = 0x7A, -- bracehtipdownleft
66    [0xFE07B] = 0x7B, -- bracehtipdownright
67    [0xFE07C] = 0x7C, -- bracehtipupleft
68    [0xFE07D] = 0x7D, -- bracehtipupright
69
70}
71
72-- Beware: these are (in cm/lm) below the baseline due to limitations
73-- in the tfm format but the engine (combined with the mathclass) takes
74-- care of it. If we need them in textmode, we should make them virtual
75-- and move them up but we're in no hurry with that.
76
77mathencodings["tex-ex"] = {
78    [0x0220F] = 0x51, -- prod
79    [0x02210] = 0x60, -- coprod
80    [0x02211] = 0x50, -- sum
81    [0x0222B] = 0x52, -- intop
82    [0x0222E] = 0x48, -- ointop
83    [0x022C0] = 0x56, -- bigwedge
84    [0x022C1] = 0x57, -- bigvee
85    [0x022C2] = 0x54, -- bigcap
86    [0x022C3] = 0x53, -- bigcup
87    [0x02A00] = 0x4A, -- bigodot -- fixed BJ
88    [0x02A01] = 0x4C, -- bigoplus
89    [0x02A02] = 0x4E, -- bigotimes
90 -- [0x02A03] =     , -- bigudot --
91    [0x02A04] = 0x55, -- biguplus
92    [0x02A06] = 0x46, -- bigsqcup
93}
94
95-- only math stuff is needed, since we always use an lm or gyre
96-- font as main font
97
98mathencodings["tex-mr"] = {
99    [0x00393] = 0x00, -- Gamma
100    [0x00394] = 0x01, -- Delta
101    [0x00398] = 0x02, -- Theta
102    [0x0039B] = 0x03, -- Lambda
103    [0x0039E] = 0x04, -- Xi
104    [0x003A0] = 0x05, -- Pi
105    [0x003A3] = 0x06, -- Sigma
106    [0x003A5] = 0x07, -- Upsilon
107    [0x003A6] = 0x08, -- Phi
108    [0x003A8] = 0x09, -- Psi
109    [0x003A9] = 0x0A, -- Omega
110--  [0x00060] = 0x12, -- [math]grave
111--  [0x000B4] = 0x13, -- [math]acute
112--  [0x002C7] = 0x14, -- [math]check
113--  [0x002D8] = 0x15, -- [math]breve
114--  [0x000AF] = 0x16, -- [math]bar
115--  [0x00021] = 0x21, -- !
116--  [0x00028] = 0x28, -- (
117--  [0x00029] = 0x29, -- )
118--  [0x0002B] = 0x2B, -- +
119--  [0x0002F] = 0x2F, -- /
120--  [0x0003A] = 0x3A, -- :
121--  [0x02236] = 0x3A, -- colon
122--  [0x0003B] = 0x3B, -- ;
123--  [0x0003C] = 0x3C, -- <
124--  [0x0003D] = 0x3D, -- =
125--  [0x0003E] = 0x3E, -- >
126--  [0x0003F] = 0x3F, -- ?
127    [0x00391] = 0x41, -- Alpha
128    [0x00392] = 0x42, -- Beta
129    [0x02145] = 0x44,
130    [0x00395] = 0x45, -- Epsilon
131    [0x00397] = 0x48, -- Eta
132    [0x00399] = 0x49, -- Iota
133    [0x0039A] = 0x4B, -- Kappa
134    [0x0039C] = 0x4D, -- Mu
135    [0x0039D] = 0x4E, -- Nu
136    [0x0039F] = 0x4F, -- Omicron
137    [0x003A1] = 0x52, -- Rho
138    [0x003A4] = 0x54, -- Tau
139    [0x003A7] = 0x58, -- Chi
140    [0x00396] = 0x5A, -- Zeta
141--  [0x0005B] = 0x5B, -- [
142--  [0x0005D] = 0x5D, -- ]
143--  [0x0005E] = 0x5E, -- [math]hat -- the text one
144    [0x00302] = 0x5E, -- [math]hat -- the real math one
145--  [0x002D9] = 0x5F, -- [math]dot
146    [0x02146] = 0x64,
147    [0x02147] = 0x65,
148--  [0x002DC] = 0x7E, -- [math]tilde -- the text one
149    [0x00303] = 0x7E, -- [math]tilde -- the real one
150--  [0x000A8] = 0x7F, -- [math]ddot
151}
152
153mathencodings["tex-mr-missing"] = {
154    [0x02236] = 0x3A, -- colon
155}
156
157mathencodings["tex-mi"] = {
158    [0x1D6E4] = 0x00, -- Gamma
159    [0x1D6E5] = 0x01, -- Delta
160    [0x1D6E9] = 0x02, -- Theta
161    [0x1D6F3] = 0x02, -- varTheta (not present in TeX)
162    [0x1D6EC] = 0x03, -- Lambda
163    [0x1D6EF] = 0x04, -- Xi
164    [0x1D6F1] = 0x05, -- Pi
165    [0x1D6F4] = 0x06, -- Sigma
166    [0x1D6F6] = 0x07, -- Upsilon
167    [0x1D6F7] = 0x08, -- Phi
168    [0x1D6F9] = 0x09, -- Psi
169    [0x1D6FA] = 0x0A, -- Omega
170    [0x1D6FC] = 0x0B, -- alpha
171    [0x1D6FD] = 0x0C, -- beta
172    [0x1D6FE] = 0x0D, -- gamma
173    [0x1D6FF] = 0x0E, -- delta
174    [0x1D716] = 0x0F, -- epsilon TODO: 1D716
175    [0x1D701] = 0x10, -- zeta
176    [0x1D702] = 0x11, -- eta
177    [0x1D703] = 0x12, -- theta TODO: 1D703
178    [0x1D704] = 0x13, -- iota
179    [0x1D705] = 0x14, -- kappa
180    [0x1D718] = 0x14, -- varkappa, not in tex fonts
181    [0x1D706] = 0x15, -- lambda
182    [0x1D707] = 0x16, -- mu
183    [0x1D708] = 0x17, -- nu
184    [0x1D709] = 0x18, -- xi
185    [0x1D70B] = 0x19, -- pi
186    [0x1D70C] = 0x1A, -- rho
187    [0x1D70E] = 0x1B, -- sigma
188    [0x1D70F] = 0x1C, -- tau
189    [0x1D710] = 0x1D, -- upsilon
190    [0x1D719] = 0x1E, -- phi
191    [0x1D712] = 0x1F, -- chi
192    [0x1D713] = 0x20, -- psi
193    [0x1D714] = 0x21, -- omega
194    [0x1D700] = 0x22, -- varepsilon (the other way around)
195    [0x1D717] = 0x23, -- vartheta
196    [0x1D71B] = 0x24, -- varpi
197    [0x1D71A] = 0x25, -- varrho
198    [0x1D70D] = 0x26, -- varsigma
199    [0x1D711] = 0x27, -- varphi (the other way around)
200    [0x021BC] = 0x28, -- leftharpoonup
201    [0x021BD] = 0x29, -- leftharpoondown
202    [0x021C0] = 0x2A, -- rightharpoonup
203    [0x021C1] = 0x2B, -- rightharpoondown
204    [0xFE322] = 0x2C, -- lhook (hook for combining arrows)
205    [0xFE323] = 0x2D, -- rhook (hook for combining arrows)
206    [0x025B7] = 0x2E, -- triangleright : cf lmmath / BJ
207    [0x025C1] = 0x2F, -- triangleleft  : cf lmmath / BJ
208    [0x022B3] = 0x2E, -- triangleright : cf lmmath this a cramped triangles / BJ / see *
209    [0x022B2] = 0x2F, -- triangleleft  : cf lmmath this a cramped triangles / BJ / see *
210--  [0x00041] = 0x30, -- 0
211--  [0x00041] = 0x31, -- 1
212--  [0x00041] = 0x32, -- 2
213--  [0x00041] = 0x33, -- 3
214--  [0x00041] = 0x34, -- 4
215--  [0x00041] = 0x35, -- 5
216--  [0x00041] = 0x36, -- 6
217--  [0x00041] = 0x37, -- 7
218--  [0x00041] = 0x38, -- 8
219--  [0x00041] = 0x39, -- 9
220--~     [0x0002E] = 0x3A, -- .
221    [0x0002C] = 0x3B, -- ,
222    [0x0003C] = 0x3C, -- <
223--  [0x0002F] = 0x3D, -- /, slash, solidus
224    [0x02044] = 0x3D, -- / AM: Not sure
225    [0x0003E] = 0x3E, -- >
226    [0x022C6] = 0x3F, -- star
227    [0x02202] = 0x40, -- partial
228--
229    [0x0266D] = 0x5B, -- flat
230    [0x0266E] = 0x5C, -- natural
231    [0x0266F] = 0x5D, -- sharp
232    [0x02323] = 0x5E, -- smile
233    [0x02322] = 0x5F, -- frown
234    [0x02113] = 0x60, -- ell
235--
236    [0x1D6A4] = 0x7B, -- imath (TODO: also 0131)
237    [0x1D6A5] = 0x7C, -- jmath (TODO: also 0237)
238    [0x02118] = 0x7D, -- wp
239    [0x020D7] = 0x7E, -- vec (TODO: not sure)
240--              0x7F, -- (no idea what that could be)
241}
242
243mathencodings["tex-it"] = {
244--  [0x1D434] = 0x41, -- A
245    [0x1D6E2] = 0x41, -- Alpha
246--  [0x1D435] = 0x42, -- B
247    [0x1D6E3] = 0x42, -- Beta
248--  [0x1D436] = 0x43, -- C
249--  [0x1D437] = 0x44, -- D
250--  [0x1D438] = 0x45, -- E
251    [0x1D6E6] = 0x45, -- Epsilon
252--  [0x1D439] = 0x46, -- F
253--  [0x1D43A] = 0x47, -- G
254--  [0x1D43B] = 0x48, -- H
255    [0x1D6E8] = 0x48, -- Eta
256--  [0x1D43C] = 0x49, -- I
257    [0x1D6EA] = 0x49, -- Iota
258--  [0x1D43D] = 0x4A, -- J
259--  [0x1D43E] = 0x4B, -- K
260    [0x1D6EB] = 0x4B, -- Kappa
261--  [0x1D43F] = 0x4C, -- L
262--  [0x1D440] = 0x4D, -- M
263    [0x1D6ED] = 0x4D, -- Mu
264--  [0x1D441] = 0x4E, -- N
265    [0x1D6EE] = 0x4E, -- Nu
266--  [0x1D442] = 0x4F, -- O
267    [0x1D6F0] = 0x4F, -- Omicron
268--  [0x1D443] = 0x50, -- P
269    [0x1D6F2] = 0x50, -- Rho
270--  [0x1D444] = 0x51, -- Q
271--  [0x1D445] = 0x52, -- R
272--  [0x1D446] = 0x53, -- S
273--  [0x1D447] = 0x54, -- T
274    [0x1D6F5] = 0x54, -- Tau
275--  [0x1D448] = 0x55, -- U
276--  [0x1D449] = 0x56, -- V
277--  [0x1D44A] = 0x57, -- W
278--  [0x1D44B] = 0x58, -- X
279    [0x1D6F8] = 0x58, -- Chi
280--  [0x1D44C] = 0x59, -- Y
281--  [0x1D44D] = 0x5A, -- Z
282--
283--  [0x1D44E] = 0x61, -- a
284--  [0x1D44F] = 0x62, -- b
285--  [0x1D450] = 0x63, -- c
286--  [0x1D451] = 0x64, -- d
287--  [0x1D452] = 0x65, -- e
288--  [0x1D453] = 0x66, -- f
289--  [0x1D454] = 0x67, -- g
290--  [0x1D455] = 0x68, -- h
291    [0x0210E] = 0x68, -- Planck constant (h)
292--  [0x1D456] = 0x69, -- i
293--  [0x1D457] = 0x6A, -- j
294--  [0x1D458] = 0x6B, -- k
295--  [0x1D459] = 0x6C, -- l
296--  [0x1D45A] = 0x6D, -- m
297--  [0x1D45B] = 0x6E, -- n
298--  [0x1D45C] = 0x6F, -- o
299    [0x1D70A] = 0x6F, -- omicron
300--  [0x1D45D] = 0x70, -- p
301--  [0x1D45E] = 0x71, -- q
302--  [0x1D45F] = 0x72, -- r
303--  [0x1D460] = 0x73, -- s
304--  [0x1D461] = 0x74, -- t
305--  [0x1D462] = 0x75, -- u
306--  [0x1D463] = 0x76, -- v
307--  [0x1D464] = 0x77, -- w
308--  [0x1D465] = 0x78, -- x
309--  [0x1D466] = 0x79, -- y
310--  [0x1D467] = 0x7A, -- z
311}
312
313mathencodings["tex-ss"]           = { }
314mathencodings["tex-tt"]           = { }
315mathencodings["tex-bf"]           = { }
316mathencodings["tex-bi"]           = { }
317mathencodings["tex-fraktur"]      = { }
318mathencodings["tex-fraktur-bold"] = { }
319
320mathencodings["tex-sy"] = {
321    [0x0002D] = 0x00, -- -
322    [0x02212] = 0x00, -- -
323--  [0x02201] = 0x00, -- complement
324--  [0x02206] = 0x00, -- increment
325--  [0x02204] = 0x00, -- not exists
326--  [0x000B7] = 0x01, -- cdot
327    [0x022C5] = 0x01, -- cdot
328    [0x000D7] = 0x02, -- times
329    [0x0002A] = 0x03, -- *
330    [0x02217] = 0x03, -- *
331    [0x000F7] = 0x04, -- div
332    [0x022C4] = 0x05, -- diamond
333    [0x000B1] = 0x06, -- pm
334    [0x02213] = 0x07, -- mp
335    [0x02295] = 0x08, -- oplus
336    [0x02296] = 0x09, -- ominus
337    [0x02297] = 0x0A, -- otimes
338    [0x02298] = 0x0B, -- oslash
339    [0x02299] = 0x0C, -- odot
340    [0x025EF] = 0x0D, -- bigcirc, Orb (either 25EF or 25CB) -- todo
341    [0x02218] = 0x0E, -- circ
342    [0x02219] = 0x0F, -- bullet
343    [0x02022] = 0x0F, -- bullet
344    [0x0224D] = 0x10, -- asymp
345    [0x02261] = 0x11, -- equiv
346    [0x02286] = 0x12, -- subseteq
347    [0x02287] = 0x13, -- supseteq
348    [0x02264] = 0x14, -- leq
349    [0x02265] = 0x15, -- geq
350    [0x02AAF] = 0x16, -- preceq
351--  [0x0227C] = 0x16, -- preceq, AM:No see 2AAF
352    [0x02AB0] = 0x17, -- succeq
353--  [0x0227D] = 0x17, -- succeq, AM:No see 2AB0
354    [0x0223C] = 0x18, -- sim
355    [0x02248] = 0x19, -- approx
356    [0x02282] = 0x1A, -- subset
357    [0x02283] = 0x1B, -- supset
358    [0x0226A] = 0x1C, -- ll
359    [0x0226B] = 0x1D, -- gg
360    [0x0227A] = 0x1E, -- prec
361    [0x0227B] = 0x1F, -- succ
362    [0x02190] = 0x20, -- leftarrow
363    [0x02192] = 0x21, -- rightarrow
364--~ [0xFE190] = 0x20, -- leftarrow
365--~ [0xFE192] = 0x21, -- rightarrow
366    [0x02191] = 0x22, -- uparrow
367    [0x02193] = 0x23, -- downarrow
368    [0x02194] = 0x24, -- leftrightarrow
369    [0x02197] = 0x25, -- nearrow
370    [0x02198] = 0x26, -- searrow
371    [0x02243] = 0x27, -- simeq
372    [0x021D0] = 0x28, -- Leftarrow
373    [0x021D2] = 0x29, -- Rightarrow
374    [0x021D1] = 0x2A, -- Uparrow
375    [0x021D3] = 0x2B, -- Downarrow
376    [0x021D4] = 0x2C, -- Leftrightarrow
377    [0x02196] = 0x2D, -- nwarrow
378    [0x02199] = 0x2E, -- swarrow
379    [0x0221D] = 0x2F, -- propto
380    [0x02032] = 0x30, -- prime
381    [0x0221E] = 0x31, -- infty
382    [0x02208] = 0x32, -- in
383    [0x0220B] = 0x33, -- ni
384    [0x025B3] = 0x34, -- triangle, bigtriangleup
385    [0x025BD] = 0x35, -- bigtriangledown
386    [0x00338] = 0x36, -- not
387--              0x37, -- (beginning of arrow)
388    [0x02200] = 0x38, -- forall
389    [0x02203] = 0x39, -- exists
390    [0x000AC] = 0x3A, -- neg, lnot
391    [0x02205] = 0x3B, -- empty set
392    [0x0211C] = 0x3C, -- Re
393    [0x02111] = 0x3D, -- Im
394    [0x022A4] = 0x3E, -- top
395    [0x022A5] = 0x3F, -- bot, perp
396    [0x02135] = 0x40, -- aleph
397    [0x1D49C] = 0x41, -- script A
398    [0x0212C] = 0x42, -- script B
399    [0x1D49E] = 0x43, -- script C
400    [0x1D49F] = 0x44, -- script D
401    [0x02130] = 0x45, -- script E
402    [0x02131] = 0x46, -- script F
403    [0x1D4A2] = 0x47, -- script G
404    [0x0210B] = 0x48, -- script H
405    [0x02110] = 0x49, -- script I
406    [0x1D4A5] = 0x4A, -- script J
407    [0x1D4A6] = 0x4B, -- script K
408    [0x02112] = 0x4C, -- script L
409    [0x02133] = 0x4D, -- script M
410    [0x1D4A9] = 0x4E, -- script N
411    [0x1D4AA] = 0x4F, -- script O
412    [0x1D4AB] = 0x50, -- script P
413    [0x1D4AC] = 0x51, -- script Q
414    [0x0211B] = 0x52, -- script R
415    [0x1D4AE] = 0x53, -- script S
416    [0x1D4AF] = 0x54, -- script T
417    [0x1D4B0] = 0x55, -- script U
418    [0x1D4B1] = 0x56, -- script V
419    [0x1D4B2] = 0x57, -- script W
420    [0x1D4B3] = 0x58, -- script X
421    [0x1D4B4] = 0x59, -- script Y
422    [0x1D4B5] = 0x5A, -- script Z
423    [0x0222A] = 0x5B, -- cup
424    [0x02229] = 0x5C, -- cap
425    [0x0228E] = 0x5D, -- uplus
426    [0x02227] = 0x5E, -- wedge, land
427    [0x02228] = 0x5F, -- vee, lor
428    [0x022A2] = 0x60, -- vdash
429    [0x022A3] = 0x61, -- dashv
430    [0x0230A] = 0x62, -- lfloor
431    [0x0230B] = 0x63, -- rfloor
432    [0x02308] = 0x64, -- lceil
433    [0x02309] = 0x65, -- rceil
434    [0x0007B] = 0x66, -- {, lbrace
435    [0x0007D] = 0x67, -- }, rbrace
436    [0x027E8] = 0x68, -- <, langle
437    [0x027E9] = 0x69, -- >, rangle
438    [0x0007C] = 0x6A, -- |, mid, lvert, rvert
439    [0x02225] = 0x6B, -- parallel
440 -- [0x0    ] = 0x00, -- Vert, lVert, rVert, arrowvert, Arrowvert
441    [0x02195] = 0x6C, -- updownarrow
442    [0x021D5] = 0x6D, -- Updownarrow
443    [0x0005C] = 0x6E, -- \, backslash, setminus
444    [0x02216] = 0x6E, -- setminus
445    [0x02240] = 0x6F, -- wr
446    [0x0221A] = 0x70, -- sqrt. AM: Check surd??
447    [0x02A3F] = 0x71, -- amalg
448    [0x1D6FB] = 0x72, -- nabla
449--  [0x0222B] = 0x73, -- smallint (TODO: what about intop?)
450    [0x02294] = 0x74, -- sqcup
451    [0x02293] = 0x75, -- sqcap
452    [0x02291] = 0x76, -- sqsubseteq
453    [0x02292] = 0x77, -- sqsupseteq
454    [0x000A7] = 0x78, -- S
455    [0x02020] = 0x79, -- dagger, dag
456    [0x02021] = 0x7A, -- ddagger, ddag
457    [0x000B6] = 0x7B, -- P
458    [0x02663] = 0x7C, -- clubsuit
459    [0x02662] = 0x7D, -- diamondsuit
460    [0x02661] = 0x7E, -- heartsuit
461    [0x02660] = 0x7F, -- spadesuit
462    [0xFE321] = 0x37, -- mapstochar
463
464    [0xFE325] = 0x30, -- prime 0x02032
465}
466
467-- The names in masm10.enc can be trusted best and are shown in the first
468-- column, while in the second column we show the tex/ams names. As usual
469-- it costs hours to figure out such a table.
470
471mathencodings["tex-ma"] = {
472    [0x022A1] = 0x00, -- squaredot             \boxdot
473    [0x0229E] = 0x01, -- squareplus            \boxplus
474    [0x022A0] = 0x02, -- squaremultiply        \boxtimes
475    [0x025A1] = 0x03, -- square                \square \Box
476    [0x025A0] = 0x04, -- squaresolid           \blacksquare
477    [0x025AA] = 0x05, -- squaresmallsolid      \centerdot
478    [0x022C4] = 0x06, -- diamond               \Diamond \lozenge
479    [0x02666] = 0x07, -- diamondsolid          \blacklozenge
480    [0x021BB] = 0x08, -- clockwise             \circlearrowright
481    [0x021BA] = 0x09, -- anticlockwise         \circlearrowleft
482    [0x021CC] = 0x0A, -- harpoonleftright      \rightleftharpoons
483    [0x021CB] = 0x0B, -- harpoonrightleft      \leftrightharpoons
484    [0x0229F] = 0x0C, -- squareminus           \boxminus
485    [0x022A9] = 0x0D, -- forces                \Vdash
486    [0x022AA] = 0x0E, -- forcesbar             \Vvdash
487    [0x022A8] = 0x0F, -- satisfies             \vDash
488    [0x021A0] = 0x10, -- dblarrowheadright     \twoheadrightarrow
489    [0x0219E] = 0x11, -- dblarrowheadleft      \twoheadleftarrow
490    [0x021C7] = 0x12, -- dblarrowleft          \leftleftarrows
491    [0x021C9] = 0x13, -- dblarrowright         \rightrightarrows
492    [0x021C8] = 0x14, -- dblarrowup            \upuparrows
493    [0x021CA] = 0x15, -- dblarrowdwn           \downdownarrows
494    [0x021BE] = 0x16, -- harpoonupright        \upharpoonright \restriction
495    [0x021C2] = 0x17, -- harpoondownright      \downharpoonright
496    [0x021BF] = 0x18, -- harpoonupleft         \upharpoonleft
497    [0x021C3] = 0x19, -- harpoondownleft       \downharpoonleft
498    [0x021A3] = 0x1A, -- arrowtailright        \rightarrowtail
499    [0x021A2] = 0x1B, -- arrowtailleft         \leftarrowtail
500    [0x021C6] = 0x1C, -- arrowparrleftright    \leftrightarrows
501--  [0x021C5] = 0x00, --                       \updownarrows (missing in lm)
502    [0x021C4] = 0x1D, -- arrowparrrightleft    \rightleftarrows
503    [0x021B0] = 0x1E, -- shiftleft             \Lsh
504    [0x021B1] = 0x1F, -- shiftright            \Rsh
505    [0x021DD] = 0x20, -- squiggleright         \leadsto \rightsquigarrow
506    [0x021AD] = 0x21, -- squiggleleftright     \leftrightsquigarrow
507    [0x021AB] = 0x22, -- curlyleft             \looparrowleft
508    [0x021AC] = 0x23, -- curlyright            \looparrowright
509    [0x02257] = 0x24, -- circleequal           \circeq
510    [0x0227F] = 0x25, -- followsorequal        \succsim
511    [0x02273] = 0x26, -- greaterorsimilar      \gtrsim
512    [0x02A86] = 0x27, -- greaterorapproxeql    \gtrapprox
513    [0x022B8] = 0x28, -- multimap              \multimap
514    [0x02234] = 0x29, -- therefore             \therefore
515    [0x02235] = 0x2A, -- because               \because
516    [0x02251] = 0x2B, -- equalsdots            \Doteq \doteqdot
517    [0x0225C] = 0x2C, -- defines               \triangleq
518    [0x0227E] = 0x2D, -- precedesorequal       \precsim
519    [0x02272] = 0x2E, -- lessorsimilar         \lesssim
520    [0x02A85] = 0x2F, -- lessorapproxeql       \lessapprox
521    [0x02A95] = 0x30, -- equalorless           \eqslantless
522    [0x02A96] = 0x31, -- equalorgreater        \eqslantgtr
523    [0x022DE] = 0x32, -- equalorprecedes       \curlyeqprec
524    [0x022DF] = 0x33, -- equalorfollows        \curlyeqsucc
525    [0x0227C] = 0x34, -- precedesorcurly       \preccurlyeq
526    [0x02266] = 0x35, -- lessdblequal          \leqq
527    [0x02A7D] = 0x36, -- lessorequalslant      \leqslant
528    [0x02276] = 0x37, -- lessorgreater         \lessgtr
529    [0x02035] = 0x38, -- primereverse          \backprime
530    --  [0x0] = 0x39, -- axisshort             \dabar
531    [0x02253] = 0x3A, -- equaldotrightleft     \risingdotseq
532    [0x02252] = 0x3B, -- equaldotleftright     \fallingdotseq
533    [0x0227D] = 0x3C, -- followsorcurly        \succcurlyeq
534    [0x02267] = 0x3D, -- greaterdblequal       \geqq
535    [0x02A7E] = 0x3E, -- greaterorequalslant   \geqslant
536    [0x02277] = 0x3F, -- greaterorless         \gtrless
537    [0x0228F] = 0x40, -- squareimage           \sqsubset
538    [0x02290] = 0x41, -- squareoriginal        \sqsupset
539    -- wrong: see **
540 -- [0x022B3] = 0x42, -- triangleright         \rhd \vartriangleright
541 -- [0x022B2] = 0x43, -- triangleleft          \lhd \vartriangleleft
542    -- cf lm
543    [0x022B5] = 0x44, -- trianglerightequal    \unrhd \trianglerighteq
544    [0x022B4] = 0x45, -- triangleleftequal     \unlhd \trianglelefteq
545    --
546    [0x02605] = 0x46, -- star                  \bigstar
547    [0x0226C] = 0x47, -- between               \between
548    [0x025BC] = 0x48, -- triangledownsld       \blacktriangledown
549    [0x025B6] = 0x49, -- trianglerightsld      \blacktriangleright
550    [0x025C0] = 0x4A, -- triangleleftsld       \blacktriangleleft
551    --  [0x0] = 0x4B, -- arrowaxisright
552    --  [0x0] = 0x4C, -- arrowaxisleft
553    [0x025B2] = 0x4D, -- triangle              \triangleup \vartriangle
554    [0x025B2] = 0x4E, -- trianglesolid         \blacktriangle
555    [0x025BD] = 0x4F, -- triangleinv           \triangledown
556    [0x02256] = 0x50, -- ringinequal           \eqcirc
557    [0x022DA] = 0x51, -- lessequalgreater      \lesseqgtr
558    [0x022DB] = 0x52, -- greaterlessequal      \gtreqless
559    [0x02A8B] = 0x53, -- lessdbleqlgreater     \lesseqqgtr
560    [0x02A8C] = 0x54, -- greaterdbleqlless     \gtreqqless
561    [0x000A5] = 0x55, -- Yen                   \yen
562    [0x021DB] = 0x56, -- arrowtripleright      \Rrightarrow
563    [0x021DA] = 0x57, -- arrowtripleleft       \Lleftarrow
564    [0x02713] = 0x58, -- check                 \checkmark
565    [0x022BB] = 0x59, -- orunderscore          \veebar
566    [0x022BC] = 0x5A, -- nand                  \barwedge
567    [0x02306] = 0x5B, -- perpcorrespond        \doublebarwedge
568    [0x02220] = 0x5C, -- angle                 \angle
569    [0x02221] = 0x5D, -- measuredangle         \measuredangle
570    [0x02222] = 0x5E, -- sphericalangle        \sphericalangle
571    --  [0x0] = 0x5F, -- proportional          \varpropto
572    --  [0x0] = 0x60, -- smile                 \smallsmile
573    --  [0x0] = 0x61, -- frown                 \smallfrown
574    [0x022D0] = 0x62, -- subsetdbl             \Subset
575    [0x022D1] = 0x63, -- supersetdbl           \Supset
576    [0x022D3] = 0x64, -- uniondbl              \doublecup \Cup
577    [0x022D2] = 0x65, -- intersectiondbl       \doublecap \Cap
578    [0x022CF] = 0x66, -- uprise                \curlywedge
579    [0x022CE] = 0x67, -- downfall              \curlyvee
580    [0x022CB] = 0x68, -- multiopenleft         \leftthreetimes
581    [0x022CC] = 0x69, -- multiopenright        \rightthreetimes
582    [0x02AC5] = 0x6A, -- subsetdblequal        \subseteqq
583    [0x02AC6] = 0x6B, -- supersetdblequal      \supseteqq
584    [0x0224F] = 0x6C, -- difference            \bumpeq
585    [0x0224E] = 0x6D, -- geomequivalent        \Bumpeq
586    [0x022D8] = 0x6E, -- muchless              \lll \llless
587    [0x022D9] = 0x6F, -- muchgreater           \ggg \gggtr
588    [0x0231C] = 0x70, -- rightanglenw          \ulcorner
589    [0x0231D] = 0x71, -- rightanglene          \urcorner
590    [0x024C7] = 0x72, -- circleR               \circledR
591    [0x024C8] = 0x73, -- circleS               \circledS
592    [0x022D4] = 0x74, -- fork                  \pitchfork
593    [0x02214] = 0x75, -- dotplus               \dotplus
594    [0x0223D] = 0x76, -- revsimilar            \backsim
595    [0x022CD] = 0x77, -- revasymptequal        \backsimeq -- AM: Check this! I mapped it to simeq.
596    [0x0231E] = 0x78, -- rightanglesw          \llcorner
597    [0x0231F] = 0x79, -- rightanglese          \lrcorner
598    [0x02720] = 0x7A, -- maltesecross          \maltese
599    [0x02201] = 0x7B, -- complement            \complement
600    [0x022BA] = 0x7C, -- intercal              \intercal
601    [0x0229A] = 0x7D, -- circlering            \circledcirc
602    [0x0229B] = 0x7E, -- circleasterisk        \circledast
603    [0x0229D] = 0x7F, -- circleminus           \circleddash
604}
605
606mathencodings["tex-mb"] = {
607    --  [0x0] = 0x00, -- lessornotequal        \lvertneqq
608    --  [0x0] = 0x01, -- greaterornotequal     \gvertneqq
609    [0x02270] = 0x02, -- notlessequal          \nleq
610    [0x02271] = 0x03, -- notgreaterequal       \ngeq
611    [0x0226E] = 0x04, -- notless               \nless
612    [0x0226F] = 0x05, -- notgreater            \ngtr
613    [0x02280] = 0x06, -- notprecedes           \nprec
614    [0x02281] = 0x07, -- notfollows            \nsucc
615    [0x02268] = 0x08, -- lessornotdbleql       \lneqq
616    [0x02269] = 0x09, -- greaterornotdbleql    \gneqq
617    --  [0x0] = 0x0A, -- notlessorslnteql      \nleqslant
618    --  [0x0] = 0x0B, -- notgreaterorslnteql   \ngeqslant
619    [0x02A87] = 0x0C, -- lessnotequal          \lneq
620    [0x02A88] = 0x0D, -- greaternotequal       \gneq
621    --  [0x0] = 0x0E, -- notprecedesoreql      \npreceq
622    --  [0x0] = 0x0F, -- notfollowsoreql       \nsucceq
623    [0x022E8] = 0x10, -- precedeornoteqvlnt    \precnsim
624    [0x022E9] = 0x11, -- followornoteqvlnt     \succnsim
625    [0x022E6] = 0x12, -- lessornotsimilar      \lnsim
626    [0x022E7] = 0x13, -- greaterornotsimilar   \gnsim
627    --  [0x0] = 0x14, -- notlessdblequal       \nleqq
628    --  [0x0] = 0x15, -- notgreaterdblequal    \ngeqq
629    [0x02AB5] = 0x16, -- precedenotslnteql     \precneqq
630    [0x02AB6] = 0x17, -- follownotslnteql      \succneqq
631    [0x02AB9] = 0x18, -- precedenotdbleqv      \precnapprox
632    [0x02ABA] = 0x19, -- follownotdbleqv       \succnapprox
633    [0x02A89] = 0x1A, -- lessnotdblequal       \lnapprox
634    [0x02A8A] = 0x1B, -- greaternotdblequal    \gnapprox
635    [0x02241] = 0x1C, -- notsimilar            \nsim
636    [0x02247] = 0x1D, -- notapproxequal        \ncong
637    --  [0x0] = 0x1E, -- upslope               \diagup
638    --  [0x0] = 0x1F, -- downslope             \diagdown
639    --  [0x0] = 0x20, -- notsubsetoreql        \varsubsetneq
640    --  [0x0] = 0x21, -- notsupersetoreql      \varsupsetneq
641    --  [0x0] = 0x22, -- notsubsetordbleql     \nsubseteqq
642    --  [0x0] = 0x23, -- notsupersetordbleql   \nsupseteqq
643    [0x02ACB] = 0x24, -- subsetornotdbleql     \subsetneqq
644    [0x02ACC] = 0x25, -- supersetornotdbleql   \supsetneqq
645    --  [0x0] = 0x26, -- subsetornoteql        \varsubsetneqq
646    --  [0x0] = 0x27, -- supersetornoteql      \varsupsetneqq
647    [0x0228A] = 0x28, -- subsetnoteql          \subsetneq
648    [0x0228B] = 0x29, -- supersetnoteql        \supsetneq
649    [0x02288] = 0x2A, -- notsubseteql          \nsubseteq
650    [0x02289] = 0x2B, -- notsuperseteql        \nsupseteq
651    [0x02226] = 0x2C, -- notparallel           \nparallel
652    [0x02224] = 0x2D, -- notbar                \nmid \ndivides
653    --  [0x0] = 0x2E, -- notshortbar           \nshortmid
654    --  [0x0] = 0x2F, -- notshortparallel      \nshortparallel
655    [0x022AC] = 0x30, -- notturnstile          \nvdash
656    [0x022AE] = 0x31, -- notforces             \nVdash
657    [0x022AD] = 0x32, -- notsatisfies          \nvDash
658    [0x022AF] = 0x33, -- notforcesextra        \nVDash
659    [0x022ED] = 0x34, -- nottriangeqlright     \ntrianglerighteq
660    [0x022EC] = 0x35, -- nottriangeqlleft      \ntrianglelefteq
661    [0x022EA] = 0x36, -- nottriangleleft       \ntriangleleft
662    [0x022EB] = 0x37, -- nottriangleright      \ntriangleright
663    [0x0219A] = 0x38, -- notarrowleft          \nleftarrow
664    [0x0219B] = 0x39, -- notarrowright         \nrightarrow
665    [0x021CD] = 0x3A, -- notdblarrowleft       \nLeftarrow
666    [0x021CF] = 0x3B, -- notdblarrowright      \nRightarrow
667    [0x021CE] = 0x3C, -- notdblarrowboth       \nLeftrightarrow
668    [0x021AE] = 0x3D, -- notarrowboth          \nleftrightarrow
669    [0x022C7] = 0x3E, -- dividemultiply        \divideontimes
670    [0x02300] = 0x3F, -- diametersign          \varnothing
671    [0x02204] = 0x40, -- notexistential        \nexists
672    [0x1D538] = 0x41, -- A                     (blackboard A)
673    [0x1D539] = 0x42, -- B
674    [0x02102] = 0x43, -- C
675    [0x1D53B] = 0x44, -- D
676    [0x1D53C] = 0x45, -- E
677    [0x1D53D] = 0x46, -- F
678    [0x1D53E] = 0x47, -- G
679    [0x0210D] = 0x48, -- H
680    [0x1D540] = 0x49, -- I
681    [0x1D541] = 0x4A, -- J
682    [0x1D542] = 0x4B, -- K
683    [0x1D543] = 0x4C, -- L
684    [0x1D544] = 0x4D, -- M
685    [0x02115] = 0x4E, -- N
686    [0x1D546] = 0x4F, -- O
687    [0x02119] = 0x50, -- P
688    [0x0211A] = 0x51, -- Q
689    [0x0211D] = 0x52, -- R
690    [0x1D54A] = 0x53, -- S
691    [0x1D54B] = 0x54, -- T
692    [0x1D54C] = 0x55, -- U
693    [0x1D54D] = 0x56, -- V
694    [0x1D54E] = 0x57, -- W
695    [0x1D54F] = 0x58, -- X
696    [0x1D550] = 0x59, -- Y
697    [0x02124] = 0x5A, -- Z                     (blackboard Z)
698    [0x02132] = 0x60, -- finv                  \Finv
699    [0x02141] = 0x61, -- fmir                  \Game
700    --  [0x0] = 0x62,    tildewide
701    --  [0x0] = 0x63,    tildewider
702    --  [0x0] = 0x64,    Finv
703    --  [0x0] = 0x65,    Gmir
704    [0x02127] = 0x66, -- Omegainv              \mho
705    [0x000F0] = 0x67, -- eth                   \eth
706    [0x02242] = 0x68, -- equalorsimilar        \eqsim
707    [0x02136] = 0x69, -- beth                  \beth
708    [0x02137] = 0x6A, -- gimel                 \gimel
709    [0x02138] = 0x6B, -- daleth                \daleth
710    [0x022D6] = 0x6C, -- lessdot               \lessdot
711    [0x022D7] = 0x6D, -- greaterdot            \gtrdot
712    [0x022C9] = 0x6E, -- multicloseleft        \ltimes
713    [0x022CA] = 0x6F, -- multicloseright       \rtimes
714    --  [0x0] = 0x70, -- barshort              \shortmid
715    --  [0x0] = 0x71, -- parallelshort         \shortparallel
716    --  [0x02216] = 0x72, -- integerdivide         \smallsetminus (2216 already part of tex-sy
717    --  [0x0] = 0x73, -- similar               \thicksim
718    --  [0x0] = 0x74, -- approxequal           \thickapprox
719    [0x0224A] = 0x75, -- approxorequal         \approxeq
720    [0x02AB8] = 0x76, -- followsorequal        \succapprox
721    [0x02AB7] = 0x77, -- precedesorequal       \precapprox
722    [0x021B6] = 0x78, -- archleftdown          \curvearrowleft
723    [0x021B7] = 0x79, -- archrightdown         \curvearrowright
724    [0x003DC] = 0x7A, -- Digamma               \digamma
725    [0x003F0] = 0x7B, -- kappa                 \varkappa
726    [0x1D55C] = 0x7C, -- k                     \Bbbk (blackboard k)
727    [0x0210F] = 0x7D, -- planckover2pi         \hslash % 0x7D
728    [0x00127] = 0x7E, -- planckover2pi1        \hbar   % 0x7E
729    [0x003F6] = 0x7F, -- epsiloninv            \backepsilon
730}
731
732mathencodings["tex-mc"] = {
733    -- this file has no tfm so it gets mapped in the private space
734    [0xFE324] = "mapsfromchar",
735}
736
737mathencodings["tex-fraktur"] = {
738--  [0x1D504] = 0x41, -- A                     (fraktur A)
739--  [0x1D505] = 0x42, -- B
740    [0x0212D] = 0x43, -- C
741--  [0x1D507] = 0x44, -- D
742--  [0x1D508] = 0x45, -- E
743--  [0x1D509] = 0x46, -- F
744--  [0x1D50A] = 0x47, -- G
745    [0x0210C] = 0x48, -- H
746    [0x02111] = 0x49, -- I
747--  [0x1D50D] = 0x4A, -- J
748--  [0x1D50E] = 0x4B, -- K
749--  [0x1D50F] = 0x4C, -- L
750--  [0x1D510] = 0x4D, -- M
751--  [0x1D511] = 0x4E, -- N
752--  [0x1D512] = 0x4F, -- O
753--  [0x1D513] = 0x50, -- P
754--  [0x1D514] = 0x51, -- Q
755    [0x0211C] = 0x52, -- R
756--  [0x1D516] = 0x53, -- S
757--  [0x1D517] = 0x54, -- T
758--  [0x1D518] = 0x55, -- U
759--  [0x1D519] = 0x56, -- V
760--  [0x1D51A] = 0x57, -- W
761--  [0x1D51B] = 0x58, -- X
762--  [0x1D51C] = 0x59, -- Y
763    [0x02128] = 0x5A, -- Z                     (fraktur Z)
764--  [0x1D51E] = 0x61, -- a                     (fraktur a)
765--  [0x1D51F] = 0x62, -- b
766--  [0x1D520] = 0x63, -- c
767--  [0x1D521] = 0x64, -- d
768--  [0x1D522] = 0x65, -- e
769--  [0x1D523] = 0x66, -- f
770--  [0x1D524] = 0x67, -- g
771--  [0x1D525] = 0x68, -- h
772--  [0x1D526] = 0x69, -- i
773--  [0x1D527] = 0x6A, -- j
774--  [0x1D528] = 0x6B, -- k
775--  [0x1D529] = 0x6C, -- l
776--  [0x1D52A] = 0x6D, -- m
777--  [0x1D52B] = 0x6E, -- n
778--  [0x1D52C] = 0x6F, -- o
779--  [0x1D52D] = 0x70, -- p
780--  [0x1D52E] = 0x71, -- q
781--  [0x1D52F] = 0x72, -- r
782--  [0x1D530] = 0x73, -- s
783--  [0x1D531] = 0x74, -- t
784--  [0x1D532] = 0x75, -- u
785--  [0x1D533] = 0x76, -- v
786--  [0x1D534] = 0x77, -- w
787--  [0x1D535] = 0x78, -- x
788--  [0x1D536] = 0x79, -- y
789--  [0x1D537] = 0x7A, -- z
790}
791
792-- now that all other vectors are defined ...
793
794setletters(mathencodings, "tex-it",           0x1D434, 0x1D44E)
795setletters(mathencodings, "tex-ss",           0x1D5A0, 0x1D5BA)
796setletters(mathencodings, "tex-tt",           0x1D670, 0x1D68A)
797setletters(mathencodings, "tex-bf",           0x1D400, 0x1D41A)
798setletters(mathencodings, "tex-bi",           0x1D468, 0x1D482)
799setletters(mathencodings, "tex-fraktur",      0x1D504, 0x1D51E)
800setletters(mathencodings, "tex-fraktur-bold", 0x1D56C, 0x1D586)
801
802setdigits (mathencodings, "tex-ss", 0x1D7E2)
803setdigits (mathencodings, "tex-tt", 0x1D7F6)
804setdigits (mathencodings, "tex-bf", 0x1D7CE)
805
806-- setdigits (mathencodings, "tex-bi", 0x1D7CE)
807
808-- todo: add ss, tt, bf etc vectors
809-- todo: we can make ss tt etc an option
810