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