MathJax.Extension["TeX/newcommand"]={version:"2.1"};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){varb=MathJax.InputJax.TeX;vara=b.Definitions;a.Add({macros:{newcommand:"NewCommand",renewcommand:"NewCommand",newenvironment:"NewEnvironment",renewenvironment:"NewEnvironment",def:"MacroDef",let:"Let"}},null,true);b.Parse.Augment({NewCommand:function(c){vare=this.trimSpaces(this.GetArgument(c)),g=this.GetBrackets(c),d=this.GetBrackets(c),f=this.GetArgument(c);if(e.charAt(0)==="\\"){e=e.substr(1)}if(!e.match(/^(.|[a-z]+)$/i)){b.Error("Illegal control sequence name for "+c)}if(g){g=this.trimSpaces(g);if(!g.match(/^[0-9]+$/)){b.Error("Illegal number of parameters specified in "+c)}}this.setDef(e,["Macro",f,g,d])},NewEnvironment:function(d){vare=this.trimSpaces(this.GetArgument(d)),g=this.GetBrackets(d),f=this.GetArgument(d),c=this.GetArgument(d);if(g){g=this.trimSpaces(g);if(!g.match(/^[0-9]+$/)){b.Error("Illegal number of parameters specified in "+d)}}this.setEnv(e,["BeginEnv","EndEnv",f,c,g])},MacroDef:function(c){vard=this.GetCSname(c),f=this.GetTemplate(c,"\\"+d),e=this.GetArgument(c);if(!(finstanceofArray)){this.setDef(d,["Macro",e,f])}else{this.setDef(d,["MacroWithTemplate",e].concat(f))}},Let:function(d){vare=this.GetCSname(d),f;varg=this.GetNext();if(g==="="){this.i++;g=this.GetNext()}if(g==="\\"){d=this.GetCSname(d);f=this.csFindMacro(d);if(!f){if(a.mathchar0mi[d]){f=["csMathchar0mi",a.mathchar0mi[d]]}else{if(a.mathchar0mo[d]){f=["csMathchar0mo",a.mathchar0mo[d]]}else{if(a.mathchar7[d]){f=["csMathchar7",a.mathchar7[d]]}else{if(a.delimiter["\\"+d]!=null){f=["csDelimiter",a.delimiter["\\"+d]]}}}}}}else{f=["Macro",g];this.i++}this.setDef(e,f)},setDef:function(c,d){d.isUser=true;a.macros[c]=d},setEnv:function(c,d){d.isUser=true;a.environment[c]=d},GetCSname:function(e){varf=this.GetNext();if(f!=="\\"){b.Error("\\ must be followed by a control sequence")}vard=this.trimSpaces(this.GetArgument(e));returnd.substr(1)},GetTemplate:function(f,e){varj,g=[],h=0;j=this.GetNext();vard=this.i;while(this.i<this.string.length){j=this.GetNext();if(j==="#"){if(d!==this.i){g[h]=this.string.substr(d,this.i-d)}j=this.string.charAt(++this.i);if(!j.match(/^[1-9]$/)){b.Error("Illegal use of # in template for "+e)}if(parseInt(j)!=++h){b.Error("Parameters for "+e+" must be numbered sequentially")}d=this.i+1}else{if(j==="{"){if(d!==this.i){g[h]=this.string.substr(d,this.i-d)}if(g.length>0){return[h,g]}else{returnh}}}this.i++}b.Error("Missing replacement string for definition of "+f)},MacroWithTemplate:function(d,g,h,f){if(h){varc=[];this.GetNext();if(f[0]&&!this.MatchParam(f[0])){b.Error("Use of "+d+" doesn't match its definition")}for(vare=0;e<h;e++){c.push(this.GetParameter(d,f[e+1]))}g=this.SubstituteArgs(c,g)}this.string=this.AddArgs(g,this.string.slice(this.i));this.i=0;if(++this.macroCount>b.config.MAXMACROS){b.Error("MathJax maximum macro substitution count exceeded; is there a recursive macro call?")}},BeginEnv:function(f,h,c,g){if(g){vard=[];for(vare=0;e<g;e++){d.push(this.GetArgument("\\begin{"+name+"}"))}h=this.SubstituteArgs(d,h);c=this.SubstituteArgs(d,c)}f.edef=c;this.string=this.AddArgs(h,this.string.slice(this.i));this.i=0;returnf},EndEnv:function(c,d){this.string=this.AddArgs(c.edef,this.string.slice(this.i));this.i=0;returnd},GetParameter:function(d,g){if(g==null){returnthis.GetArgument(d)}varf=this.i,c=0,e=0;while(this.i<this.string.length){if(this.string.charAt(this.i)==="{"){if(this.i===f){e=1}this.GetArgument(d);c=this.i-f}else{if(this.MatchParam(g)){if(e){f++;c-=2}returnthis.string.substr(f,c)}else{this.i++;c++;e=0}}}b.Error("Runaway argument for "+d+"?")},MatchParam:function(c){if(this.string.substr(this.i,c.length)!==c){return0}this.i+=c.length;return1}});b.Environment=function(c){a.environment[c]=["BeginEnv","EndEnv"].concat([].slice.call(arguments,1));a.environment[c].isUser=true};MathJax.Hub.Startup.signal.Post("TeX newcommand Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/newcommand.js");