From a147a9ac324fb09aad85af9a0807fd8696e87dd5 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 21 May 2013 19:53:28 -0400 Subject: [PATCH 1/2] Make sure mfenced delimiters are stretchy. Resolves issue #475. --- unpacked/jax/input/TeX/config.js | 2 +- unpacked/jax/input/TeX/jax.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/unpacked/jax/input/TeX/config.js b/unpacked/jax/input/TeX/config.js index 901d926e7..9727e1045 100644 --- a/unpacked/jax/input/TeX/config.js +++ b/unpacked/jax/input/TeX/config.js @@ -27,7 +27,7 @@ MathJax.InputJax.TeX = MathJax.InputJax({ id: "TeX", - version: "2.2", + version: "2.2.1", directory: MathJax.InputJax.directory + "/TeX", extensionDir: MathJax.InputJax.extensionDir + "/TeX", diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js index f8fe94fcb..2e5320c8a 100644 --- a/unpacked/jax/input/TeX/jax.js +++ b/unpacked/jax/input/TeX/jax.js @@ -2127,9 +2127,9 @@ mfenced: function (open,mml,close) { var mrow = MML.mrow(); mrow.open = open; mrow.close = close; - if (open) {mrow.Append(MML.mo(open).With({fence:true, texClass:MML.TEXCLASS.OPEN}))} + 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, texClass:MML.TEXCLASS.CLOSE}))} + if (close) {mrow.Append(MML.mo(close).With({fence:true, stretchy:true, texClass:MML.TEXCLASS.CLOSE}))} return mrow; }, From 4e01303deee2f595b13d779d36b6b885ab0ee830 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 22 May 2013 14:03:38 -0400 Subject: [PATCH 2/2] Rename mfenced() to fenced() since the mrow is not really equivalent (the mo's are forced to have stretchy=true). Resolves Fred's concerns for issue #475 for now. --- unpacked/extensions/TeX/AMSmath.js | 2 +- unpacked/jax/input/TeX/jax.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/unpacked/extensions/TeX/AMSmath.js b/unpacked/extensions/TeX/AMSmath.js index 7e6cfdaea..a2ffa9913 100644 --- a/unpacked/extensions/TeX/AMSmath.js +++ b/unpacked/extensions/TeX/AMSmath.js @@ -265,7 +265,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { var den = this.ParseArg(name); var frac = MML.mfrac(num,den); if (thick !== "") {frac.linethickness = thick} - if (left || right) {frac = TEX.mfenced(left,frac,right)} + if (left || right) {frac = TEX.fenced(left,frac,right)} if (style !== "") { var STYLE = (["D","T","S","SS"])[style]; if (STYLE == null) diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js index 2e5320c8a..f3e38ee34 100644 --- a/unpacked/jax/input/TeX/jax.js +++ b/unpacked/jax/input/TeX/jax.js @@ -186,7 +186,7 @@ if (this.open || this.close) { mml.texClass = MML.TEXCLASS.INNER; mml.texWithDelims = true; - mml = TEX.mfenced(this.open,mml,this.close); + mml = TEX.fenced(this.open,mml,this.close); } return [STACKITEM.mml(mml), item]; } @@ -200,7 +200,7 @@ stopError: /*_()*/ ["ExtraLeftMissingRight", "Extra \\left or missing \\right"], checkItem: function (item) { if (item.type === "right") - {return STACKITEM.mml(TEX.mfenced(this.delim,this.mmlData(),item.delim))} + {return STACKITEM.mml(TEX.fenced(this.delim,this.mmlData(),item.delim))} return this.SUPER(arguments).checkItem.call(this,item); } }); @@ -276,7 +276,7 @@ if ((this.arraydef.columnlines||"none") != "none" || (this.arraydef.rowlines||"none") != "none") {mml.padding = 0} // HTML-CSS jax implements this } - if (this.open || this.close) {mml = TEX.mfenced(this.open,mml,this.close)} + if (this.open || this.close) {mml = TEX.fenced(this.open,mml,this.close)} mml = STACKITEM.mml(mml); if (this.requireClose) { if (item.type === 'close') {return mml} @@ -2122,9 +2122,9 @@ }, /* - * Create an mrow that represents the equivalent of an mfenced + * Create an mrow that has stretchy delimiters at either end, as needed */ - mfenced: function (open,mml,close) { + fenced: function (open,mml,close) { var mrow = MML.mrow(); mrow.open = open; mrow.close = close; if (open) {mrow.Append(MML.mo(open).With({fence:true, stretchy:true, texClass:MML.TEXCLASS.OPEN}))}