MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){varb="1.0.1";varc=MathJax.InputJax.TeX;vara=c.Definitions;MathJax.Hub.Insert(a,{macros:{newcommand:"NewCommand",renewcommand:"NewCommand",newenvironment:"NewEnvironment",def:"MacroDef"}});c.Parse.Augment({NewCommand:function(d){vare=this.trimSpaces(this.GetArgument(d)),g=this.trimSpaces(this.GetBrackets(d)),f=this.GetArgument(d);if(g===""){g=null}if(e.charAt(0)==="\\"){e=e.substr(1)}if(!e.match(/^(.|[a-z]+)$/i)){c.Error("Illegal control sequence name for "+d)}if(g!=null&&!g.match(/^[0-9]+$/)){c.Error("Illegal number of parameters specified in "+d)}a.macros[e]=["Macro",f,g]},NewEnvironment:function(e){varf=this.trimSpaces(this.GetArgument(e)),h=this.trimSpaces(this.GetBrackets(e)),g=this.GetArgument(e),d=this.GetArgument(e);if(h===""){h=null}if(h!=null&&!h.match(/^[0-9]+$/)){c.Error("Illegal number of parameters specified in "+e)}a.environment[f]=["BeginEnv","EndEnv",g,d,h]},MacroDef:function(d){vare=this.GetCSname(d),g=this.GetTemplate(d,"\\"+e),f=this.GetArgument(d);if(!(ginstanceofArray)){a.macros[e]=["Macro",f,g]}else{a.macros[e]=["MacroWithTemplate",f,g[0],g[1]]}},GetCSname:function(e){varf=this.GetNext();if(f!=="\\"){c.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]$/)){c.Error("Illegal use of # in template for "+e)}if(parseInt(j)!=++h){c.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++}c.Error("Missing replacement string for definition of "+f)},MacroWithTemplate:function(e,h,j,g){if(j){vard=[];this.GetNext();if(g[0]&&!this.MatchParam(g[0])){c.Error("Use of "+e+" doesn't match its definition")}for(varf=0;f<j;f++){d.push(this.GetParameter(e,g[f+1]))}h=this.SubstituteArgs(d,h)}this.string=this.AddArgs(h,this.string.slice(this.i));this.i=0;if(++this.macroCount>c.config.MAXMACROS){c.Error("MathJax maximum macro substitution count exceeded; is there a recursive macro call?")}},BeginEnv:function(g,j,d,h){if(h){vare=[];for(varf=0;f<h;f++){e.push(this.GetArgument("\\begin{"+name+"}"))}j=this.SubstituteArgs(e,j);d=this.SubstituteArgs(e,d)}g.edef=d;this.string=this.AddArgs(j,this.string.slice(this.i));this.i=0;returng},EndEnv:function(d,e){this.string=this.AddArgs(d.edef,this.string.slice(this.i));this.i=0;returne},GetParameter:function(e,h){if(h==null){returnthis.GetArgument(e)}varg=this.i,d=0,f=0;while(this.i<this.string.length){if(this.string.charAt(this.i)==="{"){if(this.i===g){f=1}this.GetArgument(e);d=this.i-g}else{if(this.MatchParam(h)){if(f){g++;d-=2}returnthis.string.substr(g,d)}else{this.i++;d++;f=0}}}c.Error("Runaway argument for "+e+"?")},MatchParam:function(d){if(this.string.substr(this.i,d.length)!==d){return0}this.i+=d.length;return1}});c.Environment=function(d){a.environment[d]=["BeginEnv","EndEnv"].concat([].slice.call(arguments,1))};MathJax.Hub.Startup.signal.Post("TeX newcommand Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/newcommand.js");