diff --git a/luamml-convert.lua b/luamml-convert.lua index bdd4684..51996d2 100644 --- a/luamml-convert.lua +++ b/luamml-convert.lua @@ -273,7 +273,7 @@ local function noad_to_table(noad, sub, cur_style, joining, bin_replacements, te end if nucleus == core and #core == 1 then if joining and joining[0] == 'mn' and core[0] == 'mi' and (core[1] == '.' or core[1] == ',') and maybe_to_mn(noad, core) - or core[0] == 'mn' or text_families[core['tex:family']] then + or core[0] == 'mn' or text_families[core['tex:family'] or 0] then if joining and core[0] == joining[0] and core['tex:family'] == joining['tex:family'] then joining[#joining+1] = core[1] local cnodes = core[':nodes'] diff --git a/luamml-tex.lua b/luamml-tex.lua index a399db4..d6cee83 100644 --- a/luamml-tex.lua +++ b/luamml-tex.lua @@ -24,7 +24,7 @@ local text_families_meta = {__index = function(t, fam) -- FIXME(?): If there is no font... error'Please load your fonts?!?' end - assignment = not fontdir.MathConstants + assignment = not (fontdir.MathConstants and next(fontdir.MathConstants)) end t[fam] = assignment return assignment @@ -50,6 +50,9 @@ lua.get_functions_table()[funcid] = function() local mapping = token.scan_string() if mappings[mapping] then register_family(fam, mappings[mapping]) + if global_text_families[fam] == nil then + global_text_families[fam] = false + end else tex.error(string.format('Unknown font mapping %q', mapping)) end