diff --git a/unpacked/extensions/TeX/AMSmath.js b/unpacked/extensions/TeX/AMSmath.js index 44731cf17..9e7fc6d61 100644 --- a/unpacked/extensions/TeX/AMSmath.js +++ b/unpacked/extensions/TeX/AMSmath.js @@ -391,7 +391,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { bot = TEX.Parse(bot,this.stack.env).mml() mml.SetData(mml.under,MML.mpadded(bot).With(def).With({voffset:"-.24em"})); } - this.Push(mml); + this.Push(mml.With({subsupOK:true})); }, /* diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js index 377a961a9..fd9d33a28 100644 --- a/unpacked/jax/input/TeX/jax.js +++ b/unpacked/jax/input/TeX/jax.js @@ -1193,7 +1193,7 @@ if (base.isEmbellishedWrapper) {base = base.data[0].data[0]} var movesupsub = base.movesupsub, position = base.sup; if ((base.type === "msubsup" && base.data[base.sup]) || - (base.type === "munderover" && base.data[base.over])) + (base.type === "munderover" && base.data[base.over] && !base.subsupOK)) {TEX.Error(["DoubleExponent","Double exponent: use braces to clarify"])} if (base.type !== "msubsup") { if (movesupsub) { @@ -1220,7 +1220,7 @@ if (base.isEmbellishedWrapper) {base = base.data[0].data[0]} var movesupsub = base.movesupsub, position = base.sub; if ((base.type === "msubsup" && base.data[base.sub]) || - (base.type === "munderover" && base.data[base.under])) + (base.type === "munderover" && base.data[base.under] && !base.subsupOK)) {TEX.Error(["DoubleSubscripts","Double subscripts: use braces to clarify"])} if (base.type !== "msubsup") { if (movesupsub) { @@ -1433,10 +1433,12 @@ if (base.isa(MML.munderover) && base.isEmbellished()) {base = MML.mrow(MML.mo().With({rspace:0}),base)} // add an empty so it's not embellished any more var mml = MML.munderover(base,null,null); - mml.data[mml[pos]] = - this.mmlToken(MML.mo(MML.entity("#x"+c)).With({stretchy:true, accent:(pos == "under")})); + mml.SetData( + mml[pos], + this.mmlToken(MML.mo(MML.entity("#x"+c)).With({stretchy:true, accent:(pos==="under")})) + ); if (stack) {mml = MML.TeXAtom(mml).With({texClass:MML.TEXCLASS.OP, movesupsub:true})} - this.Push(mml); + this.Push(mml.With({subsupOK:true})); }, Overset: function (name) {