From 9e501b2d766bcbea42617b58d9b5cc41a5eb7c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Fabian=20Kr=C3=BCger?= Date: Tue, 22 Jun 2021 12:56:04 +0200 Subject: [PATCH] Don't try to tag \eqno elements --- luamml-tex.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/luamml-tex.lua b/luamml-tex.lua index 118e194..2581a7c 100644 --- a/luamml-tex.lua +++ b/luamml-tex.lua @@ -11,6 +11,17 @@ local write_struct = require'luamml-structelemwriter' local filename_token = token.create'l__luamml_filename_tl' local properties = node.get_properties_table() +local mmode, hmode, vmode do + local result, input = {}, tex.getmodevalues() + for k,v in next, tex.getmodevalues() do + if v == 'math' then mmode = k + elseif v == 'horizontal' then hmode = k + elseif v == 'vertical' then vmode = k + else assert(v == 'unset') + end + end + assert(mmode and hmode and vmode) +end local funcid = luatexbase.new_luafunction'RegisterFamilyMapping' token.set_lua('RegisterFamilyMapping', funcid, 'protected') @@ -76,6 +87,9 @@ local function save_result(xml, display, structelem) end luatexbase.add_to_callback('pre_mlist_to_hlist_filter', function(mlist, style) + if tex.nest.top.mode == mmode then -- This is a equation label generated with \eqno + return true + end local flag = tex.count.l__luamml_flag_int if flag & 3 == 0 then return true