From e0705c210b8516320e944b3327b30a4ee8e736ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Fabian=20Kr=C3=BCger?= Date: Sun, 6 Jun 2021 06:15:57 +0200 Subject: [PATCH] Add \RegisterFamilyMapping --- luamml-convert.lua | 1 + luamml-tex.lua | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/luamml-convert.lua b/luamml-convert.lua index f675339..a90f779 100644 --- a/luamml-convert.lua +++ b/luamml-convert.lua @@ -636,6 +636,7 @@ end return { register_family = register_remap, + register_text_family = function(fam) text_families[fam] = true end, process = function(head, style) return nodes_to_table(head, style or 2) end, make_root = to_math, } diff --git a/luamml-tex.lua b/luamml-tex.lua index 4febba1..b69be9b 100644 --- a/luamml-tex.lua +++ b/luamml-tex.lua @@ -2,6 +2,7 @@ local mlist_to_mml = require'luamml-convert' local process_mlist = mlist_to_mml.process local make_root = mlist_to_mml.make_root local register_family = mlist_to_mml.register_family +local register_text_family = mlist_to_mml.register_text_family local mappings = require'luamml-legacy-mappings' local write_xml = require'luamml-xmlwriter' @@ -23,6 +24,14 @@ lua.get_functions_table()[funcid] = function() end end +local funcid = luatexbase.new_luafunction'RegisterFamilyMapping' +token.set_lua('RegisterTextFamily', funcid, 'protected') +lua.get_functions_table()[funcid] = function() + local fam = token.scan_int() + local kind = token.scan_string() + register_text_family(fam, kind) +end + local function shallow_copy(t) local tt = {} for k,v in next, t do