Merge 'issue211' into issue234
This commit is contained in:
commit
700a24ba65
File diff suppressed because one or more lines are too long
|
@ -136,7 +136,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
},
|
},
|
||||||
|
|
||||||
//
|
//
|
||||||
// Make a number of fraction preceeding an atom,
|
// Make a number or fraction preceeding an atom,
|
||||||
// or a subscript for an atom.
|
// or a subscript for an atom.
|
||||||
//
|
//
|
||||||
ParseNumber: function () {
|
ParseNumber: function () {
|
||||||
|
@ -215,7 +215,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
c = this.string.charAt(++this.i);
|
c = this.string.charAt(++this.i);
|
||||||
if (c === "{") {
|
if (c === "{") {
|
||||||
this.i++; var m = this.Find("}");
|
this.i++; var m = this.Find("}");
|
||||||
if (m === "-.") {this.sup += "{-}{\\cdot}"} else if (m) {this.sup += CE(m).Parse()}
|
if (m === "-.") {this.sup += "{-}{\\cdot}"}
|
||||||
|
else if (m) {this.sup += CE(m).Parse().replace(/^\{-\}/,"-")}
|
||||||
} else if (c === " " || c === "") {
|
} else if (c === " " || c === "") {
|
||||||
this.tex += "{\\"+this.Arrows["^"]+"}"; this.i++;
|
this.tex += "{\\"+this.Arrows["^"]+"}"; this.i++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -228,7 +229,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
//
|
//
|
||||||
ParseSubscript: function (c) {
|
ParseSubscript: function (c) {
|
||||||
if (this.string.charAt(++this.i) == "{") {
|
if (this.string.charAt(++this.i) == "{") {
|
||||||
this.i++; this.sub += CE(this.Find("}")).Parse();
|
this.i++; this.sub += CE(this.Find("}")).Parse().replace(/^\{-\}/,"-");
|
||||||
} else {
|
} else {
|
||||||
var n = this.Match(/^\d+/);
|
var n = this.Match(/^\d+/);
|
||||||
if (n) {this.sub += n}
|
if (n) {this.sub += n}
|
||||||
|
@ -300,15 +301,15 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
//
|
//
|
||||||
// right-justify super- and subscripts when they are before the atom
|
// right-justify super- and subscripts when they are before the atom
|
||||||
//
|
//
|
||||||
var n = Math.abs(this.sup.length-this.sub.length);
|
var sup = this.sup, sub = this.sub;
|
||||||
if (n) {
|
if (!sup.match(/\d/)) {sup += "\\vphantom{0}"} // force common heights
|
||||||
var zeros = "0000000000".substr(0,n);
|
if (!sub.match(/\d/)) {sub += "\\vphantom{0}"}
|
||||||
var script = (this.sup.length > this.sub.length ? "sub" : "sup");
|
this.tex += "\\raise 1pt{\\scriptstyle\\begin{CEscriptstack}"+sup+"\\\\"+
|
||||||
this[script] = "\\phantom{"+zeros+"}" + this[script];
|
sub+"\\end{CEscriptstack}}\\kern-.125em ";
|
||||||
}
|
} else {
|
||||||
|
if (!this.sup) {this.sup = "\\Space{0pt}{0pt}{.2em}"} // forces subscripts to align properly
|
||||||
|
this.tex += "^{"+this.sup+"}_{"+this.sub+"}";
|
||||||
}
|
}
|
||||||
if (!this.sup) {this.sup = "\\Space{0pt}{0pt}{.2em}"} // forces subscripts to align properly
|
|
||||||
this.tex += "^{"+this.sup+"}_{"+this.sub+"}";
|
|
||||||
this.sup = this.sub = "";
|
this.sup = this.sub = "";
|
||||||
}
|
}
|
||||||
this.atom = false;
|
this.atom = false;
|
||||||
|
@ -358,6 +359,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
MathJax.Extension["TeX/mhchem"].CE = CE;
|
||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
|
@ -398,7 +400,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
// Needed for \bond for the ~ forms
|
// Needed for \bond for the ~ forms
|
||||||
//
|
//
|
||||||
environment: {
|
environment: {
|
||||||
CEstack: ['Array',null,null,null,'r',null,"0.001em",'T',1]
|
CEstack: ['Array',null,null,null,'r',null,"0.001em",'T',1],
|
||||||
|
CEscriptstack: ['Array',null,null,null,'r',null,"0.2em",'S',1]
|
||||||
}
|
}
|
||||||
},null,true);
|
},null,true);
|
||||||
|
|
||||||
|
@ -428,7 +431,6 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
},null,true);
|
},null,true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
TEX.Parse.Augment({
|
TEX.Parse.Augment({
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue
Block a user