tag rows with no tag with an empty mtd

This commit is contained in:
Ulrike Fischer 2025-02-08 11:40:49 +01:00
parent f8a3d35aa1
commit 398aa189fe
2 changed files with 12 additions and 4 deletions

View File

@ -3,6 +3,7 @@ local make_root = require'luamml-convert'.make_root
local save_result = require'luamml-tex'.save_result local save_result = require'luamml-tex'.save_result
local store_column = require'luamml-table'.store_column local store_column = require'luamml-table'.store_column
local store_tag = require'luamml-table'.store_tag local store_tag = require'luamml-table'.store_tag
local store_notag = require'luamml-table'.store_notag
local get_table = require'luamml-table'.get_table local get_table = require'luamml-table'.get_table
local set_row_attribute = require'luamml-table'.set_row_attribute local set_row_attribute = require'luamml-table'.set_row_attribute
local to_text = require'luamml-lr' local to_text = require'luamml-lr'
@ -125,9 +126,9 @@ funcid = luatexbase.new_luafunction'__luamml_amsmath_set_tag:'
token.set_lua('__luamml_amsmath_set_tag:', funcid, 'protected') token.set_lua('__luamml_amsmath_set_tag:', funcid, 'protected')
lua.get_functions_table()[funcid] = function() lua.get_functions_table()[funcid] = function()
if not last_tag then if not last_tag then
texio.write_nl'WARNING: Tag extraction failed' store_notag({[0] = 'mtd',''})
return else
end
store_tag({[0] = 'mtd', last_tag}) store_tag({[0] = 'mtd', last_tag})
last_tag = nil last_tag = nil
end
end end

View File

@ -63,6 +63,12 @@ local function store_tag(xml)
last_tag = nil last_tag = nil
end end
local function store_notag(xml)
local mml_row = store_get_row()
xml.intent = ':noequationlabel'
table.insert(mml_row, 1, xml)
end
local function set_row_attribute(name, value) local function set_row_attribute(name, value)
local mml_row = store_get_row() local mml_row = store_get_row()
mml_row[name] = value mml_row[name] = value
@ -105,6 +111,7 @@ return {
store_column = store_column, store_column = store_column,
store_column_xml = store_column_xml, store_column_xml = store_column_xml,
store_tag = store_tag, store_tag = store_tag,
store_notag = store_notag,
set_row_attribute = set_row_attribute, set_row_attribute = set_row_attribute,
get_table = get_table, get_table = get_table,
} }