commit df92acc9596b07d6ecb8a5a7c2f04b1a3079e336
parent ae48c34e6477425e3693d929c30dfe55dd354f84
Author: Davide P. Cervone <dpvc@union.edu>
Date: Mon, 12 Jan 2015 09:36:46 -0500
Merge branch 'issue1000' into develop. Issue #1000.
Diffstat:
6 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/unpacked/config/default.js b/unpacked/config/default.js
@@ -174,7 +174,7 @@ MathJax.Hub.Config({
// or left (negative is left).
//
displayAlign: "center",
- displayIndent: "0em",
+ displayIndent: "0",
//
// Normally MathJax will perform its starup commands (loading of
diff --git a/unpacked/extensions/TeX/AMSmath.js b/unpacked/extensions/TeX/AMSmath.js
@@ -582,13 +582,13 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
};
if (mml.displayAlign === MML.INDENTALIGN.LEFT) {
def.width = "100%";
- if (mml.displayIndent && !String(mml.displayIndent).match(/^0+(\.0*)?($|[a-z%])/)) {
+ if (mml.displayIndent !== "0") {
def.columnwidth = mml.displayIndent + " fit"; def.columnspacing = "0"
row = [row[0],MML.mtd(),row[1]];
}
} else if (mml.displayAlign === MML.INDENTALIGN.RIGHT) {
def.width = "100%";
- if (mml.displayIndent && !String(mml.displayIndent).match(/^0+(\.0*)?($|[a-z%])/)) {
+ if (mml.displayIndent !== "0") {
def.columnwidth = "fit "+mml.displayIndent; def.columnspacing = "0"
row[2] = MML.mtd();
}
diff --git a/unpacked/jax/output/HTML-CSS/autoload/mtable.js b/unpacked/jax/output/HTML-CSS/autoload/mtable.js
@@ -430,8 +430,8 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
var shift = HTMLCSS.length2em(indent.indentshift,mu,HTMLCSS.cwidth);
var labelshift = HTMLCSS.length2em(values.minlabelspacing,mu,HTMLCSS.cwidth);
if (this.displayIndent !== "0") {
- var indent = HTMLCSS.length2em(this.displayIndent,mu,HTMLCSS.cwidth);
- shift += (indent.indentAlign === MML.INDENTALIGN.RIGHT ? -indent: indent);
+ var dIndent = HTMLCSS.length2em(this.displayIndent,mu,HTMLCSS.cwidth);
+ shift += (indent.indentAlign === MML.INDENTALIGN.RIGHT ? -dIndent: dIndent);
}
var eqn = HTMLCSS.createStack(span,false,"100%");
HTMLCSS.addBox(eqn,stack); HTMLCSS.alignBox(stack,indent.indentalign,0,shift);
diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js
@@ -2838,6 +2838,8 @@
}
MML.mbase.prototype.displayAlign = HUB.config.displayAlign;
MML.mbase.prototype.displayIndent = HUB.config.displayIndent;
+ if (String(HUB.config.displayIndent).match(/^0($|[a-z%])/i))
+ MML.mbase.prototype.displayIndent = "0";
var html = this.data[0].toHTML(box); html.bbox.exactW = false; // force remeasure just to be sure
math = HTMLCSS.Measured(html,box);
}
@@ -2881,10 +2883,10 @@
if (values.indentshiftfirst !== MML.INDENTSHIFT.INDENTSHIFT) {values.indentshift = values.indentshiftfirst}
if (values.indentshift === "auto") {values.indentshift = "0"}
var shift = HTMLCSS.length2em(values.indentshift,1,HTMLCSS.cwidth);
- if (this.displayIndent !== "0") {
- var indent = HTMLCSS.length2em(this.displayIndent,1,HTMLCSS.cwidth);
- shift += (values.indentalign === MML.INDENTALIGN.RIGHT ? -indent : indent);
- }
+ if (this.displayIndent !== "0") {
+ var indent = HTMLCSS.length2em(this.displayIndent,1,HTMLCSS.cwidth);
+ shift += (values.indentalign === MML.INDENTALIGN.RIGHT ? -indent : indent);
+ }
node.style.textAlign = values.indentalign;
// ### FIXME: make percentage widths respond to changes in container
if (shift) {
diff --git a/unpacked/jax/output/SVG/autoload/mtable.js b/unpacked/jax/output/SVG/autoload/mtable.js
@@ -333,8 +333,8 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
var shift = SVG.length2em(indent.indentshift,mu,SVG.cwidth);
var labelshift = SVG.length2em(values.minlabelspacing,mu,SVG.cwidth);
if (this.displayIndent !== "0") {
- var indent = SVG.length2em(this.displayIndent,mu,SVG.cwidth);
- shift += (indent.indentAlign === MML.INDENTALIGN.RIGHT ? -indent: indent);
+ var dIndent = SVG.length2em(this.displayIndent,mu,SVG.cwidth);
+ shift += (indent.indentAlign === MML.INDENTALIGN.RIGHT ? -dIndent: dIndent);
}
var eqn = svg; svg = this.SVG();
svg.w = svg.r = SVG.cwidth; svg.hasIndent = true;
diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js
@@ -2027,6 +2027,8 @@
this.SVGgetStyles();
MML.mbase.prototype.displayAlign = HUB.config.displayAlign;
MML.mbase.prototype.displayIndent = HUB.config.displayIndent;
+ if (String(HUB.config.displayIndent).match(/^0($|[a-z%])/i))
+ MML.mbase.prototype.displayIndent = "0";
//
// Put content in a <g> with defaults and matrix that flips y axis.
// Put that in an <svg> with xlink defined.