diff --git a/luamml-amsmath.lua b/luamml-amsmath.lua index 1e961c4..e383d12 100644 --- a/luamml-amsmath.lua +++ b/luamml-amsmath.lua @@ -70,7 +70,7 @@ lua.get_functions_table()[funcid] = function() if not mml_table then return end 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('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) end diff --git a/luamml-convert.lua b/luamml-convert.lua index ab83c94..d120534 100644 --- a/luamml-convert.lua +++ b/luamml-convert.lua @@ -376,10 +376,14 @@ function nodes_to_table(head, cur_style) end nonscript = nil if core and new_core ~= space_like then - core = new_core + core = core == space_like and new_core or nil end mn = new_mn end + -- In TeX, groups are never space like + if core == space_like then + result[#result+1] = {[0] = 'mi', intent = '@ignore'} + end if t[0] == 'mrow' and #t == 1 then assert(t == result) result = t[1] diff --git a/test_tex.tex b/test_tex.tex index 90f3d7e..8a00fc5 100644 --- a/test_tex.tex +++ b/test_tex.tex @@ -25,7 +25,7 @@ \] \begin{align} - abc&=def\\ + abc&=def & e^{\mathrm{i}\pi}&=-1\\ 1+2&=3\\ 5 \end{align}