diff options
author | Hans Hagen <pragma@wxs.nl> | 2022-11-14 23:18:10 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2022-11-14 23:18:10 +0100 |
commit | 08473f11287cb263079c0435068312cbc6d736e8 (patch) | |
tree | 2548fb8b58e18a507e54fa8426a79c6956c3ef2e /tex/context/base/mkxl/math-map.lmt | |
parent | dd0a80e5ec42f60832e7d5dc47210e6f3545c400 (diff) | |
download | context-08473f11287cb263079c0435068312cbc6d736e8.tar.gz |
2022-11-14 22:56:00
Diffstat (limited to 'tex/context/base/mkxl/math-map.lmt')
-rw-r--r-- | tex/context/base/mkxl/math-map.lmt | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/tex/context/base/mkxl/math-map.lmt b/tex/context/base/mkxl/math-map.lmt index d0a1410a1..98cc59c89 100644 --- a/tex/context/base/mkxl/math-map.lmt +++ b/tex/context/base/mkxl/math-map.lmt @@ -46,6 +46,8 @@ local setmetatableindex = table.setmetatableindex local texgetattribute = tex.getattribute local texsetattribute = tex.setattribute +local setmacro = tokens.setters.macro + local texgetmode = tex.getmode local mathmode_code = tex.modelevels.math @@ -711,9 +713,19 @@ implement { protected = true, actions = function(alphabet,style) if texgetmode() == mathmode_code then - local data = alphabets[alphabet] or regular - data = data[style] or data.tf - texsetattribute(mathalphabet,data and data.attribute or texattribute[mathalphabet]) + local data = alphabets[alphabet] + if not data then + alphabet = "regular" + data = regular + end + local used = data[style] + if not used then + style = "tf" + used = data.tf + end + setmacro("currentmathalphabet",alphabet == "regular" and "rm" or alphabet) + setmacro("currentmathfontstyle",style) + texsetattribute(mathalphabet,used and used.attribute or texattribute[mathalphabet]) end end } @@ -728,6 +740,7 @@ implement { local r = mathremap[texgetattribute(mathalphabet)] local alphabet = r and r.alphabet or "regular" local data = alphabets[alphabet][style] + setmacro("currentmathfontstyle",style) texsetattribute(mathalphabet,data and data.attribute or texattribute[mathalphabet]) end end |