MathJax.Extension["TeX/newcommand"]={version:"2.7.9"},MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var h=MathJax.InputJax.TeX,a=h.Definitions;a.Add({macros:{newcommand:"NewCommand",renewcommand:"NewCommand",newenvironment:"NewEnvironment",renewenvironment:"NewEnvironment",def:"MacroDef",let:"Let"}},null,!0),h.Parse.Augment({NewCommand:function(t){var s=this.trimSpaces(this.GetArgument(t)),i=this.GetBrackets(t),e=this.GetBrackets(t),r=this.GetArgument(t);s.charAt(0)==="\\"&&(s=s.substr(1)),s.match(/^(.|[a-z]+)$/i)||h.Error(["IllegalControlSequenceName","Illegal control sequence name for %1",t]),i&&(i=this.trimSpaces(i),i.match(/^[0-9]+$/)||h.Error(["IllegalParamNumber","Illegal number of parameters specified in %1",t])),this.setDef(s,["Macro",r,i,e])},NewEnvironment:function(t){var s=this.trimSpaces(this.GetArgument(t)),i=this.GetBrackets(t),e=this.GetBrackets(t),r=this.GetArgument(t),n=this.GetArgument(t);i&&(i=this.trimSpaces(i),i.match(/^[0-9]+$/)||h.Error(["IllegalParamNumber","Illegal number of parameters specified in %1",t])),this.setEnv(s,["BeginEnv",[null,"EndEnv"],r,n,i,e])},MacroDef:function(t){var s=this.GetCSname(t),i=this.GetTemplate(t,"\\"+s),e=this.GetArgument(t);i instanceof Array?this.setDef(s,["MacroWithTemplate",e].concat(i)):this.setDef(s,["Macro",e,i])},Let:function(t){var s=this.GetCSname(t),i,e=this.GetNext();if(e==="="&&(this.i++,e=this.GetNext()),e==="\\"){if(t=this.GetCSname(t),i=this.csFindMacro(t),!i)if(a.mathchar0mi.hasOwnProperty(t))i=["csMathchar0mi",a.mathchar0mi[t]];else if(a.mathchar0mo.hasOwnProperty(t))i=["csMathchar0mo",a.mathchar0mo[t]];else if(a.mathchar7.hasOwnProperty(t))i=["csMathchar7",a.mathchar7[t]];else if(a.delimiter.hasOwnProperty("\\"+t))i=["csDelimiter",a.delimiter["\\"+t]];else return}else i=["Macro",e],this.i++;this.setDef(s,i)},GetCSname:function(t){var s=this.GetNext();s!=="\\"&&h.Error(["MissingCS","%1 must be followed by a control sequence",t]);var i=this.trimSpaces(this.GetArgument(t));return i.substr(1)},GetTemplate:function(t,s){var i,e=[],r=0;i=this.GetNext();for(var n=this.i;this.i<this.string.length;){if(i=this.GetNext(),i==="#")n!==this.i&&(e[r]=this.string.substr(n,this.i-n)),i=this.string.charAt(++this.i),i.match(/^[1-9]$/)||h.Error(["CantUseHash2","Illegal use of # in template for %1",s]),parseInt(i)!=++r&&h.Error(["SequentialParam","Parameters for %1 must be numbered sequentially",s]),n=this.i+1;else if(i==="{")return n!==this.i&&(e[r]=this.string.substr(n,this.i-n)),e.length>0?[r,e]:r;this.i++}h.Error(["MissingReplacementString","Missing replacement string for definition of %1",t])},MacroWithTemplate:function(t,s,i,e){if(i){var r=[];this.GetNext(),e[0]&&!this.MatchParam(e[0])&&h.Error(["MismatchUseDef","Use of %1 doesn't match its definition",t]);for(var n=0;n<i;n++)r.push(this.GetParameter(t,e[n+1]));s=this.SubstituteArgs(r,s)}this.string=this.AddArgs(s,this.string.slice(this.i)),this.i=0,++this.macroCount>h.config.MAXMACROS&&h.Error(["MaxMacroSub1","MathJax maximum macro substitution count exceeded; is there a recursive macro call?"])},BeginEnv:function(t,s,i,e,r){if(e){var n=[];if(r!=null){var c=this.GetBrackets("\\begin{"+name+"}");n.push(c==null?r:c)}for(var o=n.length;o<e;o++)n.push(this.GetArgument("\\begin{"+name+"}"));s=this.SubstituteArgs(n,s),i=this.SubstituteArgs([],i)}return this.string=this.AddArgs(s,this.string.slice(this.i)),this.i=0,t},EndEnv:function(t,s,i,e){var r="\\end{\\end\\"+t.name+"}";return this.string=this.AddArgs(i,r+this.string.slice(this.i)),this.i=0,null},GetParameter:function(t,s){if(s==null)return this.GetArgument(t);for(var i=this.i,e=0,r=0;this.i<this.string.length;){var n=this.string.charAt(this.i);if(n==="{")this.i===i&&(r=1),this.GetArgument(t),e=this.i-i;else{if(this.MatchParam(s))return r&&(i++,e-=2),this.string.substr(i,e);if(n==="\\"){this.i++,e++,r=0;var c=this.string.substr(this.i).match(/[a-z]+|./i);c&&(this.i+=c[0].length,e=this.i-i)}else this.i++,e++,r=0}}h.Error(["RunawayArgument","Runaway argument for %1?",t])},MatchParam:function(t){return this.string.substr(this.i,t.length)!==t||t.match(/\\[a-z]+$/i)&&this.string.charAt(this.i+t.length).match(/[a-z]/i)?0:(this.i+=t.length,1)}}),h.Environment=function(t){a.environment[t]=["BeginEnv",[null,"EndEnv"]].concat([].slice.call(arguments,1)),a.environment[t].isUser=!0},MathJax.Hub.Startup.signal.Post("TeX newcommand Ready")}),MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/newcommand.js");
