diff --git a/unpacked/jax/element/mml/jax.js b/unpacked/jax/element/mml/jax.js index 33cdf529e..713db61a3 100644 --- a/unpacked/jax/element/mml/jax.js +++ b/unpacked/jax/element/mml/jax.js @@ -751,10 +751,27 @@ MathJax.ElementJax.mml.Augment({ return this.SUPER(arguments).toString.call(this); }, setTeXclass: function (prev) { - for (var i = 0, m = this.data.length; i < m; i++) - {if (this.data[i]) {prev = this.data[i].setTeXclass(prev)}} - if (this.data[0]) {this.updateTeXclass(this.data[0])} - return prev; + var i, m = this.data.length; + if (this.open || this.close) { + // + // came from \left...\right + // so treat as subexpression (tex class INNER) + // + this.getPrevClass(prev); + for (i = 0; i < m; i++) + {if (this.data[i]) {prev = this.data[i].setTeXclass(prev)}} + this.texClass = MML.TEXCLASS.INNER; + return this; + } else { + // + // Normal , so treat as + // thorugh mrow is not there + // + for (i = 0; i < m; i++) + {if (this.data[i]) {prev = this.data[i].setTeXclass(prev)}} + if (this.data[0]) {this.updateTeXclass(this.data[0])} + return prev; + } }, getAnnotation: function (name) { if (this.data.length != 1) return null; @@ -947,6 +964,7 @@ MathJax.ElementJax.mml.Augment({ } // get the data from the open item this.updateTeXclass(this.data.open); + this.texClass = MML.TEXCLASS.INNER; return prev; } }); diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js index a0c87f71a..54c7c43d0 100644 --- a/unpacked/jax/input/TeX/jax.js +++ b/unpacked/jax/input/TeX/jax.js @@ -2130,8 +2130,7 @@ * Create an mrow that has stretchy delimiters at either end, as needed */ fenced: function (open,mml,close) { - var mrow = MML.mrow(); - mrow.open = open; mrow.close = close; + var mrow = MML.mrow().With({open:open, close:close, texClass:MML.TEXCLASS.INNER}); if (open) {mrow.Append(MML.mo(open).With({fence:true, stretchy:true, texClass:MML.TEXCLASS.OPEN}))} if (mml.type === "mrow") {mrow.Append.apply(mrow,mml.data)} else {mrow.Append(mml)} if (close) {mrow.Append(MML.mo(close).With({fence:true, stretchy:true, texClass:MML.TEXCLASS.CLOSE}))}