File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -732,8 +732,25 @@ local function isNotEmpty (element)
732732 return element and (element :is_a (elements .terminal ) or # element .children > 0 )
733733end
734734
735+ local function unwrapSingleElementMrow (elt )
736+ -- CODE SMELL.
737+ -- For \overset or \underset in LaTeX, MathML would use <mover> or <munder>.
738+ -- It would need to inherit the base's atom type, especially if the later is an operator
739+ -- (binary, relational etc.), which is a fairly common case, e.g.
740+ -- \overset{R}{=} (equality with a R above the equal in some Ramanujan summations),
741+ -- but we can't remove 1-element mrow's in the math typesetter, or have them inherit
742+ -- their base's atom type here above, because it breaks tables for some reasons
743+ -- that I couldn't figure out.
744+ if elt :is_a (elements .stackbox ) and elt .direction == " H" and # elt .children == 1 then
745+ return unwrapSingleElementMrow (elt .children [1 ])
746+ else
747+ return elt
748+ end
749+ end
750+
735751function elements .underOver :_init (base , sub , sup )
736752 elements .mbox ._init (self )
753+ base = unwrapSingleElementMrow (base )
737754 self .atom = base .atom
738755 self .base = base
739756 self .sub = isNotEmpty (sub ) and sub or nil
You can’t perform that action at this time.
0 commit comments