Add \RegisterFamilyMapping

This commit is contained in:
Marcel Fabian Krüger 2021-06-06 06:15:57 +02:00
parent 948818c8bc
commit e0705c210b
2 changed files with 10 additions and 0 deletions

View File

@ -636,6 +636,7 @@ end
return { return {
register_family = register_remap, 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, process = function(head, style) return nodes_to_table(head, style or 2) end,
make_root = to_math, make_root = to_math,
} }

View File

@ -2,6 +2,7 @@ local mlist_to_mml = require'luamml-convert'
local process_mlist = mlist_to_mml.process local process_mlist = mlist_to_mml.process
local make_root = mlist_to_mml.make_root local make_root = mlist_to_mml.make_root
local register_family = mlist_to_mml.register_family 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 mappings = require'luamml-legacy-mappings'
local write_xml = require'luamml-xmlwriter' local write_xml = require'luamml-xmlwriter'
@ -23,6 +24,14 @@ lua.get_functions_table()[funcid] = function()
end end
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 function shallow_copy(t)
local tt = {} local tt = {}
for k,v in next, t do for k,v in next, t do