Skip to content
Permalink
Browse files

Make \\left...\\right be of TeX class INNER. Resolves issue mathjax#746.

  • Loading branch information...
dpvc committed Feb 20, 2014
1 parent 9bed669 commit f6bc6fa129103b6969057e8b83a2bc95651d44bf
Showing with 23 additions and 6 deletions.
  1. +22 −4 unpacked/jax/element/mml/jax.js
  2. +1 −2 unpacked/jax/input/TeX/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) {
//
// <mrow> 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 <mrow>, 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;
}
});
@@ -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}))}

0 comments on commit f6bc6fa

Please sign in to comment.
You can’t perform that action at this time.