afg-website/static/js/mathjax/input/tex/extensions/ams.js

1 line
23 KiB
JavaScript
Raw Normal View History

2024-05-11 13:51:37 +02:00
!function(t){var e={};function a(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=t,a.c=e,a.d=function(t,e,r){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)a.d(r,n,function(e){return t[e]}.bind(null,n));return r},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=18)}([function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NEW_OPS=e.AmsMethods=void 0;var r=a(1),n=a(4),i=a(2),o=a(13),l=a(5),s=a(14),m=a(15),u=a(6);e.AmsMethods={},e.AmsMethods.AmsEqnArray=function(t,e,a,n,i,o,l){var s=t.GetBrackets("\\begin{"+e.getName()+"}"),u=m.default.EqnArray(t,e,a,n,i,o,l);return r.default.setArrayAlign(u,s)},e.AmsMethods.AlignAt=function(t,a,n,i){var o,s,m=a.getName(),u="",c=[];if(i||(s=t.GetBrackets("\\begin{"+m+"}")),(o=t.GetArgument("\\begin{"+m+"}")).match(/[^0-9]/))throw new l.default("PositiveIntegerArg","Argument to %1 must me a positive integer","\\begin{"+m+"}");for(var d=parseInt(o,10);d>0;)u+="rl",c.push("0em 0em"),d--;var h=c.join(" ");if(i)return e.AmsMethods.EqnArray(t,a,n,i,u,h);var p=e.AmsMethods.EqnArray(t,a,n,i,u,h);return r.default.setArrayAlign(p,s)},e.AmsMethods.Multline=function(t,e,a){t.Push(e),r.default.checkEqnEnv(t);var n=t.itemFactory.create("multline",a,t.stack);return n.arraydef={displaystyle:!0,rowspacing:".5em",columnwidth:"100%",width:t.options.multlineWidth,side:t.options.tagSide,minlabelspacing:t.options.tagIndent},n},e.NEW_OPS="ams-declare-ops",e.AmsMethods.HandleDeclareOp=function(t,a){var n=t.GetStar()?"":"\\nolimits\\SkipLimits",i=r.default.trimSpaces(t.GetArgument(a));"\\"===i.charAt(0)&&(i=i.substr(1));var o=t.GetArgument(a);o.match(/\\text/)||(o=o.replace(/\*/g,"\\text{*}").replace(/-/g,"\\text{-}")),t.configuration.handlers.retrieve(e.NEW_OPS).add(i,new s.Macro(i,e.AmsMethods.Macro,["\\mathop{\\rm "+o+"}"+n]))},e.AmsMethods.HandleOperatorName=function(t,e){var a=t.GetStar()?"":"\\nolimits\\SkipLimits",n=r.default.trimSpaces(t.GetArgument(e));n.match(/\\text/)||(n=n.replace(/\*/g,"\\text{*}").replace(/-/g,"\\text{-}")),t.string="\\mathop{\\rm "+n+"}"+a+" "+t.string.slice(t.i),t.i=0},e.AmsMethods.SkipLimits=function(t,e){var a=t.GetNext(),r=t.i;"\\"===a&&++t.i&&"limits"!==t.GetCS()&&(t.i=r)},e.AmsMethods.MultiIntegral=function(t,e,a){var r=t.GetNext();if("\\"===r){var n=t.i;r=t.GetArgument(e),t.i=n,"\\limits"===r&&(a="\\idotsint"===e?"\\!\\!\\mathop{\\,\\,"+a+"}":"\\!\\!\\!\\mathop{\\,\\,\\,"+a+"}")}t.string=a+" "+t.string.slice(t.i),t.i=0},e.AmsMethods.xArrow=function(t,e,a,i,l){var s={width:"+"+r.default.Em((i+l)/18),lspace:r.default.Em(i/18)},m=t.GetBrackets(e),c=t.ParseArg(e),d=t.create("token","mo",{stretchy:!0,texClass:u.TEXCLASS.REL},String.fromCodePoint(a)),h=t.create("node","munderover",[d]),p=t.create("node","mpadded",[c],s);if(n.default.setAttribute(p,"voffset",".15em"),n.default.setChild(h,h.over,p),m){var f=new o.default(m,t.stack.env,t.configuration).mml();p=t.create("node","mpadded",[f],s),n.default.setAttribute(p,"voffset","-.24em"),n.default.setChild(h,h.under,p)}n.default.setProperty(h,"subsupOK",!0),t.Push(h)},e.AmsMethods.HandleShove=function(t,e,a){var r=t.stack.Top();if("multline"!==r.kind)throw new l.default("CommandOnlyAllowedInEnv","%1 only allowed in %2 environment",t.currentCS,"multline");if(r.Size())throw new l.default("CommandAtTheBeginingOfLine","%1 must come at the beginning of the line",t.currentCS);r.setProperty("shove",a)},e.AmsMethods.CFrac=function(t,e){var a=r.default.trimSpaces(t.GetBrackets(e,"")),s=t