Remove capitalized TRUE and FALSE (don't remember why I had those in the first place)

This commit is contained in:
Davide P. Cervone 2012-01-11 13:55:39 -05:00
parent 756ef39804
commit 568b919f70
12 changed files with 175 additions and 176 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -206,10 +206,9 @@ MathJax.ElementJax.mml.Augment({
}); });
(function (MML) { (function (MML) {
var FALSE = false; var TRUE = true;
MML.mbase = MathJax.Object.Subclass({ MML.mbase = MathJax.Object.Subclass({
type: "base", isToken: FALSE, type: "base", isToken: false,
defaults: { defaults: {
mathbackground: MML.INHERIT, mathbackground: MML.INHERIT,
mathcolor: MML.INHERIT mathcolor: MML.INHERIT
@ -218,12 +217,12 @@ MathJax.ElementJax.mml.Augment({
noInheritAttribute: { noInheritAttribute: {
texClass: true texClass: true
}, },
linebreakContainer: FALSE, linebreakContainer: false,
Init: function () { Init: function () {
this.data = []; this.data = [];
if (this.inferRow && !(arguments.length === 1 && arguments[0].inferred)) if (this.inferRow && !(arguments.length === 1 && arguments[0].inferred))
{this.Append(MML.mrow().With({inferred: TRUE}))} {this.Append(MML.mrow().With({inferred: true}))}
this.Append.apply(this,arguments); this.Append.apply(this,arguments);
}, },
With: function (def) { With: function (def) {
@ -345,8 +344,8 @@ MathJax.ElementJax.mml.Augment({
[ 1,-1, 2, 3, 1, 0, 1, 1] // INNER [ 1,-1, 2, 3, 1, 0, 1, 1] // INNER
], ],
autoDefault: function (name) {return ""}, autoDefault: function (name) {return ""},
isSpacelike: function () {return FALSE}, isSpacelike: function () {return false},
isEmbellished: function () {return FALSE}, isEmbellished: function () {return false},
Core: function () {return this}, Core: function () {return this},
CoreMO: function () {return this}, CoreMO: function () {return this},
lineBreak: function () { // FIXME: should be removed (and from elements below) when SVG is converted to new linebreak style lineBreak: function () { // FIXME: should be removed (and from elements below) when SVG is converted to new linebreak style
@ -354,19 +353,19 @@ MathJax.ElementJax.mml.Augment({
}, },
hasNewline: function () { hasNewline: function () {
if (this.isEmbellished()) {return this.CoreMO().hasNewline()} if (this.isEmbellished()) {return this.CoreMO().hasNewline()}
if (this.isToken || this.linebreakContainer) {return FALSE} if (this.isToken || this.linebreakContainer) {return false}
for (var i = 0, m = this.data.length; i < m; i++) { for (var i = 0, m = this.data.length; i < m; i++) {
if (this.data[i] && this.data[i].hasNewline()) {return TRUE} if (this.data[i] && this.data[i].hasNewline()) {return true}
} }
return FALSE; return false;
}, },
array: function () {if (this.inferred) {return this.data} else {return [this]}}, array: function () {if (this.inferred) {return this.data} else {return [this]}},
toString: function () {return this.type+"("+this.data.join(",")+")"} toString: function () {return this.type+"("+this.data.join(",")+")"}
},{ },{
childrenSpacelike: function () { childrenSpacelike: function () {
for (var i = 0, m = this.data.length; i < m; i++) for (var i = 0, m = this.data.length; i < m; i++)
{if (!this.data[i].isSpacelike()) {return FALSE}} {if (!this.data[i].isSpacelike()) {return false}}
return TRUE; return true;
}, },
childEmbellished: function () { childEmbellished: function () {
return (this.data[0] && this.data[0].isEmbellished()); return (this.data[0] && this.data[0].isEmbellished());
@ -400,7 +399,7 @@ MathJax.ElementJax.mml.Augment({
}); });
MML.mi = MML.mbase.Subclass({ MML.mi = MML.mbase.Subclass({
type: "mi", isToken: TRUE, type: "mi", isToken: true,
texClass: MML.TEXCLASS.ORD, texClass: MML.TEXCLASS.ORD,
defaults: { defaults: {
mathvariant: MML.AUTO, mathvariant: MML.AUTO,
@ -419,7 +418,7 @@ MathJax.ElementJax.mml.Augment({
}); });
MML.mn = MML.mbase.Subclass({ MML.mn = MML.mbase.Subclass({
type: "mn", isToken: TRUE, type: "mn", isToken: true,
texClass: MML.TEXCLASS.ORD, texClass: MML.TEXCLASS.ORD,
defaults: { defaults: {
mathvariant: MML.INHERIT, mathvariant: MML.INHERIT,
@ -430,7 +429,7 @@ MathJax.ElementJax.mml.Augment({
}); });
MML.mo = MML.mbase.Subclass({ MML.mo = MML.mbase.Subclass({
type: "mo", isToken: TRUE, type: "mo", isToken: true,
defaults: { defaults: {
mathvariant: MML.INHERIT, mathvariant: MML.INHERIT,
mathsize: MML.INHERIT, mathsize: MML.INHERIT,
@ -463,17 +462,17 @@ MathJax.ElementJax.mml.Augment({
}, },
defaultDef: { defaultDef: {
form: MML.FORM.INFIX, form: MML.FORM.INFIX,
fence: FALSE, fence: false,
separator: FALSE, separator: false,
lspace: MML.LENGTH.THICKMATHSPACE, lspace: MML.LENGTH.THICKMATHSPACE,
rspace: MML.LENGTH.THICKMATHSPACE, rspace: MML.LENGTH.THICKMATHSPACE,
stretchy: FALSE, stretchy: false,
symmetric: TRUE, symmetric: true,
maxsize: MML.SIZE.INFINITY, maxsize: MML.SIZE.INFINITY,
minsize: '0em', //'1em', minsize: '0em', //'1em',
largeop: FALSE, largeop: false,
movablelimits: FALSE, movablelimits: false,
accent: FALSE, accent: false,
linebreak: MML.LINEBREAK.AUTO, linebreak: MML.LINEBREAK.AUTO,
lineleading: "1ex", lineleading: "1ex",
linebreakstyle: "before", linebreakstyle: "before",
@ -545,7 +544,7 @@ MathJax.ElementJax.mml.Augment({
} }
return MML.FORM.INFIX; return MML.FORM.INFIX;
}, },
isEmbellished: function () {return TRUE}, isEmbellished: function () {return true},
hasNewline: function () {return (this.Get("linebreak") === MML.LINEBREAK.NEWLINE)}, hasNewline: function () {return (this.Get("linebreak") === MML.LINEBREAK.NEWLINE)},
lineBreak: function () { lineBreak: function () {
var values = this.getValues("linebreak","linebreakstyle"); var values = this.getValues("linebreak","linebreakstyle");
@ -581,8 +580,8 @@ MathJax.ElementJax.mml.Augment({
}); });
MML.mtext = MML.mbase.Subclass({ MML.mtext = MML.mbase.Subclass({
type: "mtext", isToken: TRUE, type: "mtext", isToken: true,
isSpacelike: function () {return TRUE}, isSpacelike: function () {return true},
texClass: MML.TEXCLASS.ORD, texClass: MML.TEXCLASS.ORD,
defaults: { defaults: {
mathvariant: MML.INHERIT, mathvariant: MML.INHERIT,
@ -593,8 +592,8 @@ MathJax.ElementJax.mml.Augment({
}); });
MML.mspace = MML.mbase.Subclass({ MML.mspace = MML.mbase.Subclass({
type: "mspace", isToken: TRUE, type: "mspace", isToken: true,
isSpacelike: function () {return TRUE}, isSpacelike: function () {return true},
defaults: { defaults: {
mathbackground: MML.INHERIT, mathbackground: MML.INHERIT,
mathcolor: MML.INHERIT, mathcolor: MML.INHERIT,
@ -611,7 +610,7 @@ MathJax.ElementJax.mml.Augment({
}); });
MML.ms = MML.mbase.Subclass({ MML.ms = MML.mbase.Subclass({
type: "ms", isToken: TRUE, type: "ms", isToken: true,
texClass: MML.TEXCLASS.ORD, texClass: MML.TEXCLASS.ORD,
defaults: { defaults: {
mathvariant: MML.INHERIT, mathvariant: MML.INHERIT,
@ -624,7 +623,7 @@ MathJax.ElementJax.mml.Augment({
}); });
MML.mglyph = MML.mbase.Subclass({ MML.mglyph = MML.mbase.Subclass({
type: "mglyph", isToken: TRUE, type: "mglyph", isToken: true,
texClass: MML.TEXCLASS.ORD, texClass: MML.TEXCLASS.ORD,
defaults: { defaults: {
mathbackground: MML.INHERIT, mathbackground: MML.INHERIT,
@ -640,15 +639,15 @@ MathJax.ElementJax.mml.Augment({
MML.mrow = MML.mbase.Subclass({ MML.mrow = MML.mbase.Subclass({
type: "mrow", type: "mrow",
isSpacelike: MML.mbase.childrenSpacelike, isSpacelike: MML.mbase.childrenSpacelike,
inferred: FALSE, inferred: false,
isEmbellished: function () { isEmbellished: function () {
var isEmbellished = FALSE; var isEmbellished = false;
for (var i = 0, m = this.data.length; i < m; i++) { for (var i = 0, m = this.data.length; i < m; i++) {
if (this.data[i] == null) continue; if (this.data[i] == null) continue;
if (this.data[i].isEmbellished()) { if (this.data[i].isEmbellished()) {
if (isEmbellished) {return FALSE} if (isEmbellished) {return false}
isEmbellished = TRUE; this.core = i; isEmbellished = true; this.core = i;
} else if (!this.data[i].isSpacelike()) {return FALSE} } else if (!this.data[i].isSpacelike()) {return false}
} }
return isEmbellished; return isEmbellished;
}, },
@ -690,7 +689,7 @@ MathJax.ElementJax.mml.Augment({
MML.mfrac = MML.mbase.Subclass({ MML.mfrac = MML.mbase.Subclass({
type: "mfrac", num: 0, den: 1, type: "mfrac", num: 0, den: 1,
linebreakContainer: TRUE, linebreakContainer: true,
texClass: MML.TEXCLASS.INNER, texClass: MML.TEXCLASS.INNER,
isEmbellished: MML.mbase.childEmbellished, isEmbellished: MML.mbase.childEmbellished,
Core: MML.mbase.childCore, Core: MML.mbase.childCore,
@ -701,9 +700,9 @@ MathJax.ElementJax.mml.Augment({
linethickness: MML.LINETHICKNESS.MEDIUM, linethickness: MML.LINETHICKNESS.MEDIUM,
numalign: MML.ALIGN.CENTER, numalign: MML.ALIGN.CENTER,
denomalign: MML.ALIGN.CENTER, denomalign: MML.ALIGN.CENTER,
bevelled: FALSE bevelled: false
}, },
adjustChild_displaystyle: function (n) {return FALSE}, adjustChild_displaystyle: function (n) {return false},
adjustChild_scriptlevel: function (n) { adjustChild_scriptlevel: function (n) {
var level = this.Get("scriptlevel"); var level = this.Get("scriptlevel");
if (!this.Get("displaystyle") || level > 0) {level++} if (!this.Get("displaystyle") || level > 0) {level++}
@ -718,19 +717,19 @@ MathJax.ElementJax.mml.Augment({
MML.msqrt = MML.mbase.Subclass({ MML.msqrt = MML.mbase.Subclass({
type: "msqrt", type: "msqrt",
inferRow: TRUE, inferRow: true,
linebreakContainer: TRUE, linebreakContainer: true,
texClass: MML.TEXCLASS.ORD, texClass: MML.TEXCLASS.ORD,
setTeXclass: MML.mbase.setSeparateTeXclasses, setTeXclass: MML.mbase.setSeparateTeXclasses,
adjustChild_texprimestyle: function (n) {return TRUE} adjustChild_texprimestyle: function (n) {return true}
}); });
MML.mroot = MML.mbase.Subclass({ MML.mroot = MML.mbase.Subclass({
type: "mroot", type: "mroot",
linebreakContainer: TRUE, linebreakContainer: true,
texClass: MML.TEXCLASS.ORD, texClass: MML.TEXCLASS.ORD,
adjustChild_displaystyle: function (n) { adjustChild_displaystyle: function (n) {
if (n === 1) {return FALSE} if (n === 1) {return false}
return this.Get("displaystyle"); return this.Get("displaystyle");
}, },
adjustChild_scriptlevel: function (n) { adjustChild_scriptlevel: function (n) {
@ -739,7 +738,7 @@ MathJax.ElementJax.mml.Augment({
return level; return level;
}, },
adjustChild_texprimestyle: function (n) { adjustChild_texprimestyle: function (n) {
if (n === 0) {return TRUE}; if (n === 0) {return true};
return this.Get("texprimestyle"); return this.Get("texprimestyle");
}, },
setTeXclass: MML.mbase.setSeparateTeXclasses setTeXclass: MML.mbase.setSeparateTeXclasses
@ -751,7 +750,7 @@ MathJax.ElementJax.mml.Augment({
isEmbellished: MML.mbase.childEmbellished, isEmbellished: MML.mbase.childEmbellished,
Core: MML.mbase.childCore, Core: MML.mbase.childCore,
CoreMO: MML.mbase.childCoreMO, CoreMO: MML.mbase.childCoreMO,
inferRow: TRUE, inferRow: true,
defaults: { defaults: {
scriptlevel: MML.INHERIT, scriptlevel: MML.INHERIT,
displaystyle: MML.INHERIT, displaystyle: MML.INHERIT,
@ -774,24 +773,24 @@ MathJax.ElementJax.mml.Augment({
} }
return level; return level;
}, },
inheritFromMe: TRUE, inheritFromMe: true,
noInherit: { noInherit: {
mpadded: {width: TRUE, height: TRUE, depth: TRUE, lspace: TRUE, voffset: TRUE}, mpadded: {width: true, height: true, depth: true, lspace: true, voffset: true},
mtable: {width: TRUE, height: TRUE, depth: TRUE, align: TRUE} mtable: {width: true, height: true, depth: true, align: true}
}, },
setTeXclass: MML.mbase.setChildTeXclass setTeXclass: MML.mbase.setChildTeXclass
}); });
MML.merror = MML.mbase.Subclass({ MML.merror = MML.mbase.Subclass({
type: "merror", type: "merror",
inferRow: TRUE, inferRow: true,
linebreakContainer: TRUE, linebreakContainer: true,
texClass: MML.TEXCLASS.ORD texClass: MML.TEXCLASS.ORD
}); });
MML.mpadded = MML.mbase.Subclass({ MML.mpadded = MML.mbase.Subclass({
type: "mpadded", type: "mpadded",
inferRow: TRUE, inferRow: true,
isSpacelike: MML.mbase.childrenSpacelike, isSpacelike: MML.mbase.childrenSpacelike,
isEmbellished: MML.mbase.childEmbellished, isEmbellished: MML.mbase.childEmbellished,
Core: MML.mbase.childCore, Core: MML.mbase.childCore,
@ -811,7 +810,7 @@ MathJax.ElementJax.mml.Augment({
MML.mphantom = MML.mbase.Subclass({ MML.mphantom = MML.mbase.Subclass({
type: "mphantom", type: "mphantom",
texClass: MML.TEXCLASS.ORD, texClass: MML.TEXCLASS.ORD,
inferRow: TRUE, inferRow: true,
isSpacelike: MML.mbase.childrenSpacelike, isSpacelike: MML.mbase.childrenSpacelike,
isEmbellished: MML.mbase.childEmbellished, isEmbellished: MML.mbase.childEmbellished,
Core: MML.mbase.childCore, Core: MML.mbase.childCore,
@ -870,8 +869,8 @@ MathJax.ElementJax.mml.Augment({
MML.menclose = MML.mbase.Subclass({ MML.menclose = MML.mbase.Subclass({
type: "menclose", type: "menclose",
inferRow: TRUE, inferRow: true,
linebreakContainer: TRUE, linebreakContainer: true,
defaults: { defaults: {
mathbackground: MML.INHERIT, mathbackground: MML.INHERIT,
mathcolor: MML.INHERIT, mathcolor: MML.INHERIT,
@ -883,7 +882,7 @@ MathJax.ElementJax.mml.Augment({
MML.msubsup = MML.mbase.Subclass({ MML.msubsup = MML.mbase.Subclass({
type: "msubsup", base: 0, sub: 1, sup: 2, type: "msubsup", base: 0, sub: 1, sup: 2,
linebreakContainer: TRUE, linebreakContainer: true,
isEmbellished: MML.mbase.childEmbellished, isEmbellished: MML.mbase.childEmbellished,
Core: MML.mbase.childCore, Core: MML.mbase.childCore,
CoreMO: MML.mbase.childCoreMO, CoreMO: MML.mbase.childCoreMO,
@ -900,7 +899,7 @@ MathJax.ElementJax.mml.Augment({
return 0; return 0;
}, },
adjustChild_displaystyle: function (n) { adjustChild_displaystyle: function (n) {
if (n > 0) {return FALSE} if (n > 0) {return false}
return this.Get("displaystyle"); return this.Get("displaystyle");
}, },
adjustChild_scriptlevel: function (n) { adjustChild_scriptlevel: function (n) {
@ -909,7 +908,7 @@ MathJax.ElementJax.mml.Augment({
return level; return level;
}, },
adjustChild_texprimestyle: function (n) { adjustChild_texprimestyle: function (n) {
if (n === this.sub) {return TRUE} if (n === this.sub) {return true}
return this.Get("texprimestyle"); return this.Get("texprimestyle");
}, },
setTeXclass: MML.mbase.setBaseTeXclasses setTeXclass: MML.mbase.setBaseTeXclasses
@ -920,7 +919,7 @@ MathJax.ElementJax.mml.Augment({
MML.mmultiscripts = MML.msubsup.Subclass({ MML.mmultiscripts = MML.msubsup.Subclass({
type: "mmultiscripts", type: "mmultiscripts",
adjustChild_texprimestyle: function (n) { adjustChild_texprimestyle: function (n) {
if (n % 2 === 1) {return TRUE} if (n % 2 === 1) {return true}
return this.Get("texprimestyle"); return this.Get("texprimestyle");
} }
}); });
@ -931,7 +930,7 @@ MathJax.ElementJax.mml.Augment({
type: "munderover", type: "munderover",
base: 0, under: 1, over: 2, sub: 1, sup: 2, base: 0, under: 1, over: 2, sub: 1, sup: 2,
ACCENTS: ["", "accentunder", "accent"], ACCENTS: ["", "accentunder", "accent"],
linebreakContainer: TRUE, linebreakContainer: true,
isEmbellished: MML.mbase.childEmbellished, isEmbellished: MML.mbase.childEmbellished,
Core: MML.mbase.childCore, Core: MML.mbase.childCore,
CoreMO: MML.mbase.childCoreMO, CoreMO: MML.mbase.childCoreMO,
@ -950,10 +949,10 @@ MathJax.ElementJax.mml.Augment({
{return (this.isEmbellished() ? this.CoreMO().Get(name) : MML.TEXCLASS.ORD)} {return (this.isEmbellished() ? this.CoreMO().Get(name) : MML.TEXCLASS.ORD)}
if (name === "accent" && this.data[this.over]) {return this.data[this.over].CoreMO().Get("accent")} if (name === "accent" && this.data[this.over]) {return this.data[this.over].CoreMO().Get("accent")}
if (name === "accentunder" && this.data[this.under]) {return this.data[this.under].CoreMO().Get("accent")} if (name === "accentunder" && this.data[this.under]) {return this.data[this.under].CoreMO().Get("accent")}
return FALSE; return false;
}, },
adjustChild_displaystyle: function (n) { adjustChild_displaystyle: function (n) {
if (n > 0) {return FALSE} if (n > 0) {return false}
return this.Get("displaystyle"); return this.Get("displaystyle");
}, },
adjustChild_scriptlevel: function (n) { adjustChild_scriptlevel: function (n) {
@ -965,7 +964,7 @@ MathJax.ElementJax.mml.Augment({
return level; return level;
}, },
adjustChild_texprimestyle: function (n) { adjustChild_texprimestyle: function (n) {
if (n === this.base && this.data[this.over]) {return TRUE} if (n === this.base && this.data[this.over]) {return true}
return this.Get("texprimestyle"); return this.Get("texprimestyle");
}, },
setTeXclass: MML.mbase.setBaseTeXclasses setTeXclass: MML.mbase.setBaseTeXclasses
@ -986,7 +985,7 @@ MathJax.ElementJax.mml.Augment({
rowalign: MML.ALIGN.BASELINE, rowalign: MML.ALIGN.BASELINE,
columnalign: MML.ALIGN.CENTER, columnalign: MML.ALIGN.CENTER,
groupalign: "{left}", groupalign: "{left}",
alignmentscope: TRUE, alignmentscope: true,
columnwidth: MML.WIDTH.AUTO, columnwidth: MML.WIDTH.AUTO,
width: MML.WIDTH.AUTO, width: MML.WIDTH.AUTO,
rowspacing: "1ex", rowspacing: "1ex",
@ -995,25 +994,25 @@ MathJax.ElementJax.mml.Augment({
columnlines: MML.LINES.NONE, columnlines: MML.LINES.NONE,
frame: MML.LINES.NONE, frame: MML.LINES.NONE,
framespacing: "0.4em 0.5ex", framespacing: "0.4em 0.5ex",
equalrows: FALSE, equalrows: false,
equalcolumns: FALSE, equalcolumns: false,
displaystyle: FALSE, displaystyle: false,
side: MML.SIDE.RIGHT, side: MML.SIDE.RIGHT,
minlabelspacing: "0.8em", minlabelspacing: "0.8em",
texClass: MML.TEXCLASS.ORD, texClass: MML.TEXCLASS.ORD,
useHeight: 1 useHeight: 1
}, },
inheritFromMe: TRUE, inheritFromMe: true,
noInherit: { noInherit: {
mtable: { mtable: {
align: TRUE, rowalign: TRUE, columnalign: TRUE, groupalign: TRUE, align: true, rowalign: true, columnalign: true, groupalign: true,
alignmentscope: TRUE, columnwidth: TRUE, width: TRUE, rowspacing: TRUE, alignmentscope: true, columnwidth: true, width: true, rowspacing: true,
columnspacing: TRUE, rowlines: TRUE, columnlines: TRUE, frame: TRUE, columnspacing: true, rowlines: true, columnlines: true, frame: true,
framespacing: TRUE, equalrows: TRUE, equalcolumns: TRUE, framespacing: true, equalrows: true, equalcolumns: true,
side: TRUE, minlabelspacing: TRUE, texClass: TRUE, useHeight: 1 side: true, minlabelspacing: true, texClass: true, useHeight: 1
} }
}, },
linebreakContainer: TRUE, linebreakContainer: true,
Append: function () { Append: function () {
for (var i = 0, m = arguments.length; i < m; i++) { for (var i = 0, m = arguments.length; i < m; i++) {
if (!((arguments[i] instanceof MML.mtr) || if (!((arguments[i] instanceof MML.mtr) ||
@ -1033,12 +1032,12 @@ MathJax.ElementJax.mml.Augment({
columnalign: MML.INHERIT, columnalign: MML.INHERIT,
groupalign: MML.INHERIT groupalign: MML.INHERIT
}, },
inheritFromMe: TRUE, inheritFromMe: true,
noInherit: { noInherit: {
mrow: {rowalign: TRUE, columnalign: TRUE, groupalign: TRUE}, mrow: {rowalign: true, columnalign: true, groupalign: true},
mtable: {rowalign: TRUE, columnalign: TRUE, groupalign: TRUE} mtable: {rowalign: true, columnalign: true, groupalign: true}
}, },
linebreakContainer: TRUE, linebreakContainer: true,
Append: function () { Append: function () {
for (var i = 0, m = arguments.length; i < m; i++) { for (var i = 0, m = arguments.length; i < m; i++) {
if (!(arguments[i] instanceof MML.mtd)) {arguments[i] = MML.mtd(arguments[i])} if (!(arguments[i] instanceof MML.mtd)) {arguments[i] = MML.mtd(arguments[i])}
@ -1050,8 +1049,8 @@ MathJax.ElementJax.mml.Augment({
MML.mtd = MML.mbase.Subclass({ MML.mtd = MML.mbase.Subclass({
type: "mtd", type: "mtd",
inferRow: TRUE, inferRow: true,
linebreakContainer: TRUE, linebreakContainer: true,
isEmbellished: MML.mbase.childEmbellished, isEmbellished: MML.mbase.childEmbellished,
Core: MML.mbase.childCore, Core: MML.mbase.childCore,
CoreMO: MML.mbase.childCoreMO, CoreMO: MML.mbase.childCoreMO,
@ -1069,16 +1068,16 @@ MathJax.ElementJax.mml.Augment({
MML.maligngroup = MML.mbase.Subclass({ MML.maligngroup = MML.mbase.Subclass({
type: "malign", type: "malign",
isSpacelike: function () {return TRUE}, isSpacelike: function () {return true},
defaults: { defaults: {
mathbackground: MML.INHERIT, mathbackground: MML.INHERIT,
mathcolor: MML.INHERIT, mathcolor: MML.INHERIT,
groupalign: MML.INHERIT groupalign: MML.INHERIT
}, },
inheritFromMe: TRUE, inheritFromMe: true,
noInherit: { noInherit: {
mrow: {groupalign: TRUE}, mrow: {groupalign: true},
mtable: {groupalign: TRUE} mtable: {groupalign: true}
} }
}); });
@ -1089,7 +1088,7 @@ MathJax.ElementJax.mml.Augment({
mathcolor: MML.INHERIT, mathcolor: MML.INHERIT,
edge: MML.SIDE.LEFT edge: MML.SIDE.LEFT
}, },
isSpacelike: function () {return TRUE} isSpacelike: function () {return true}
}); });
MML.mlabeledtr = MML.mtr.Subclass({ MML.mlabeledtr = MML.mtr.Subclass({
@ -1124,8 +1123,8 @@ MathJax.ElementJax.mml.Augment({
setTeXclass: MML.mbase.setChildTeXclass setTeXclass: MML.mbase.setChildTeXclass
}); });
MML.annotation = MML.mbase.Subclass({ MML.annotation = MML.mbase.Subclass({
type: "annotation", isToken: TRUE, type: "annotation", isToken: true,
linebreakContainer: TRUE, linebreakContainer: true,
defaults: { defaults: {
definitionURL: null, definitionURL: null,
encoding: null, encoding: null,
@ -1175,13 +1174,13 @@ MathJax.ElementJax.mml.Augment({
indentalignlast: MML.INDENTALIGN.INDENTALIGN, indentalignlast: MML.INDENTALIGN.INDENTALIGN,
indentshiftlast: MML.INDENTSHIFT.INDENTSHIFT, indentshiftlast: MML.INDENTSHIFT.INDENTSHIFT,
decimalseparator: ".", decimalseparator: ".",
texprimestyle: FALSE // is it in TeX's C' style? texprimestyle: false // is it in TeX's C' style?
}, },
autoDefault: function (name) { autoDefault: function (name) {
if (name === "displaystyle") {return this.Get("display") === "block"} if (name === "displaystyle") {return this.Get("display") === "block"}
return ""; return "";
}, },
linebreakContainer: TRUE, linebreakContainer: true,
setTeXclass: MML.mbase.setChildTeXclass setTeXclass: MML.mbase.setChildTeXclass
}); });
@ -1253,7 +1252,7 @@ MathJax.ElementJax.mml.Augment({
MML.TeXAtom = MML.mbase.Subclass({ MML.TeXAtom = MML.mbase.Subclass({
type: "texatom", type: "texatom",
inferRow: TRUE, inferRow: true,
texClass: MML.TEXCLASS.ORD, texClass: MML.TEXCLASS.ORD,
setTeXclass: function (prev) { setTeXclass: function (prev) {
this.getPrevClass(prev); this.getPrevClass(prev);

View File

@ -24,7 +24,7 @@
*/ */
(function (TEX,HUB,AJAX) { (function (TEX,HUB,AJAX) {
var TRUE = true, FALSE = false, MML, NBSP = "\u00A0"; var MML, NBSP = "\u00A0";
var STACK = MathJax.Object.Subclass({ var STACK = MathJax.Object.Subclass({
Init: function (env,inner) { Init: function (env,inner) {
@ -39,7 +39,7 @@
item = arguments[i]; item = arguments[i];
if (item instanceof MML.mbase) {item = STACKITEM.mml(item)} if (item instanceof MML.mbase) {item = STACKITEM.mml(item)}
item.global = this.global; item.global = this.global;
top = (this.data.length ? this.Top().checkItem(item) : TRUE); top = (this.data.length ? this.Top().checkItem(item) : true);
if (top instanceof Array) {this.Pop(); this.Push.apply(this,top)} if (top instanceof Array) {this.Pop(); this.Push.apply(this,top)}
else if (top instanceof STACKITEM) {this.Pop(); this.Push(top)} else if (top instanceof STACKITEM) {this.Pop(); this.Push(top)}
else if (top) { else if (top) {
@ -82,19 +82,19 @@
Push: function () {this.data.push.apply(this.data,arguments)}, Push: function () {this.data.push.apply(this.data,arguments)},
Pop: function () {return this.data.pop()}, Pop: function () {return this.data.pop()},
mmlData: function (inferred,forceRow) { mmlData: function (inferred,forceRow) {
if (inferred == null) {inferred = TRUE} if (inferred == null) {inferred = true}
if (this.data.length === 1 && !forceRow) {return this.data[0]} if (this.data.length === 1 && !forceRow) {return this.data[0]}
return MML.mrow.apply(MML,this.data).With((inferred ? {inferred: TRUE}: {})); return MML.mrow.apply(MML,this.data).With((inferred ? {inferred: true}: {}));
}, },
checkItem: function (item) { checkItem: function (item) {
if (item.type === "over" && this.isOpen) {item.num = this.mmlData(FALSE); this.data = []} if (item.type === "over" && this.isOpen) {item.num = this.mmlData(false); this.data = []}
if (item.type === "cell" && this.isOpen) { if (item.type === "cell" && this.isOpen) {
if (item.linebreak) {return FALSE} if (item.linebreak) {return false}
TEX.Error("Misplaced "+item.name); TEX.Error("Misplaced "+item.name);
} }
if (item.isClose && this[item.type+"Error"]) {TEX.Error(this[item.type+"Error"])} if (item.isClose && this[item.type+"Error"]) {TEX.Error(this[item.type+"Error"])}
if (!item.isNotStack) {return TRUE} if (!item.isNotStack) {return true}
this.Push(item.data[0]); return FALSE; this.Push(item.data[0]); return false;
}, },
With: function (def) { With: function (def) {
for (var id in def) {if (def.hasOwnProperty(id)) {this[id] = def[id]}} for (var id in def) {if (def.hasOwnProperty(id)) {this[id] = def[id]}}
@ -104,7 +104,7 @@
}); });
STACKITEM.start = STACKITEM.Subclass({ STACKITEM.start = STACKITEM.Subclass({
type: "start", isOpen: TRUE, type: "start", isOpen: true,
Init: function (global) { Init: function (global) {
this.SUPER(arguments).Init.call(this); this.SUPER(arguments).Init.call(this);
this.global = global; this.global = global;
@ -116,15 +116,15 @@
}); });
STACKITEM.stop = STACKITEM.Subclass({ STACKITEM.stop = STACKITEM.Subclass({
type: "stop", isClose: TRUE type: "stop", isClose: true
}); });
STACKITEM.open = STACKITEM.Subclass({ STACKITEM.open = STACKITEM.Subclass({
type: "open", isOpen: TRUE, type: "open", isOpen: true,
stopError: "Extra open brace or missing close brace", stopError: "Extra open brace or missing close brace",
checkItem: function (item) { checkItem: function (item) {
if (item.type === "close") { if (item.type === "close") {
var mml = this.mmlData(); // this.mmlData(TRUE,TRUE); // force row var mml = this.mmlData(); // this.mmlData(true,true); // force row
return STACKITEM.mml(MML.TeXAtom(mml)); // TeXAtom make it an ORD to prevent spacing (FIXME: should be another way) return STACKITEM.mml(MML.TeXAtom(mml)); // TeXAtom make it an ORD to prevent spacing (FIXME: should be another way)
} }
return this.SUPER(arguments).checkItem.call(this,item); return this.SUPER(arguments).checkItem.call(this,item);
@ -132,7 +132,7 @@
}); });
STACKITEM.close = STACKITEM.Subclass({ STACKITEM.close = STACKITEM.Subclass({
type: "close", isClose: TRUE type: "close", isClose: true
}); });
STACKITEM.subsup = STACKITEM.Subclass({ STACKITEM.subsup = STACKITEM.Subclass({
@ -140,7 +140,7 @@
stopError: "Missing superscript or subscript argument", stopError: "Missing superscript or subscript argument",
checkItem: function (item) { checkItem: function (item) {
var script = ["","subscript","superscript"][this.position]; var script = ["","subscript","superscript"][this.position];
if (item.type === "open" || item.type === "left") {return TRUE} if (item.type === "open" || item.type === "left") {return true}
if (item.type === "mml") { if (item.type === "mml") {
this.data[0].SetData(this.position,item.data[0]); this.data[0].SetData(this.position,item.data[0]);
return STACKITEM.mml(this.data[0]); return STACKITEM.mml(this.data[0]);
@ -152,15 +152,15 @@
}); });
STACKITEM.over = STACKITEM.Subclass({ STACKITEM.over = STACKITEM.Subclass({
type: "over", isClose: TRUE, name: "\\over", type: "over", isClose: true, name: "\\over",
checkItem: function (item,stack) { checkItem: function (item,stack) {
if (item.type === "over") {TEX.Error("Ambiguous use of "+item.name)} if (item.type === "over") {TEX.Error("Ambiguous use of "+item.name)}
if (item.isClose) { if (item.isClose) {
var mml = MML.mfrac(this.num,this.mmlData(FALSE)); var mml = MML.mfrac(this.num,this.mmlData(false));
if (this.thickness != null) {mml.linethickness = this.thickness} if (this.thickness != null) {mml.linethickness = this.thickness}
if (this.open || this.close) { if (this.open || this.close) {
mml.texClass = MML.TEXCLASS.INNER; mml.texClass = MML.TEXCLASS.INNER;
mml.texWithDelims = TRUE; mml.texWithDelims = true;
mml = MML.mfenced(mml).With({open: this.open, close: this.close}); mml = MML.mfenced(mml).With({open: this.open, close: this.close});
} }
return [STACKITEM.mml(mml), item]; return [STACKITEM.mml(mml), item];
@ -171,7 +171,7 @@
}); });
STACKITEM.left = STACKITEM.Subclass({ STACKITEM.left = STACKITEM.Subclass({
type: "left", isOpen: TRUE, delim: '(', type: "left", isOpen: true, delim: '(',
stopError: "Extra \\left or missing \\right", stopError: "Extra \\left or missing \\right",
checkItem: function (item) { checkItem: function (item) {
if (item.type === "right") { if (item.type === "right") {
@ -183,11 +183,11 @@
}); });
STACKITEM.right = STACKITEM.Subclass({ STACKITEM.right = STACKITEM.Subclass({
type: "right", isClose: TRUE, delim: ')' type: "right", isClose: true, delim: ')'
}); });
STACKITEM.begin = STACKITEM.Subclass({ STACKITEM.begin = STACKITEM.Subclass({
type: "begin", isOpen: TRUE, type: "begin", isOpen: true,
checkItem: function (item) { checkItem: function (item) {
if (item.type === "end") { if (item.type === "end") {
if (item.name !== this.name) if (item.name !== this.name)
@ -201,7 +201,7 @@
}); });
STACKITEM.end = STACKITEM.Subclass({ STACKITEM.end = STACKITEM.Subclass({
type: "end", isClose: TRUE type: "end", isClose: true
}); });
STACKITEM.style = STACKITEM.Subclass({ STACKITEM.style = STACKITEM.Subclass({
@ -232,15 +232,15 @@
}); });
STACKITEM.array = STACKITEM.Subclass({ STACKITEM.array = STACKITEM.Subclass({
type: "array", isOpen: TRUE, arraydef: {}, type: "array", isOpen: true, arraydef: {},
Init: function () { Init: function () {
this.table = []; this.row = []; this.env = {}; this.frame = [] this.table = []; this.row = []; this.env = {}; this.frame = []
this.SUPER(arguments).Init.apply(this,arguments); this.SUPER(arguments).Init.apply(this,arguments);
}, },
checkItem: function (item) { checkItem: function (item) {
if (item.isClose && item.type !== "over") { if (item.isClose && item.type !== "over") {
if (item.isEntry) {this.EndEntry(); this.clearEnv(); return FALSE} if (item.isEntry) {this.EndEntry(); this.clearEnv(); return false}
if (item.isCR) {this.EndEntry(); this.EndRow(); this.clearEnv(); return FALSE} if (item.isCR) {this.EndEntry(); this.EndRow(); this.clearEnv(); return false}
this.EndTable(); this.clearEnv(); this.EndTable(); this.clearEnv();
var mml = MML.mtable.apply(MML,this.table).With(this.arraydef); var mml = MML.mtable.apply(MML,this.table).With(this.arraydef);
if (this.frame.length === 4) { if (this.frame.length === 4) {
@ -292,11 +292,11 @@
}); });
STACKITEM.cell = STACKITEM.Subclass({ STACKITEM.cell = STACKITEM.Subclass({
type: "cell", isClose: TRUE type: "cell", isClose: true
}); });
STACKITEM.mml = STACKITEM.Subclass({ STACKITEM.mml = STACKITEM.Subclass({
type: "mml", isNotStack: TRUE, type: "mml", isNotStack: true,
Add: function () {this.data.push.apply(this.data,arguments); return this} Add: function () {this.data.push.apply(this.data,arguments); return this}
}); });
@ -429,24 +429,24 @@
surd: '221A', surd: '221A',
// big ops // big ops
coprod: ['2210',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}], coprod: ['2210',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
bigvee: ['22C1',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}], bigvee: ['22C1',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
bigwedge: ['22C0',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}], bigwedge: ['22C0',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
biguplus: ['2A04',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}], biguplus: ['2A04',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
bigcap: ['22C2',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}], bigcap: ['22C2',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
bigcup: ['22C3',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}], bigcup: ['22C3',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
'int': ['222B',{texClass: MML.TEXCLASS.OP}], 'int': ['222B',{texClass: MML.TEXCLASS.OP}],
intop: ['222B',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE, movablelimits:TRUE}], intop: ['222B',{texClass: MML.TEXCLASS.OP, movesupsub:true, movablelimits:true}],
iint: ['222C',{texClass: MML.TEXCLASS.OP}], iint: ['222C',{texClass: MML.TEXCLASS.OP}],
iiint: ['222D',{texClass: MML.TEXCLASS.OP}], iiint: ['222D',{texClass: MML.TEXCLASS.OP}],
prod: ['220F',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}], prod: ['220F',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
sum: ['2211',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}], sum: ['2211',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
bigotimes: ['2A02',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}], bigotimes: ['2A02',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
bigoplus: ['2A01',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}], bigoplus: ['2A01',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
bigodot: ['2A00',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}], bigodot: ['2A00',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
oint: ['222E',{texClass: MML.TEXCLASS.OP}], oint: ['222E',{texClass: MML.TEXCLASS.OP}],
bigsqcup: ['2A06',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}], bigsqcup: ['2A06',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
smallint: ['222B',{largeop:FALSE}], smallint: ['222B',{largeop:false}],
// binary operations // binary operations
triangleleft: '25C3', triangleleft: '25C3',
@ -469,11 +469,11 @@
bullet: '2219', bullet: '2219',
wr: '2240', wr: '2240',
div: '00F7', div: '00F7',
odot: ['2299',{largeop: FALSE}], odot: ['2299',{largeop: false}],
oslash: ['2298',{largeop: FALSE}], oslash: ['2298',{largeop: false}],
otimes: ['2297',{largeop: FALSE}], otimes: ['2297',{largeop: false}],
ominus: ['2296',{largeop: FALSE}], ominus: ['2296',{largeop: false}],
oplus: ['2295',{largeop: FALSE}], oplus: ['2295',{largeop: false}],
mp: '2213', mp: '2213',
pm: '00B1', pm: '00B1',
circ: '2218', circ: '2218',
@ -643,10 +643,10 @@
}, },
macros: { macros: {
displaystyle: ['SetStyle','D',TRUE,0], displaystyle: ['SetStyle','D',true,0],
textstyle: ['SetStyle','T',FALSE,0], textstyle: ['SetStyle','T',false,0],
scriptstyle: ['SetStyle','S',FALSE,1], scriptstyle: ['SetStyle','S',false,1],
scriptscriptstyle: ['SetStyle','SS',FALSE,2], scriptscriptstyle: ['SetStyle','SS',false,2],
rm: ['SetFont',MML.VARIANT.NORMAL], rm: ['SetFont',MML.VARIANT.NORMAL],
mit: ['SetFont',MML.VARIANT.ITALIC], mit: ['SetFont',MML.VARIANT.ITALIC],
@ -1094,7 +1094,7 @@
position = base.sup; position = base.sup;
} else if (base.movesupsub) { } else if (base.movesupsub) {
if (base.type !== "munderover" || base.data[base.over]) if (base.type !== "munderover" || base.data[base.over])
{base = MML.munderover(base,null,null).With({movesupsub:TRUE})} {base = MML.munderover(base,null,null).With({movesupsub:true})}
position = base.over; position = base.over;
} else { } else {
base = MML.msubsup(base,null,null); base = MML.msubsup(base,null,null);
@ -1110,7 +1110,7 @@
position = base.sub; position = base.sub;
} else if (base.movesupsub) { } else if (base.movesupsub) {
if (base.type !== "munderover" || base.data[base.under]) if (base.type !== "munderover" || base.data[base.under])
{base = MML.munderover(base,null,null).With({movesupsub:TRUE})} {base = MML.munderover(base,null,null).With({movesupsub:true})}
position = base.under; position = base.under;
} else { } else {
base = MML.msubsup(base,null,null); base = MML.msubsup(base,null,null);
@ -1126,7 +1126,7 @@
var sup = ""; this.i--; var sup = ""; this.i--;
do {sup += this.PRIME; this.i++, c = this.GetNext()} do {sup += this.PRIME; this.i++, c = this.GetNext()}
while (c === "'" || c === this.SMARTQUOTE); while (c === "'" || c === this.SMARTQUOTE);
sup = this.mmlToken(MML.mo(MML.chars(sup)).With({isPrime: TRUE, variantForm: TEX.isSTIX})); sup = this.mmlToken(MML.mo(MML.chars(sup)).With({isPrime: true, variantForm: TEX.isSTIX}));
this.Push(MML.msup(base,sup)); this.Push(MML.msup(base,sup));
}, },
@ -1201,8 +1201,8 @@
if (!id) {id = name.substr(1)}; if (!id) {id = name.substr(1)};
id = id.replace(/&thinsp;/,"\u2006"); id = id.replace(/&thinsp;/,"\u2006");
var mml = MML.mo(id).With({ var mml = MML.mo(id).With({
movablelimits: TRUE, movablelimits: true,
movesupsub: TRUE, movesupsub: true,
form: MML.FORM.PREFIX, form: MML.FORM.PREFIX,
texClass: MML.TEXCLASS.OP texClass: MML.TEXCLASS.OP
}); });
@ -1212,8 +1212,8 @@
Limits: function (name,limits) { Limits: function (name,limits) {
var op = this.stack.Prev("nopop"); var op = this.stack.Prev("nopop");
if (op.texClass !== MML.TEXCLASS.OP) {TEX.Error(name+" is allowed only on operators")} if (op.texClass !== MML.TEXCLASS.OP) {TEX.Error(name+" is allowed only on operators")}
op.movesupsub = (limits ? TRUE : FALSE); op.movesupsub = (limits ? true : false);
op.movablelimits = FALSE; op.movablelimits = false;
}, },
Over: function (name,open,close) { Over: function (name,open,close) {
@ -1273,8 +1273,8 @@
var c = this.ParseArg(name); var c = this.ParseArg(name);
var def = {accent: true}; if (this.stack.env.font) {def.mathvariant = this.stack.env.font} var def = {accent: true}; if (this.stack.env.font) {def.mathvariant = this.stack.env.font}
var mml = this.mmlToken(MML.mo(MML.entity("#x"+accent)).With(def)); var mml = this.mmlToken(MML.mo(MML.entity("#x"+accent)).With(def));
mml.stretchy = (stretchy ? TRUE : FALSE); mml.stretchy = (stretchy ? true : false);
this.Push(MML.TeXAtom(MML.munderover(c,null,mml).With({accent: TRUE}))); this.Push(MML.TeXAtom(MML.munderover(c,null,mml).With({accent: true})));
}, },
UnderOver: function (name,c,stack) { UnderOver: function (name,c,stack) {
@ -1282,9 +1282,9 @@
var base = this.ParseArg(name); var base = this.ParseArg(name);
if (base.Get("movablelimits")) {base.movablelimits = false} if (base.Get("movablelimits")) {base.movablelimits = false}
var mml = MML.munderover(base,null,null); var mml = MML.munderover(base,null,null);
if (stack) {mml.movesupsub = TRUE} if (stack) {mml.movesupsub = true}
mml.data[mml[pos]] = mml.data[mml[pos]] =
this.mmlToken(MML.mo(MML.entity("#x"+c)).With({stretchy:TRUE, accent:(pos == "under")})); this.mmlToken(MML.mo(MML.entity("#x"+c)).With({stretchy:true, accent:(pos == "under")}));
this.Push(mml); this.Push(mml);
}, },
@ -1300,7 +1300,7 @@
TeXAtom: function (name,mclass) { TeXAtom: function (name,mclass) {
var def = {texClass: mclass}, mml; var def = {texClass: mclass}, mml;
if (mclass == MML.TEXCLASS.OP) { if (mclass == MML.TEXCLASS.OP) {
def.movesupsub = def.movablelimits = TRUE; def.movesupsub = def.movablelimits = true;
var arg = this.GetArgument(name); var arg = this.GetArgument(name);
var match = arg.match(/^\s*\\rm\s+([a-zA-Z0-9 ]+)$/); var match = arg.match(/^\s*\\rm\s+([a-zA-Z0-9 ]+)$/);
if (match) { if (match) {
@ -1411,7 +1411,7 @@
var delim = this.GetDelimiter(name); var delim = this.GetDelimiter(name);
this.Push(MML.TeXAtom(MML.mo(delim).With({ this.Push(MML.TeXAtom(MML.mo(delim).With({
minsize: size, maxsize: size, scriptlevel: 0, minsize: size, maxsize: size, scriptlevel: 0,
fence: TRUE, stretchy: TRUE, symmetric: TRUE fence: true, stretchy: true, symmetric: true
})).With({texClass: mclass})); })).With({texClass: mclass}));
}, },
@ -1464,21 +1464,21 @@
var c = this.GetNext(); if (c === "") {TEX.Error("Missing argument for "+name)} var c = this.GetNext(); if (c === "") {TEX.Error("Missing argument for "+name)}
if (c === "{") {this.i++} else {this.string = c+"}"+this.string.slice(this.i+1); this.i = 0} if (c === "{") {this.i++} else {this.string = c+"}"+this.string.slice(this.i+1); this.i = 0}
var array = STACKITEM.array().With({ var array = STACKITEM.array().With({
requireClose: TRUE, requireClose: true,
arraydef: { arraydef: {
rowspacing: (vspacing||"4pt"), rowspacing: (vspacing||"4pt"),
columnspacing: (spacing||"1em") columnspacing: (spacing||"1em")
} }
}); });
if (cases) {array.isCases = TRUE} if (cases) {array.isCases = true}
if (open || close) {array.open = open; array.close = close} if (open || close) {array.open = open; array.close = close}
if (style === "D") {array.arraydef.displaystyle = TRUE} if (style === "D") {array.arraydef.displaystyle = true}
if (align != null) {array.arraydef.columnalign = align} if (align != null) {array.arraydef.columnalign = align}
this.Push(array); this.Push(array);
}, },
Entry: function (name) { Entry: function (name) {
this.Push(STACKITEM.cell().With({isEntry: TRUE, name: name})); this.Push(STACKITEM.cell().With({isEntry: true, name: name}));
if (this.stack.Top().isCases) { if (this.stack.Top().isCases) {
var string = this.string; var string = this.string;
var braces = 0, i = this.i, m = string.length; var braces = 0, i = this.i, m = string.length;
@ -1500,14 +1500,14 @@
}, },
Cr: function (name) { Cr: function (name) {
this.Push(STACKITEM.cell().With({isCR: TRUE, name: name})); this.Push(STACKITEM.cell().With({isCR: true, name: name}));
}, },
CrLaTeX: function (name) { CrLaTeX: function (name) {
var n = this.GetBrackets(name,"").replace(/ /g,""); var n = this.GetBrackets(name,"").replace(/ /g,"");
if (n && !n.match(/^(((\.\d+|\d+(\.\d*)?))(pt|em|ex|mu|mm|cm|in|pc))$/)) if (n && !n.match(/^(((\.\d+|\d+(\.\d*)?))(pt|em|ex|mu|mm|cm|in|pc))$/))
{TEX.Error("Bracket argument to "+name+" must be a dimension")} {TEX.Error("Bracket argument to "+name+" must be a dimension")}
this.Push(STACKITEM.cell().With({isCR: TRUE, name: name, linebreak: TRUE})); this.Push(STACKITEM.cell().With({isCR: true, name: name, linebreak: true}));
var top = this.stack.Top(); var top = this.stack.Top();
if (top.isa(STACKITEM.array)) { if (top.isa(STACKITEM.array)) {
if (n && top.arraydef.rowspacing) { if (n && top.arraydef.rowspacing) {
@ -1597,9 +1597,9 @@
} }
if (open) {array.open = this.convertDelimiter(open)} if (open) {array.open = this.convertDelimiter(open)}
if (close) {array.close = this.convertDelimiter(close)} if (close) {array.close = this.convertDelimiter(close)}
if (style === "D") {array.arraydef.displaystyle = TRUE} if (style === "D") {array.arraydef.displaystyle = true}
if (style === "S") {array.arraydef.scriptlevel = 1} // FIXME: should use mstyle? if (style === "S") {array.arraydef.scriptlevel = 1} // FIXME: should use mstyle?
if (raggedHeight) {array.arraydef.useHeight = FALSE} if (raggedHeight) {array.arraydef.useHeight = false}
this.Push(begin); this.Push(begin);
return array; return array;
}, },
@ -1784,7 +1784,7 @@
* @@@ FIXME: pass environment to TEX.Parse? @@@ * @@@ FIXME: pass environment to TEX.Parse? @@@
*/ */
InternalMath: function (text,level) { InternalMath: function (text,level) {
var def = {displaystyle: FALSE}; if (level != null) {def.scriptlevel = level} var def = {displaystyle: false}; if (level != null) {def.scriptlevel = level}
if (this.stack.env.font) {def.mathvariant = this.stack.env.font} if (this.stack.env.font) {def.mathvariant = this.stack.env.font}
if (!text.match(/\$|\\\(|\\(eq)?ref\s*\{/)) {return [this.InternalText(text,def)]} if (!text.match(/\$|\\\(|\\(eq)?ref\s*\{/)) {return [this.InternalText(text,def)]}
var i = 0, k = 0, c, match = ''; var i = 0, k = 0, c, match = '';
@ -1931,7 +1931,7 @@
// Produce an error and stop processing this equation // Produce an error and stop processing this equation
// //
Error: function (message) { Error: function (message) {
throw HUB.Insert(Error(message),{texError: TRUE}); throw HUB.Insert(Error(message),{texError: true});
}, },
// //