From b11a9b1b65c2d235b85063c669e2a5eea5b3aff5 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Fri, 29 Jan 2016 14:12:42 -0500 Subject: [PATCH] Handle movablelimits on TeXAtom of class OP in toMathML, NativeMML, and MathML input. --- unpacked/extensions/toMathML.js | 5 ++++- unpacked/jax/input/MathML/jax.js | 6 +++--- unpacked/jax/output/NativeMML/jax.js | 5 ++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/unpacked/extensions/toMathML.js b/unpacked/extensions/toMathML.js index c2963091a..87020a3c1 100644 --- a/unpacked/extensions/toMathML.js +++ b/unpacked/extensions/toMathML.js @@ -78,7 +78,10 @@ MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () { var CLASS = []; if (this["class"]) {CLASS.push(this["class"])} if (this.isa(MML.TeXAtom) && SETTINGS.texHints) { var TEXCLASS = ["ORD","OP","BIN","REL","OPEN","CLOSE","PUNCT","INNER","VCENTER"][this.texClass]; - if (TEXCLASS) {CLASS.push("MJX-TeXAtom-"+TEXCLASS)} + if (TEXCLASS) { + CLASS.push("MJX-TeXAtom-"+TEXCLASS) + if (TEXCLASS === "OP" && !this.movablelimits) CLASS.push("MJX-fixedlimits"); + } } if (this.mathvariant && this.toMathMLvariants[this.mathvariant]) {CLASS.push("MJX"+this.mathvariant)} diff --git a/unpacked/jax/input/MathML/jax.js b/unpacked/jax/input/MathML/jax.js index df917f480..1ee87a63a 100644 --- a/unpacked/jax/input/MathML/jax.js +++ b/unpacked/jax/input/MathML/jax.js @@ -76,7 +76,7 @@ var mml, type = node.nodeName.toLowerCase().replace(/^[a-z]+:/,""); var match = (CLASS.match(/(^| )MJX-TeXAtom-([^ ]*)/)); if (match) { - mml = this.TeXAtom(match[2]); + mml = this.TeXAtom(match[2],!CLASS.match(/MJX-fixedlimits/)); } else if (!(MML[type] && MML[type].isa && MML[type].isa(MML.mbase))) { MathJax.Hub.signal.Post(["MathML Jax - unknown node type",type]); return MML.Error(_("UnknownNodeType","Unknown node type: %1",type)); @@ -88,9 +88,9 @@ if (MATHML.config.useMathMLspacing) {mml.useMMLspacing = 0x08} return mml; }, - TeXAtom: function (mclass) { + TeXAtom: function (mclass,movablelimits) { var mml = MML.TeXAtom().With({texClass:MML.TEXCLASS[mclass]}); - if (mml.texClass === MML.TEXCLASS.OP) {mml.movesupsub = mml.movablelimits = true} + if (movablelimits) {mml.movesupsub = mml.movablelimits = true} return mml; }, CheckClass: function (mml,CLASS) { diff --git a/unpacked/jax/output/NativeMML/jax.js b/unpacked/jax/output/NativeMML/jax.js index 05b75efa3..f830881d6 100644 --- a/unpacked/jax/output/NativeMML/jax.js +++ b/unpacked/jax/output/NativeMML/jax.js @@ -533,7 +533,10 @@ var CLASS = []; if (this["class"]) {CLASS.push(this["class"])} if (this.isa(MML.TeXAtom)) { var TEXCLASS = ["ORD","OP","BIN","REL","OPEN","CLOSE","PUNCT","INNER","VCENTER"][this.texClass]; - if (TEXCLASS) {CLASS.push("MJX-TeXAtom-"+TEXCLASS)} + if (TEXCLASS) { + CLASS.push("MJX-TeXAtom-"+TEXCLASS) + if (TEXCLASS === "OP" && !this.movablelimits) CLASS.push("MJX-fixedlimits"); + } } if (this.mathvariant && this.NativeMMLvariants[this.mathvariant]) {CLASS.push("MJX"+this.mathvariant)}