Rename variable used for displayIndent so it doesn't conflict with previous usage. Also, handle '0em' and similar values as '0'. Resolves issue #1000.
This commit is contained in:
parent
ae48c34e64
commit
2431a90a9f
|
@ -174,7 +174,7 @@ MathJax.Hub.Config({
|
||||||
// or left (negative is left).
|
// or left (negative is left).
|
||||||
//
|
//
|
||||||
displayAlign: "center",
|
displayAlign: "center",
|
||||||
displayIndent: "0em",
|
displayIndent: "0",
|
||||||
|
|
||||||
//
|
//
|
||||||
// Normally MathJax will perform its starup commands (loading of
|
// Normally MathJax will perform its starup commands (loading of
|
||||||
|
|
|
@ -582,13 +582,13 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
};
|
};
|
||||||
if (mml.displayAlign === MML.INDENTALIGN.LEFT) {
|
if (mml.displayAlign === MML.INDENTALIGN.LEFT) {
|
||||||
def.width = "100%";
|
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"
|
def.columnwidth = mml.displayIndent + " fit"; def.columnspacing = "0"
|
||||||
row = [row[0],MML.mtd(),row[1]];
|
row = [row[0],MML.mtd(),row[1]];
|
||||||
}
|
}
|
||||||
} else if (mml.displayAlign === MML.INDENTALIGN.RIGHT) {
|
} else if (mml.displayAlign === MML.INDENTALIGN.RIGHT) {
|
||||||
def.width = "100%";
|
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"
|
def.columnwidth = "fit "+mml.displayIndent; def.columnspacing = "0"
|
||||||
row[2] = MML.mtd();
|
row[2] = MML.mtd();
|
||||||
}
|
}
|
||||||
|
|
|
@ -430,8 +430,8 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
|
||||||
var shift = HTMLCSS.length2em(indent.indentshift,mu,HTMLCSS.cwidth);
|
var shift = HTMLCSS.length2em(indent.indentshift,mu,HTMLCSS.cwidth);
|
||||||
var labelshift = HTMLCSS.length2em(values.minlabelspacing,mu,HTMLCSS.cwidth);
|
var labelshift = HTMLCSS.length2em(values.minlabelspacing,mu,HTMLCSS.cwidth);
|
||||||
if (this.displayIndent !== "0") {
|
if (this.displayIndent !== "0") {
|
||||||
var indent = HTMLCSS.length2em(this.displayIndent,mu,HTMLCSS.cwidth);
|
var dIndent = HTMLCSS.length2em(this.displayIndent,mu,HTMLCSS.cwidth);
|
||||||
shift += (indent.indentAlign === MML.INDENTALIGN.RIGHT ? -indent: indent);
|
shift += (indent.indentAlign === MML.INDENTALIGN.RIGHT ? -dIndent: dIndent);
|
||||||
}
|
}
|
||||||
var eqn = HTMLCSS.createStack(span,false,"100%");
|
var eqn = HTMLCSS.createStack(span,false,"100%");
|
||||||
HTMLCSS.addBox(eqn,stack); HTMLCSS.alignBox(stack,indent.indentalign,0,shift);
|
HTMLCSS.addBox(eqn,stack); HTMLCSS.alignBox(stack,indent.indentalign,0,shift);
|
||||||
|
|
|
@ -2838,6 +2838,8 @@
|
||||||
}
|
}
|
||||||
MML.mbase.prototype.displayAlign = HUB.config.displayAlign;
|
MML.mbase.prototype.displayAlign = HUB.config.displayAlign;
|
||||||
MML.mbase.prototype.displayIndent = HUB.config.displayIndent;
|
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
|
var html = this.data[0].toHTML(box); html.bbox.exactW = false; // force remeasure just to be sure
|
||||||
math = HTMLCSS.Measured(html,box);
|
math = HTMLCSS.Measured(html,box);
|
||||||
}
|
}
|
||||||
|
|
|
@ -333,8 +333,8 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
|
||||||
var shift = SVG.length2em(indent.indentshift,mu,SVG.cwidth);
|
var shift = SVG.length2em(indent.indentshift,mu,SVG.cwidth);
|
||||||
var labelshift = SVG.length2em(values.minlabelspacing,mu,SVG.cwidth);
|
var labelshift = SVG.length2em(values.minlabelspacing,mu,SVG.cwidth);
|
||||||
if (this.displayIndent !== "0") {
|
if (this.displayIndent !== "0") {
|
||||||
var indent = SVG.length2em(this.displayIndent,mu,SVG.cwidth);
|
var dIndent = SVG.length2em(this.displayIndent,mu,SVG.cwidth);
|
||||||
shift += (indent.indentAlign === MML.INDENTALIGN.RIGHT ? -indent: indent);
|
shift += (indent.indentAlign === MML.INDENTALIGN.RIGHT ? -dIndent: dIndent);
|
||||||
}
|
}
|
||||||
var eqn = svg; svg = this.SVG();
|
var eqn = svg; svg = this.SVG();
|
||||||
svg.w = svg.r = SVG.cwidth; svg.hasIndent = true;
|
svg.w = svg.r = SVG.cwidth; svg.hasIndent = true;
|
||||||
|
|
|
@ -2027,6 +2027,8 @@
|
||||||
this.SVGgetStyles();
|
this.SVGgetStyles();
|
||||||
MML.mbase.prototype.displayAlign = HUB.config.displayAlign;
|
MML.mbase.prototype.displayAlign = HUB.config.displayAlign;
|
||||||
MML.mbase.prototype.displayIndent = HUB.config.displayIndent;
|
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 content in a <g> with defaults and matrix that flips y axis.
|
||||||
// Put that in an <svg> with xlink defined.
|
// Put that in an <svg> with xlink defined.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user