Better support \mathord and less unnecessary mrows
This commit is contained in:
parent
23c6714e97
commit
1ab153ed8a
@ -110,6 +110,10 @@ local function noad_to_table(noad, sub, cur_style)
|
|||||||
local class = noad_sub[sub]
|
local class = noad_sub[sub]
|
||||||
local nucleus, core = kernel_to_table(noad.nucleus, class == 'over' and cur_style//2*2+1 or cur_style)
|
local nucleus, core = kernel_to_table(noad.nucleus, class == 'over' and cur_style//2*2+1 or cur_style)
|
||||||
if class == 'ord' then
|
if class == 'ord' then
|
||||||
|
if core and core[0] == 'mo' then
|
||||||
|
core[0] = 'mi'
|
||||||
|
core.stretchy, core.mathvariant = nil, #core == 1 and type(core[0]) and utf8.len(core[0]) == 1 and utf8.codepoint(core[0]) < -0x10000 and 'normal' or nil
|
||||||
|
end
|
||||||
elseif class == 'opdisplaylimits' or class == 'oplimits' or class == 'opnolimits' or class == 'bin' or class == 'rel' or class == 'open'
|
elseif class == 'opdisplaylimits' or class == 'oplimits' or class == 'opnolimits' or class == 'bin' or class == 'rel' or class == 'open'
|
||||||
or class == 'close' or class == 'punct' or class == 'inner' then
|
or class == 'close' or class == 'punct' or class == 'inner' then
|
||||||
if not core or not core[0] then
|
if not core or not core[0] then
|
||||||
@ -306,6 +310,10 @@ function nodes_to_table(head, cur_style)
|
|||||||
core = new_core
|
core = new_core
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if t[0] == 'mrow' and #t == 1 then
|
||||||
|
assert(t == result)
|
||||||
|
result = t[1]
|
||||||
|
end
|
||||||
return result, core
|
return result, core
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user