www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 1de28f5a9af1029f145682ce4ad22fbb800f29cc
parent 24f0388bda426319ca60448d6aa1a082fe8bb233
Author: Davide P. Cervone <dpvc@union.edu>
Date:   Thu, 30 Jul 2015 09:45:45 -0400

Make \operatorname and \DeclareMathOperator skip \limits if it follows them.  Resolves issue #1225.

Diffstat:
Munpacked/extensions/TeX/AMSmath.js | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/unpacked/extensions/TeX/AMSmath.js b/unpacked/extensions/TeX/AMSmath.js @@ -99,6 +99,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { DeclareMathOperator: 'HandleDeclareOp', operatorname: 'HandleOperatorName', + SkipLimits: 'SkipLimits', genfrac: 'Genfrac', frac: ['Genfrac',"","","",""], @@ -210,7 +211,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { * Handle \DeclareMathOperator */ HandleDeclareOp: function (name) { - var limits = (this.GetStar() ? "" : "\\nolimits"); + var limits = (this.GetStar() ? "" : "\\nolimits\\SkipLimits"); var cs = this.trimSpaces(this.GetArgument(name)); if (cs.charAt(0) == "\\") {cs = cs.substr(1)} var op = this.GetArgument(name); @@ -219,13 +220,18 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () { }, HandleOperatorName: function (name) { - var limits = (this.GetStar() ? "" : "\\nolimits"); + var limits = (this.GetStar() ? "" : "\\nolimits\\SkipLimits"); var op = this.trimSpaces(this.GetArgument(name)); op = op.replace(/\*/g,'\\text{*}').replace(/-/g,'\\text{-}'); this.string = '\\mathop{\\rm '+op+'}'+limits+" "+this.string.slice(this.i); 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 */