UNPKG

mathjax

Version:

Beautiful and accessible math in all browsers. MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all browsers. This package includes the packaged components (install mathjax-full to get the source

1 lines 22.4 kB
(()=>{"use strict";var t={d:(e,a)=>{for(var r in a)t.o(a,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{MathtoolsUtil:()=>H});var a={};t.r(a),t.d(a,{LEGACYCONFIG:()=>W,LEGACYPRIORITY:()=>z,MathtoolsMethods:()=>K});var r={};t.r(r),t.d(r,{MathtoolsTagFormat:()=>tt});var o={};t.r(o),t.d(o,{MultlinedItem:()=>rt});var n={};t.r(n),t.d(n,{MathtoolsConfiguration:()=>nt,fixPrescripts:()=>ot});const s=("undefined"!=typeof window?window:t.g).MathJax._.components.global,l=(s.GLOBAL,s.isObject,s.combineConfig,s.combineDefaults,s.combineWithMathJax),i=(s.MathJax,MathJax._.input.tex.HandlerTypes),m=i.ConfigurationType,c=i.HandlerType,d=MathJax._.input.tex.Configuration,h=d.Configuration,p=(d.ConfigurationHandler,d.ParserConfiguration,MathJax._.input.tex.Token),u=(p.Token,p.Macro),g=MathJax._.input.tex.NodeUtil.default,M=MathJax._.util.Options,x=(M.isObject,M.APPEND,M.REMOVE,M.OPTIONS,M.Expandable,M.expandable),w=(M.makeArray,M.keys,M.copy,M.insert,M.defaultOptions,M.userOptions,M.selectOptions,M.selectOptionsFromKeys,M.separateOptions,M.lookup),f=MathJax._.input.tex.newcommand.NewcommandConfiguration,A=f.NewcommandConfig,y=(f.NewcommandConfiguration,MathJax._.input.tex.newcommand.NewcommandUtil),b=y.NewcommandTables,P=(y.NewcommandPriority,y.NewcommandUtil),C=MathJax._.input.tex.ParseMethods.default,T=MathJax._.input.tex.TokenMap,k=(T.parseResult,T.AbstractTokenMap,T.RegExpMap,T.AbstractParseMap,T.CharacterMap,T.DelimiterMap),v=(T.MacroMap,T.CommandMap),S=T.EnvironmentMap,D=MathJax._.input.tex.TexConstants.TexConstant,E=MathJax._.input.tex.ParseUtil,N=(E.KeyValueDef,E.KeyValueTypes,E.ParseUtil),G=MathJax._.input.tex.UnitUtil.UnitUtil,R=MathJax._.input.tex.ams.AmsMethods.AmsMethods,I=MathJax._.input.tex.base.BaseMethods,O=(I.splitAlignArray,I.default),L=MathJax._.input.tex.TexParser.default,F=MathJax._.input.tex.TexError.default,B=MathJax._.core.MmlTree.MmlNode,_=B.TEXCLASS,J=(B.TEXCLASSNAMES,B.MATHVARIANTS,B.indentAttributes,B.AbstractMmlNode,B.AbstractMmlTokenNode,B.AbstractMmlLayoutNode,B.AbstractMmlBaseNode,B.AbstractMmlEmptyNode,B.TextNode,B.XMLNode,MathJax._.util.lengths),q=(J.BIGDIMEN,J.UNITS,J.RELUNITS,J.MATHSPACE,J.length2em),U=(J.percent,J.em),j=(J.px,MathJax._.input.tex.newcommand.NewcommandMethods.default),$=MathJax._.util.PrioritizedList.PrioritizedList,V=MathJax._.input.tex.base.BaseItems,X=(V.StartItem,V.StopItem,V.OpenItem,V.CloseItem,V.NullItem,V.PrimeItem,V.SubsupItem,V.OverItem,V.LeftItem,V.Middle,V.RightItem,V.BreakItem,V.BeginItem,V.EndItem,V.StyleItem,V.PositionItem,V.CellItem,V.MmlItem,V.FnItem,V.NotItem,V.NonscriptItem,V.DotsItem,V.ArrayItem,V.EqnArrayItem),H=(V.MstyleItem,V.EquationItem,{setDisplayLevel(t,e){if(!e)return;const[a,r]=w(e,{"\\displaystyle":[!0,0],"\\textstyle":[!1,0],"\\scriptstyle":[!1,1],"\\scriptscriptstyle":[!1,2]},[null,null]);null!==a&&(t.attributes.set("displaystyle",a),t.attributes.set("scriptlevel",r))},checkAlignment(t,e){const a=t.stack.Top();if(a.kind!==X.prototype.kind)throw new F("NotInAlignment","%1 can only be used in aligment environments",e);return a},addPairedDelims(t,e,a){if(t.configuration.handlers.get(c.MACRO).contains(e))throw new F("CommadExists","Command %1 already defined",`\\${e}`);P.addMacro(t,e,K.PairedDelimiters,a)},spreadLines(t,e){if(!t.isKind("mtable"))return;let a=t.attributes.get("rowspacing");const r=G.dimen2em(e);a=a.split(/ /).map((t=>G.em(Math.max(0,G.dimen2em(t)+r)))).join(" "),t.attributes.set("rowspacing",a)},plusOrMinus(t,e){if(!(e=e.trim()).match(/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)$/))throw new F("NotANumber","Argument to %1 is not a number",t);return e.match(/^[-+]/)?e:"+"+e},getScript(t,e,a){let r=G.trimSpaces(t.GetArgument(e));if(""===r)return t.create("node","none");const o=t.options.mathtools[`prescript-${a}-format`];o&&(r=`${o}{${r}}`);const n=new L(r,t.stack.env,t.configuration).mml();return n.isKind("TeXAtom")&&0===n.childNodes[0].childNodes.length?t.create("node","none"):n}}),W={[c.MACRO]:["mathtools-legacycolonsymbols"]},z=$.DEFAULTPRIORITY-1,K={MtMatrix(t,e,a,r){const o=t.GetBrackets(`\\begin{${e.getName()}}`,"c");return K.Array(t,e,a,r,o)},MtSmallMatrix:(t,e,a,r,o)=>(o||(o=t.GetBrackets(`\\begin{${e.getName()}}`,t.options.mathtools["smallmatrix-align"])),K.Array(t,e,a,r,o,G.em(1/3),".2em","S",1)),MtMultlined(t,e){const a=`\\begin{${e.getName()}}`;let r=t.options.mathtools["multlined-pos"]||"c",o=t.options.mathtools["multlined-width"]||"";if(!t.nextIsSpace()){const e=t.GetBrackets(a,r);if(e.match(/^[ctb]$/)?(r=e,o=t.nextIsSpace()?"":t.GetBrackets(a,"")):o=e,o&&!G.matchDimen(o)[0])throw new F("BadWidth","Width for %1 must be a dimension",a)}t.Push(e);const n=t.itemFactory.create("multlined",t,e);return n.arraydef={displaystyle:!0,rowspacing:".5em",width:o||"auto",columnwidth:"100%"},N.setArrayAlign(n,r)},HandleShove(t,e,a){const r=t.stack.Top();if("multline"!==r.kind&&"multlined"!==r.kind)throw new F("CommandInMultlined","%1 can only appear within the multline or multlined environments",e);if(r.Size())throw new F("CommandAtTheBeginingOfLine","%1 must come at the beginning of the line",e);r.setProperty("shove",a);const o=t.GetBrackets(e);let n=t.ParseArg(e);if(o){const e=t.create("node","mrow",[]),r=t.create("node","mspace",[],{width:o});"left"===a?(e.appendChild(r),e.appendChild(n)):(e.appendChild(n),e.appendChild(r)),n=e}t.Push(n)},SpreadLines(t,e){if(t.stack.env.closing===e.getName()){delete t.stack.env.closing;const e=t.stack.Pop(),a=e.toMml(),r=e.getProperty("spread");if(a.isInferred)for(const t of g.getChildren(a))H.spreadLines(t,r);else H.spreadLines(a,r);t.Push(a)}else{const a=t.GetDimen(`\\begin{${e.getName()}}`);e.setProperty("spread",a),e.setProperty("nestStart",!0),N.checkEqnEnv(t),t.Push(e)}},Cases(t,e,a,r,o){const n=t.itemFactory.create("array").setProperty("casesEnv",e.getName());return n.arraydef={rowspacing:".2em",columnspacing:"1em",columnalign:"left"},"D"===o&&(n.arraydef.displaystyle=!0),n.setProperties({open:a,close:r}),t.Push(e),n},MathLap(t,e,a,r){const o=t.GetBrackets(e,"").trim(),n=t.create("node","mstyle",[t.create("node","mpadded",[t.ParseArg(e)],Object.assign({width:0},"r"===a?{}:{lspace:"l"===a?"-1width":"-.5width"}))],{"data-cramped":r});H.setDisplayLevel(n,o),t.Push(t.create("node","TeXAtom",[n]))},Cramped(t,e){const a=t.GetBrackets(e,"").trim(),r=t.ParseArg(e),o=t.create("node","mstyle",[r],{"data-cramped":!0});H.setDisplayLevel(o,a),t.Push(o)},MtLap(t,e,a){const r=N.internalMath(t,t.GetArgument(e),0),o=t.create("node","mpadded",r,{width:0});"r"!==a&&g.setAttribute(o,"lspace","l"===a?"-1width":"-.5width"),t.Push(o)},MathMakeBox(t,e){const a=t.GetBrackets(e),r=t.GetBrackets(e,"c"),o=t.create("node","mpadded",[t.ParseArg(e)]);a&&g.setAttribute(o,"width",a);const n=w(r.toLowerCase(),{c:"center",r:"right"},"");n&&g.setAttribute(o,"data-align",n),r.toLowerCase()!==r&&g.setAttribute(o,"data-overflow","linebreak"),t.Push(o)},MathMBox(t,e){t.Push(t.create("node","mrow",[t.ParseArg(e)]))},UnderOverBracket(t,e){const a=q(t.GetBrackets(e,".1em"),.1),r=t.GetBrackets(e,".2em"),o=t.GetArgument(e),[n,s,l]="o"===e.charAt(1)?["over","accent","bottom"]:["under","accentunder","top"],i=U(a),m=new L(o,t.stack.env,t.configuration).mml(),c=new L(o,t.stack.env,t.configuration).mml(),d=t.create("node","mpadded",[t.create("node","mphantom",[c])],{style:`border: ${i} solid; border-${l}: none`,height:r,depth:0}),h=N.underOver(t,m,d,n,!0),p=g.getChildAt(g.getChildAt(h,0),0);g.setAttribute(p,s,!0),t.Push(h)},Aboxed(t,e,a="boxed",r=!0){const o=H.checkAlignment(t,e);o.row.length%2==1&&o.row.push(t.create("node","mtd",[]));const n=t.GetArgument(e),s=t.string.substring(t.i);t.string=n+"&&\\endAboxed",t.i=0;const l=t.GetUpTo(e,"&"),i=t.GetUpTo(e,"&");t.GetUpTo(e,"\\endAboxed");const[m,c]=r?["",""]:["$\\displaystyle{","}$"],d=N.substituteArgs(t,[l,i],`\\rlap{\\${a}{${m}#1{}#2${c}}}\\kern.267em\\phantom{#1}&\\phantom{{}#2}\\kern.267em`);t.string=d+s,t.i=0},MakeAboxedCommand(t,e){const a=t.GetStar(),r=P.GetCSname(t,e),o=P.GetCSname(t,e+"\\"+r),n=t.configuration.handlers;if(n.get(c.MACRO).lookup(r))throw new F("AlreadyDefined","%1 is already defined","\\"+r);n.retrieve(b.NEW_COMMAND).add(r,new u(r,K.Aboxed,[o,a])),t.Push(t.itemFactory.create("null"))},ArrowBetweenLines(t,e){const a=H.checkAlignment(t,e);if(a.Size()||a.row.length)throw new F("BetweenLines","%1 must be on a row by itself",e);const r=t.GetStar(),o=t.GetBrackets(e,"\\Updownarrow");r&&(a.EndEntry(),a.EndEntry());const n=new L(r?"\\quad"+o:o+"\\quad",t.stack.env,t.configuration).mml();t.Push(n),a.EndEntry(),a.EndRow()},VDotsWithin(t,e){const a="\\mmlToken{mi}{}"+t.GetArgument(e)+"\\mmlToken{mi}{}",r=new L(a,t.stack.env,t.configuration).mml(),o=t.create("node","mpadded",[t.create("node","mpadded",[t.create("node","mo",[t.create("text","\u22ee")])],{width:0,lspace:"-.5width"}),t.create("node","mphantom",[r])],{lspace:".5width"});t.Push(o)},ShortVDotsWithin(t,e){const a=t.stack.Top(),r=t.GetStar();a.EndEntry&&(K.FlushSpaceAbove(t,"\\MTFlushSpaceAbove"),r||a.EndEntry()),K.VDotsWithin(t,"\\vdotswithin"),a.EndEntry&&(r&&a.EndEntry(),K.FlushSpaceBelow(t,"\\MTFlushSpaceBelow"))},FlushSpaceAbove(t,e){const a=H.checkAlignment(t,e);a.table&&(a.setProperty("flushspaceabove",a.table.length),a.addRowSpacing("-"+t.options.mathtools.shortvdotsadjustabove))},FlushSpaceBelow(t,e){const a=H.checkAlignment(t,e);a.table&&(a.Size()&&a.EndEntry(),a.EndRow(),a.addRowSpacing("-"+t.options.mathtools.shortvdotsadjustbelow))},PairedDelimiters(t,e,a,r,o="#1",n=1,s="",l=""){const i=t.GetStar(),m=i?"":t.GetBrackets(e),[c,d,h]=i?["\\mathopen{\\left","\\right","}\\mathclose{}"]:m?[m+"l",m+"r",""]:["","",""],p=i?"\\middle":m||"";if(n){const a=[];for(let r=a.length;r<n;r++)a.push(t.GetArgument(e));s=N.substituteArgs(t,a,s),o=N.substituteArgs(t,a,o),l=N.substituteArgs(t,a,l)}o=o.replace(/\\delimsize/g,p),t.string=[s,c,a,o,d,r,h,l,t.string.substring(t.i)].reduce(((e,a)=>N.addArgs(t,e,a)),""),t.i=0,N.checkMaxMacros(t)},DeclarePairedDelimiter(t,e){const a=P.GetCsNameArgument(t,e),r=t.GetArgument(e),o=t.GetArgument(e);H.addPairedDelims(t,a,[r,o]),t.Push(t.itemFactory.create("null"))},DeclarePairedDelimiterX(t,e){const a=P.GetCsNameArgument(t,e),r=P.GetArgCount(t,e),o=t.GetArgument(e),n=t.GetArgument(e),s=t.GetArgument(e);H.addPairedDelims(t,a,[o,n,s,r]),t.Push(t.itemFactory.create("null"))},DeclarePairedDelimiterXPP(t,e){const a=P.GetCsNameArgument(t,e),r=P.GetArgCount(t,e),o=t.GetArgument(e),n=t.GetArgument(e),s=t.GetArgument(e),l=t.GetArgument(e),i=t.GetArgument(e);H.addPairedDelims(t,a,[n,s,i,r,o,l]),t.Push(t.itemFactory.create("null"))},CenterColon(t,e,a,r=!1,o=!1){const n=t.options.mathtools;let s=t.create("token","mo",{},":");if(a&&(n.centercolon||r)){const e=n["centercolon-offset"];s=t.create("node","mpadded",[s],Object.assign({voffset:e,height:`+${e}`,depth:`-${e}`},o?{width:n["thincolon-dw"],lspace:n["thincolon-dx"]}:{}))}t.Push(s)},Relation(t,e,a,r){t.options.mathtools["use-unicode"]&&r?t.Push(t.create("token","mo",{texClass:_.REL},r)):(a="\\mathrel{"+a.replace(/:/g,"\\MTThinColon").replace(/-/g,"\\mathrel{-}")+"}",t.string=N.addArgs(t,a,t.string.substring(t.i)),t.i=0)},NArrow(t,e,a,r){t.Push(t.create("node","TeXAtom",[t.create("token","mtext",{},a),t.create("node","mpadded",[t.create("node","mpadded",[t.create("node","menclose",[t.create("node","mspace",[],{height:".2em",depth:0,width:".4em"})],{notation:"updiagonalstrike","data-thickness":".05em","data-padding":0})],{width:0,lspace:"-.5width",voffset:r}),t.create("node","mphantom",[t.create("token","mtext",{},a)])],{width:0,lspace:"-.5width"})],{texClass:_.REL}))},SplitFrac(t,e,a){const r=t.ParseArg(e),o=t.ParseArg(e);t.Push(t.create("node","mstyle",[t.create("node","mfrac",[t.create("node","mstyle",[r,t.create("token","mi"),t.create("token","mspace",{width:"1em"})],{scriptlevel:0}),t.create("node","mstyle",[t.create("token","mspace",{width:"1em"}),t.create("token","mi"),o],{scriptlevel:0})],{linethickness:0,numalign:"left",denomalign:"right"})],{displaystyle:a,scriptlevel:0}))},XMathStrut(t,e){let a=t.GetBrackets(e),r=t.GetArgument(e);r=H.plusOrMinus(e,r),a=H.plusOrMinus(e,a||r),t.Push(t.create("node","TeXAtom",[t.create("node","mpadded",[t.create("node","mphantom",[t.create("token","mo",{stretchy:!1},"(")])],{width:0,height:r+"height",depth:a+"depth"})],{texClass:_.ORD}))},Prescript(t,e){const a=H.getScript(t,e,"sup"),r=H.getScript(t,e,"sub"),o=H.getScript(t,e,"arg");if(g.isType(a,"none")&&g.isType(r,"none"))return void t.Push(o);const n=t.create("node","mmultiscripts",[o]);g.getChildren(n).push(null,null),g.appendChildren(n,[t.create("node","mprescripts"),r,a]),n.setProperty("fixPrescript",!0),t.Push(n)},NewTagForm(t,e,a=!1){const r=t.tags;if(!("mtFormats"in r))throw new F("TagsNotMT","%1 can only be used with ams or mathtools tags",e);const o=t.GetArgument(e).trim();if(!o)throw new F("InvalidTagFormID","Tag form name can't be empty");const n=t.GetBrackets(e,""),s=t.GetArgument(e),l=t.GetArgument(e);if(!a&&r.mtFormats.has(o))throw new F("DuplicateTagForm","Duplicate tag form: %1",o);r.mtFormats.set(o,[s,l,n]),t.Push(t.itemFactory.create("null"))},UseTagForm(t,e){const a=t.tags;if(!("mtFormats"in a))throw new F("TagsNotMT","%1 can only be used with ams or mathtools tags",e);const r=t.GetArgument(e).trim();if(!r)return a.mtCurrent=null,void t.Push(t.itemFactory.create("null"));if(!a.mtFormats.has(r))throw new F("UndefinedTagForm","Undefined tag form: %1",r);a.mtCurrent=a.mtFormats.get(r),t.Push(t.itemFactory.create("null"))},SetOptions(t,e){const a=t.options.mathtools;if(!a["allow-mathtoolsset"])throw new F("ForbiddenMathtoolsSet","%1 is disabled",e);const r={};Object.keys(a).forEach((t=>{"pariedDelimiters"!==t&&"tagforms"!==t&&"allow-mathtoolsset"!==t&&(r[t]=1)}));const o=t.GetArgument(e),n=N.keyvalOptions(o,r,!0);for(const e of Object.keys(n))"legacycolonsymbols"===e&&a[e]!==n[e]&&(a[e]?t.configuration.handlers.remove(W,{}):t.configuration.handlers.add(W,{},z)),a[e]=n[e];t.Push(t.itemFactory.create("null"))},Array:O.Array,Macro:O.Macro,xArrow:R.xArrow,HandleRef:R.HandleRef,AmsEqnArray:R.AmsEqnArray,MacroWithTemplate:j.MacroWithTemplate};new v("mathtools-macros",{shoveleft:[K.HandleShove,D.Align.LEFT],shoveright:[K.HandleShove,D.Align.RIGHT],xleftrightarrow:[K.xArrow,8596,10,10],xLeftarrow:[K.xArrow,8656,12,7],xRightarrow:[K.xArrow,8658,7,12],xLeftrightarrow:[K.xArrow,8660,12,12],xhookleftarrow:[K.xArrow,8617,10,5],xhookrightarrow:[K.xArrow,8618,5,10],xmapsto:[K.xArrow,8614,10,10],xrightharpoondown:[K.xArrow,8641,5,10],xleftharpoondown:[K.xArrow,8637,10,5],xrightleftharpoons:[K.xArrow,8652,10,10],xrightharpoonup:[K.xArrow,8640,5,10],xleftharpoonup:[K.xArrow,8636,10,5],xleftrightharpoons:[K.xArrow,8651,10,10],xlongrightarrow:[K.xArrow,10230,7,12,1.45],xlongleftarrow:[K.xArrow,10229,12,7,1.45],xLongrightarrow:[K.xArrow,10233,7,12,1.45],xLongleftarrow:[K.xArrow,10232,12,7,1.45],mathllap:[K.MathLap,"l",!1],mathrlap:[K.MathLap,"r",!1],mathclap:[K.MathLap,"c",!1],clap:[K.MtLap,"c"],textllap:[K.MtLap,"l"],textrlap:[K.MtLap,"r"],textclap:[K.MtLap,"c"],cramped:K.Cramped,crampedllap:[K.MathLap,"l",!0],crampedrlap:[K.MathLap,"r",!0],crampedclap:[K.MathLap,"c",!0],crampedsubstack:[K.Macro,"\\begin{crampedsubarray}{c}#1\\end{crampedsubarray}",1],mathmbox:K.MathMBox,mathmakebox:K.MathMakeBox,overbracket:K.UnderOverBracket,underbracket:K.UnderOverBracket,refeq:K.HandleRef,MoveEqLeft:[K.Macro,"\\hspace{#1em}&\\hspace{-#1em}",1,"2"],Aboxed:K.Aboxed,MakeAboxedCommand:K.MakeAboxedCommand,ArrowBetweenLines:K.ArrowBetweenLines,vdotswithin:K.VDotsWithin,shortvdotswithin:K.ShortVDotsWithin,MTFlushSpaceAbove:K.FlushSpaceAbove,MTFlushSpaceBelow:K.FlushSpaceBelow,DeclarePairedDelimiter:K.DeclarePairedDelimiter,DeclarePairedDelimiterX:K.DeclarePairedDelimiterX,DeclarePairedDelimiterXPP:K.DeclarePairedDelimiterXPP,DeclarePairedDelimiters:K.DeclarePairedDelimiter,DeclarePairedDelimitersX:K.DeclarePairedDelimiterX,DeclarePairedDelimitersXPP:K.DeclarePairedDelimiterXPP,vcentercolon:[K.CenterColon,!0,!0],ordinarycolon:[K.CenterColon,!1],MTThinColon:[K.CenterColon,!0,!0,!0],coloneqq:[K.Relation,":=","\u2254"],Coloneqq:[K.Relation,"::=","\u2a74"],coloneq:[K.Relation,":=","\u2254"],Coloneq:[K.Relation,"::=","\u2a7a"],eqqcolon:[K.Relation,"=:","\u2255"],Eqqcolon:[K.Relation,"=::"],eqcolon:[K.Relation,"=:","\u2255"],Eqcolon:[K.Relation,"=::"],colonapprox:[K.Relation,":\\approx"],Colonapprox:[K.Relation,"::\\approx"],colonsim:[K.Relation,":\\sim"],Colonsim:[K.Relation,"::\\sim"],dblcolon:[K.Relation,"::","\u2237"],approxcolon:[K.Relation,"\\approx:"],Approxcolon:[K.Relation,"\\approx::"],simcolon:[K.Relation,"\\sim:"],Simcolon:[K.Relation,"\\sim::"],colondash:[K.Relation,":-"],Colondash:[K.Relation,"::-"],dashcolon:[K.Relation,"-:","\u2239"],Dashcolon:[K.Relation,"-::"],nuparrow:[K.NArrow,"\u2191",".06em"],ndownarrow:[K.NArrow,"\u2193",".25em"],bigtimes:[K.Macro,"\\mathop{\\Large\\kern-.1em\\boldsymbol{\\times}\\kern-.1em}"],splitfrac:[K.SplitFrac,!1],splitdfrac:[K.SplitFrac,!0],xmathstrut:K.XMathStrut,prescript:K.Prescript,newtagform:[K.NewTagForm,!1],renewtagform:[K.NewTagForm,!0],usetagform:K.UseTagForm,adjustlimits:[K.MacroWithTemplate,"\\mathop{{#1}\\vphantom{{#3}}}_{{#2}\\vphantom{{#4}}}\\mathop{{#3}\\vphantom{{#1}}}_{{#4}\\vphantom{{#2}}}",4,,"_",,"_"],mathtoolsset:K.SetOptions}),new v("mathtools-legacycolonsymbols",{coloneq:[K.Relation,":-"],Coloneq:[K.Relation,"::-"],eqcolon:[K.Relation,"-:","\u2239"],Eqcolon:[K.Relation,"-::"]}),new S("mathtools-environments",C.environment,{dcases:[K.Array,null,"\\{","","ll",null,".2em","D"],rcases:[K.Array,null,"","\\}","ll",null,".2em"],drcases:[K.Array,null,"","\\}","ll",null,".2em","D"],"dcases*":[K.Cases,null,"{","","D"],"rcases*":[K.Cases,null,"","}"],"drcases*":[K.Cases,null,"","}","D"],"cases*":[K.Cases,null,"{",""],"matrix*":[K.MtMatrix,null,null,null],"pmatrix*":[K.MtMatrix,null,"(",")"],"bmatrix*":[K.MtMatrix,null,"[","]"],"Bmatrix*":[K.MtMatrix,null,"\\{","\\}"],"vmatrix*":[K.MtMatrix,null,"\\vert","\\vert"],"Vmatrix*":[K.MtMatrix,null,"\\Vert","\\Vert"],"smallmatrix*":[K.MtSmallMatrix,null,null,null],psmallmatrix:[K.MtSmallMatrix,null,"(",")","c"],"psmallmatrix*":[K.MtSmallMatrix,null,"(",")"],bsmallmatrix:[K.MtSmallMatrix,null,"[","]","c"],"bsmallmatrix*":[K.MtSmallMatrix,null,"[","]"],Bsmallmatrix:[K.MtSmallMatrix,null,"\\{","\\}","c"],"Bsmallmatrix*":[K.MtSmallMatrix,null,"\\{","\\}"],vsmallmatrix:[K.MtSmallMatrix,null,"\\vert","\\vert","c"],"vsmallmatrix*":[K.MtSmallMatrix,null,"\\vert","\\vert"],Vsmallmatrix:[K.MtSmallMatrix,null,"\\Vert","\\Vert","c"],"Vsmallmatrix*":[K.MtSmallMatrix,null,"\\Vert","\\Vert"],crampedsubarray:[K.Array,null,null,null,null,"0em","0.1em","S'",1],multlined:K.MtMultlined,spreadlines:[K.SpreadLines,!0],lgathered:[K.AmsEqnArray,null,null,null,"l","t",null,".5em","D"],rgathered:[K.AmsEqnArray,null,null,null,"r","t",null,".5em","D"]}),new k("mathtools-delimiters",C.delimiter,{"\\lparen":"(","\\rparen":")"}),new v("mathtools-characters",{":":[K.CenterColon,!0]});const Y=MathJax._.input.tex.Tags,Q=(Y.Label,Y.TagInfo,Y.AbstractTags,Y.NoTags,Y.AllTags,Y.TagsFactory);let Z=0;function tt(t,e){const a=e.parseOptions.options.tags;"base"!==a&&Object.hasOwn(t.tags,a)&&Q.add(a,t.tags[a]);const r=Q.create(e.parseOptions.options.tags).constructor;Z++;const o="MathtoolsTags-"+Z;Q.add(o,class extends r{constructor(){super(),this.mtFormats=new Map,this.mtCurrent=null;const t=e.parseOptions.options.mathtools.tagforms;for(const e of Object.keys(t)){if(!Array.isArray(t[e])||3!==t[e].length)throw new F("InvalidTagFormDef",'The tag form definition for "%1" should be an array of three strings',e);this.mtFormats.set(e,t[e])}}formatTag(t){if(this.mtCurrent){const[e,a,r]=this.mtCurrent;return[e,r?`${r}{${t}}`:t,a]}return super.formatTag(t)}}),e.parseOptions.options.tags=o}const et=MathJax._.input.tex.ams.AmsItems,at=et.MultlineItem;et.FlalignItem;class rt extends at{get kind(){return"multlined"}EndTable(){if((this.Size()||this.row.length)&&(this.EndEntry(),this.EndRow()),this.table.length>1){const t=this.factory.configuration.options.mathtools,e=t["multlined-gap"],a=t["firstline-afterskip"]||e,r=t["lastline-preskip"]||e,o=g.getChildren(this.table[0])[0];g.getAttribute(o,"columnalign")!==D.Align.RIGHT&&o.appendChild(this.create("node","mspace",[],{width:a}));const n=g.getChildren(this.table[this.table.length-1])[0];if(g.getAttribute(n,"columnalign")!==D.Align.LEFT){const t=g.getChildren(n)[0];t.childNodes.unshift(null);const e=this.create("node","mspace",[],{width:r});g.setChild(t,0,e)}}super.EndTable.call(this)}}function ot({data:t}){for(const e of t.getList("mmultiscripts")){if(!e.getProperty("fixPrescript"))continue;const a=g.getChildren(e);let r=0;for(const o of[1,2])a[o]||(g.setChild(e,o,t.nodeFactory.create("node","none")),r++);2===r&&a.splice(1,2)}}const nt=h.create("mathtools",{[m.HANDLER]:{macro:["mathtools-macros","mathtools-delimiters"],[c.ENVIRONMENT]:["mathtools-environments"],[c.DELIMITER]:["mathtools-delimiters"],[c.CHARACTER]:["mathtools-characters"]},[m.ITEMS]:{[rt.prototype.kind]:rt},[m.CONFIG]:function(t,e){A(t,e);const a=e.parseOptions,r=a.options.mathtools.pairedDelimiters,o=t.handlers.retrieve(b.NEW_COMMAND);for(const[t,e]of Object.entries(r))o.add(t,new u(t,K.PairedDelimiters,e));a.options.mathtools.legacycolonsymbols&&t.handlers.add(W,{},z),tt(t,e)},[m.POSTPROCESSORS]:[[ot,-6]],[m.OPTIONS]:{mathtools:{"multlined-gap":"1em","multlined-pos":"c","multlined-width":"","firstline-afterskip":"","lastline-preskip":"","smallmatrix-align":"c",shortvdotsadjustabove:".2em",shortvdotsadjustbelow:".2em",centercolon:!1,"centercolon-offset":".04em","thincolon-dx":"-.04em","thincolon-dw":"-.08em","use-unicode":!1,legacycolonsymbols:!1,"prescript-sub-format":"","prescript-sup-format":"","prescript-arg-format":"","allow-mathtoolsset":!0,pairedDelimiters:x({}),tagforms:x({})}}});MathJax.loader&&MathJax.loader.checkVersion("[tex]/mathtools","4.1.0","tex-extension"),l({_:{input:{tex:{mathtools:{MathtoolsConfiguration:n,MathtoolsItems:o,MathtoolsMethods:a,MathtoolsTags:r,MathtoolsUtil:e}}}}})})();