= The last case does not have the sup part above the operator.
Analysis
The math package code is insane and poorly commented, sorry to say.
Yet a line for the sup-only case (which differs from the sub-only case) looks dubious:
diff --git a/packages/math/texlike.lua b/packages/math/texlike.lua
index 5d1073fe..5abb03c6 100644
--- a/packages/math/texlike.lua
+++ b/packages/math/texlike.lua
@@ -328,7 +328,7 @@ local function compileToMathML_aux (_, arg_env, tree)
tree.options = {}
-- Translate TeX-like sub/superscripts to `munderover` or `msubsup`,
-- depending on whether the base is a big operator
- elseif tree.id == "sup" and tree[1].command == "mo" and tree[1].atom == atomType.bigOperator then
+ elseif tree.id == "sup" and tree[1].command == "mo" and symbolDefaults[tree[1][1]].atom == atomType.bigOperator then
tree.command = "mover"
elseif tree.id == "sub" and tree[1].command == "mo" and symbolDefaults[tree[1][1]].atom == atomType.bigOperator then
tree.command = "munder"
And with the shown change, yay! (EDIT but see comment, I was a bit too naive here)
Input
Formula in TeX-like syntax:
I.e. large operator, with (1) both sup and sub elements, (2) only sub elements, (3) only sup elements.
Expected
As obtained on https://latexeditor.lagrida.com/ and also https://saxarona.github.io/mathjax-viewer/
Observed
= The last case does not have the sup part above the operator.
Analysis
The math package code is insane and poorly commented, sorry to say. Yet a line for the sup-only case (which differs from the sub-only case) looks dubious:
And with the shown change, yay! (EDIT but see comment, I was a bit too naive here)
Dear math-aware friends, what do you think?