@@ -280,8 +280,17 @@ local function isOperatorKind (tree, typeOfAtom, typeOfSymbol)
280280 return false
281281end
282282
283- local function isBigOperator (tree )
284- return isOperatorKind (tree , " big" , atomType .bigOperator )
283+ local function isMoveableLimits (tree )
284+ if tree .command ~= " mo" then
285+ return false
286+ end
287+ if tree .options and SU .boolean (tree .options .movablelimits , false ) then
288+ return true
289+ end
290+ if tree [1 ] and symbolDefaults [tree [1 ]] and SU .boolean (symbolDefaults [tree [1 ]].movablelimits , false ) then
291+ return true
292+ end
293+ return false
285294end
286295local function isCloseOperator (tree )
287296 return isOperatorKind (tree , " close" , atomType .closeSymbol )
@@ -414,13 +423,13 @@ local function compileToMathML_aux (_, arg_env, tree)
414423 tree .options = {}
415424 -- Translate TeX-like sub/superscripts to `munderover` or `msubsup`,
416425 -- depending on whether the base is a big operator
417- elseif tree .id == " sup" and isBigOperator (tree [1 ]) then
426+ elseif tree .id == " sup" and isMoveableLimits (tree [1 ]) then
418427 tree .command = " mover"
419- elseif tree .id == " sub" and isBigOperator (tree [1 ]) then
428+ elseif tree .id == " sub" and isMoveableLimits (tree [1 ]) then
420429 tree .command = " munder"
421- elseif tree .id == " subsup" and isBigOperator (tree [1 ]) then
430+ elseif tree .id == " subsup" and isMoveableLimits (tree [1 ]) then
422431 tree .command = " munderover"
423- elseif tree .id == " supsub" and isBigOperator (tree [1 ]) then
432+ elseif tree .id == " supsub" and isMoveableLimits (tree [1 ]) then
424433 tree .command = " munderover"
425434 local tmp = tree [2 ]
426435 tree [2 ] = tree [3 ]
@@ -589,20 +598,20 @@ compileToMathML(
589598 \def{bi}{\mi[mathvariant=bold-italic]{#1}}
590599 \def{dsi}{\mi[mathvariant=double-struck]{#1}}
591600
592- \def{lim}{\mo[atom=big ]{lim}}
601+ \def{lim}{\mo[movablelimits=true ]{lim}}
593602
594603 % From amsmath:
595604 \def{to}{\mo[atom=bin]{→}}
596- \def{gcd}{\mo[atom=big ]{gcd}}
597- \def{sup}{\mo[atom=big ]{sup}}
598- \def{inf}{\mo[atom=big ]{inf}}
599- \def{max}{\mo[atom=big ]{max}}
600- \def{min}{\mo[atom=big ]{min}}
605+ \def{gcd}{\mo[movablelimits=true ]{gcd}}
606+ \def{sup}{\mo[movablelimits=true ]{sup}}
607+ \def{inf}{\mo[movablelimits=true ]{inf}}
608+ \def{max}{\mo[movablelimits=true ]{max}}
609+ \def{min}{\mo[movablelimits=true ]{min}}
601610 % Those use U+202F NARROW NO-BREAK SPACE in their names
602- \def{limsup}{\mo[atom=big ]{lim sup}}
603- \def{liminf}{\mo[atom=big ]{lim inf}}
604- \def{projlim}{\mo[atom=big ]{proj lim}}
605- \def{injlim}{\mo[atom=big ]{inj lim}}
611+ \def{limsup}{\mo[movablelimits=true ]{lim sup}}
612+ \def{liminf}{\mo[movablelimits=true ]{lim inf}}
613+ \def{projlim}{\mo[movablelimits=true ]{proj lim}}
614+ \def{injlim}{\mo[movablelimits=true ]{inj lim}}
606615
607616 % Standard spaces gleaned from plain TeX
608617 \def{thinspace}{\mspace[width=thin]}
0 commit comments