diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-08-09 16:31:10 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-08-09 16:31:10 +0200 |
commit | 35268d29183ddf3b28ecc224ee7c8edfa7673fb2 (patch) | |
tree | 870dd65fd4c79a83137466c198a7b780014b9b6b /tex/context/modules/mkiv/s-math-ligatures.lua | |
parent | 58574b14679ae5796ea24a506ba27faf838c10ba (diff) | |
download | context-35268d29183ddf3b28ecc224ee7c8edfa7673fb2.tar.gz |
2017-08-09 15:43:00
Diffstat (limited to 'tex/context/modules/mkiv/s-math-ligatures.lua')
-rw-r--r-- | tex/context/modules/mkiv/s-math-ligatures.lua | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/tex/context/modules/mkiv/s-math-ligatures.lua b/tex/context/modules/mkiv/s-math-ligatures.lua new file mode 100644 index 000000000..16fe0c4bc --- /dev/null +++ b/tex/context/modules/mkiv/s-math-ligatures.lua @@ -0,0 +1,71 @@ +if not modules then modules = { } end modules['s-math-ligatures'] = { + version = 1.001, + comment = "companion to s-math-ligatures.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +moduledata.math = moduledata.math or { } +moduledata.math.ligatures = moduledata.math.ligatures or { } + +local context = context + +local utfchar = utf.char +local uformat = string.formatters["%U"] + +function moduledata.math.ligatures.showlist(specification) + -- specification = interfaces.checkedspecification(specification) + + local function setlist(unicode,list,start,v) + if list[start] ~= 0x20 then + local t, u = { }, { } + for i=start,#list do + local li = list[i] + t[#t+1] = utfchar(li) + u[#u+1] = uformat(li) + end + context.NC() context("%U",unicode) + context.NC() context("%c",unicode) + context.NC() context("% t",u) + context.NC() context("%t",t) + context.NC() context("%t",t) + context.NC() + context.nohyphens() + context.veryraggedright() + local n = v.mathname + if n then + context.tex(n) + else + local c = v.mathspec + if c then + for i=1,#c do + local n = c[i].name + if n then + context.tex(n) + context.quad() + end + end + end + end + context.NC() + context.NR() + end + end + + context.starttabulate { "|T|m|T|T|m|pl|" } + for unicode, v in table.sortedhash(characters.data) do + local vs = v.specials + if vs and #vs > 2 then + local kind = vs[1] + if (v.mathclass or v.mathspec) and (kind == "char" or kind == "compat") then + setlist(unicode,vs,2,v) + end + end + local ml = v.mathlist + if ml then + setlist(unicode,ml,1,v) + end + end + context.stoptabulate() +end |