From 871f395ce65a6758255c428a096798d53f8bded6 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 9 Sep 2014 11:27:39 -0400 Subject: [PATCH 1/3] Make mrows that are embellished operators properly include the elements other than the core when stretched. Resolves issue #775. --- unpacked/jax/output/SVG/jax.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index 33a01ea9c..66e1f9a6e 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -1641,10 +1641,11 @@ MML.mrow.Augment({ SVG: BBOX.ROW, - toSVG: function () { + toSVG: function (h,d) { this.SVGgetStyles(); var svg = this.SVG(); this.SVGhandleSpace(svg); + if (d != null) {this.sh = h; this.sd = d} for (var i = 0, m = this.data.length; i < m; i++) {if (this.data[i]) {svg.Check(this.data[i])}} svg.Stretch(); svg.Clean(); @@ -1664,16 +1665,18 @@ }, SVGmultiline: function (span) {MML.mbase.SVGautoloadFile("multiline")}, SVGstretchH: function (w) { - var svg = this.data[this.core].SVGstretchH(w); - this.SVGhandleColor(svg); + var svg = this.SVG(), child; + this.SVGhandleSpace(svg); + for (var i = 0, m = this.data.length; i < m; i++) { + if (!this.data[i]) continue; + if (i === this.core) {child = this.data[i].SVGstretchH(w)} + else {child = this.data[i].toSVG()} + svg.Add(child,svg.w,0); + } + svg.Clean(); + this.SVGhandleColor(svg); this.SVGsaveData(svg); - return svg; - }, - SVGstretchV: function (h,d) { - var svg = this.data[this.core].SVGstretchV(h,d); - this.SVGhandleColor(svg); - this.SVGsaveData(svg); - return svg; + return svg; } }); From cfc6fa2ae09efa802eb9b5195631f1ccc9ced7fe Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 9 Sep 2014 11:51:22 -0400 Subject: [PATCH 2/3] Make fences use empty for blank delimiters so the result will not be an embellished operator. Also resolves issue #775. --- unpacked/jax/input/TeX/jax.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unpacked/jax/input/TeX/jax.js b/unpacked/jax/input/TeX/jax.js index 65e1088a2..958cbe55b 100644 --- a/unpacked/jax/input/TeX/jax.js +++ b/unpacked/jax/input/TeX/jax.js @@ -2183,9 +2183,9 @@ */ fenced: function (open,mml,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}))} + 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}))} + mrow.Append(MML.mo(close).With({fence:true, stretchy:true, texClass:MML.TEXCLASS.CLOSE})); return mrow; }, /* From 5d266d2f81f453f2bce84e2794dd6f17740e37f7 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Thu, 11 Sep 2014 08:05:29 -0400 Subject: [PATCH 3/3] Take advantage of SVGdatStretched() rather than doing it by hand. --- unpacked/jax/output/SVG/jax.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index 66e1f9a6e..daae96c56 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -1665,14 +1665,10 @@ }, SVGmultiline: function (span) {MML.mbase.SVGautoloadFile("multiline")}, SVGstretchH: function (w) { - var svg = this.SVG(), child; + var svg = this.SVG(); this.SVGhandleSpace(svg); - for (var i = 0, m = this.data.length; i < m; i++) { - if (!this.data[i]) continue; - if (i === this.core) {child = this.data[i].SVGstretchH(w)} - else {child = this.data[i].toSVG()} - svg.Add(child,svg.w,0); - } + for (var i = 0, m = this.data.length; i < m; i++) + {svg.Add(this.SVGdataStretched(i,w),svg.w,0)} svg.Clean(); this.SVGhandleColor(svg); this.SVGsaveData(svg);