diff --git a/unpacked/config/default.js b/unpacked/config/default.js index 084031af7..ab6869d09 100644 --- 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 index 9e7fc6d61..cc9d28401 100644 --- 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 index 7183a47c6..06ee73ec4 100644 --- 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 index f7634e492..8d3099598 100644 --- 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 index 53117be1d..d7b874be8 100644 --- 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 index 92d00f785..303528eb0 100644 --- 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 with defaults and matrix that flips y axis. // Put that in an with xlink defined.