Skip to content

Commit b11a9b1

Browse files
committed
Handle movablelimits on TeXAtom of class OP in toMathML, NativeMML, and MathML input.
1 parent b69e0a6 commit b11a9b1

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

unpacked/extensions/toMathML.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () {
7878
var CLASS = []; if (this["class"]) {CLASS.push(this["class"])}
7979
if (this.isa(MML.TeXAtom) && SETTINGS.texHints) {
8080
var TEXCLASS = ["ORD","OP","BIN","REL","OPEN","CLOSE","PUNCT","INNER","VCENTER"][this.texClass];
81-
if (TEXCLASS) {CLASS.push("MJX-TeXAtom-"+TEXCLASS)}
81+
if (TEXCLASS) {
82+
CLASS.push("MJX-TeXAtom-"+TEXCLASS)
83+
if (TEXCLASS === "OP" && !this.movablelimits) CLASS.push("MJX-fixedlimits");
84+
}
8285
}
8386
if (this.mathvariant && this.toMathMLvariants[this.mathvariant])
8487
{CLASS.push("MJX"+this.mathvariant)}

unpacked/jax/input/MathML/jax.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
var mml, type = node.nodeName.toLowerCase().replace(/^[a-z]+:/,"");
7777
var match = (CLASS.match(/(^| )MJX-TeXAtom-([^ ]*)/));
7878
if (match) {
79-
mml = this.TeXAtom(match[2]);
79+
mml = this.TeXAtom(match[2],!CLASS.match(/MJX-fixedlimits/));
8080
} else if (!(MML[type] && MML[type].isa && MML[type].isa(MML.mbase))) {
8181
MathJax.Hub.signal.Post(["MathML Jax - unknown node type",type]);
8282
return MML.Error(_("UnknownNodeType","Unknown node type: %1",type));
@@ -88,9 +88,9 @@
8888
if (MATHML.config.useMathMLspacing) {mml.useMMLspacing = 0x08}
8989
return mml;
9090
},
91-
TeXAtom: function (mclass) {
91+
TeXAtom: function (mclass,movablelimits) {
9292
var mml = MML.TeXAtom().With({texClass:MML.TEXCLASS[mclass]});
93-
if (mml.texClass === MML.TEXCLASS.OP) {mml.movesupsub = mml.movablelimits = true}
93+
if (movablelimits) {mml.movesupsub = mml.movablelimits = true}
9494
return mml;
9595
},
9696
CheckClass: function (mml,CLASS) {

unpacked/jax/output/NativeMML/jax.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,10 @@
533533
var CLASS = []; if (this["class"]) {CLASS.push(this["class"])}
534534
if (this.isa(MML.TeXAtom)) {
535535
var TEXCLASS = ["ORD","OP","BIN","REL","OPEN","CLOSE","PUNCT","INNER","VCENTER"][this.texClass];
536-
if (TEXCLASS) {CLASS.push("MJX-TeXAtom-"+TEXCLASS)}
536+
if (TEXCLASS) {
537+
CLASS.push("MJX-TeXAtom-"+TEXCLASS)
538+
if (TEXCLASS === "OP" && !this.movablelimits) CLASS.push("MJX-fixedlimits");
539+
}
537540
}
538541
if (this.mathvariant && this.NativeMMLvariants[this.mathvariant])
539542
{CLASS.push("MJX"+this.mathvariant)}

0 commit comments

Comments
 (0)