Fix align spacing

This commit is contained in:
Marcel Fabian Krüger 2021-04-27 01:47:42 +02:00
parent 040f29aeaa
commit 372e43e165
3 changed files with 8 additions and 3 deletions

View File

@ -70,7 +70,7 @@ lua.get_functions_table()[funcid] = function()
if not mml_table then return end if not mml_table then return end
local columns = node.count(node.id'align_record', tex.lists.align_head)//2 local columns = node.count(node.id'align_record', tex.lists.align_head)//2
mml_table.columnalign = string.rep('right left', columns, ' ') mml_table.columnalign = string.rep('right left', columns, ' ')
mml_table.columnalign = string.rep('0.3em', columns, '0.8em ') -- FIXME: 0.3em is a hack needed since MathML doesn't add spacing for our empty mrow mml_table.columnspacing = string.rep('0', columns, ' 0.8em ') -- FIXME: 0.3em is a hack needed since MathML doesn't add spacing for our empty mrow
save_result(mml_table, 0) save_result(mml_table, 0)
end end

View File

@ -376,10 +376,15 @@ function nodes_to_table(head, cur_style)
end end
nonscript = nil nonscript = nil
if core and new_core ~= space_like then if core and new_core ~= space_like then
core = new_core core = core == space_like and new_core or nil
end end
mn = new_mn mn = new_mn
end end
-- In TeX, groups are never space like
if core == space_like then
core = {[0] = 'mi', intent = '@ignore'}
result[#result+1] = core
end
if t[0] == 'mrow' and #t == 1 then if t[0] == 'mrow' and #t == 1 then
assert(t == result) assert(t == result)
result = t[1] result = t[1]

View File

@ -25,7 +25,7 @@
\] \]
\begin{align} \begin{align}
abc&=def\\ abc&=def & e^{\mathrm{i}\pi}&=-1\\
1+2&=3\\ 1+2&=3\\
5 5
\end{align} \end{align}