Merge branch 'issue1225' into develop. Issue #1225.

This commit is contained in:
Davide P. Cervone 2015-08-02 08:55:52 -04:00
commit 930e35a39d

View File

@ -99,6 +99,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
DeclareMathOperator: 'HandleDeclareOp', DeclareMathOperator: 'HandleDeclareOp',
operatorname: 'HandleOperatorName', operatorname: 'HandleOperatorName',
SkipLimits: 'SkipLimits',
genfrac: 'Genfrac', genfrac: 'Genfrac',
frac: ['Genfrac',"","","",""], frac: ['Genfrac',"","","",""],
@ -210,7 +211,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
* Handle \DeclareMathOperator * Handle \DeclareMathOperator
*/ */
HandleDeclareOp: function (name) { HandleDeclareOp: function (name) {
var limits = (this.GetStar() ? "" : "\\nolimits"); var limits = (this.GetStar() ? "" : "\\nolimits\\SkipLimits");
var cs = this.trimSpaces(this.GetArgument(name)); var cs = this.trimSpaces(this.GetArgument(name));
if (cs.charAt(0) == "\\") {cs = cs.substr(1)} if (cs.charAt(0) == "\\") {cs = cs.substr(1)}
var op = this.GetArgument(name); var op = this.GetArgument(name);
@ -219,13 +220,18 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
}, },
HandleOperatorName: function (name) { HandleOperatorName: function (name) {
var limits = (this.GetStar() ? "" : "\\nolimits"); var limits = (this.GetStar() ? "" : "\\nolimits\\SkipLimits");
var op = this.trimSpaces(this.GetArgument(name)); var op = this.trimSpaces(this.GetArgument(name));
op = op.replace(/\*/g,'\\text{*}').replace(/-/g,'\\text{-}'); op = op.replace(/\*/g,'\\text{*}').replace(/-/g,'\\text{-}');
this.string = '\\mathop{\\rm '+op+'}'+limits+" "+this.string.slice(this.i); this.string = '\\mathop{\\rm '+op+'}'+limits+" "+this.string.slice(this.i);
this.i = 0; this.i = 0;
}, },
SkipLimits: function (name) {
var c = this.GetNext(), i = this.i;
if (c === "\\" && ++this.i && this.GetCS() !== "limits") this.i = i;
},
/* /*
* Record presence of \shoveleft and \shoveright * Record presence of \shoveleft and \shoveright
*/ */