add system-of-equation intent

This commit is contained in:
Ulrike Fischer 2025-02-23 19:58:39 +01:00
parent c83f29d906
commit 8b4e949008

View File

@ -67,10 +67,11 @@ do
lua.get_functions_table()[funcid] = function()
-- TODO: Error handling etc
local kind = token.scan_argument()
kind = kind:gsub("*","")
local mml_table = get_table()
if not mml_table then return end
mml_table.displaystyle = true
mml_table.class=kind:gsub("*","")
mml_table.class=kind
if kind=="split" then
add_intent_continued_row (mml_table)
end
@ -118,10 +119,15 @@ token.set_lua('__luamml_amsmath_finalize_table:n', funcid)
lua.get_functions_table()[funcid] = function()
-- TODO: Error handling etc
local kind = token.scan_argument()
kind = kind:gsub("*","")
local mml_table = get_table()
if not mml_table then return end
mml_table.displaystyle = true
mml_table.class=kind:gsub("*","")
mml_table.class=kind
-- this should perhaps be configurable and extendable
if kind == 'align' or 'alignat' or 'flalign' or 'xalignat' or 'xxalignat' then
mml_table.intent=":system-of-equation"
end
local columns = node.count(node.id'align_record', tex.lists.align_head)//2
mml_table.columnalign = kind == 'align' and 'left '..string.rep('right left', columns, ' ') or nil
mml_table.width = kind == 'multline' and '100%' or nil