instiki/public/MathJax/extensions/TeX/AMSmath.js

17 lines
9.2 KiB
JavaScript
Raw Normal View History

/*
2011-01-28 02:12:00 +01:00
* /MathJax/extensions/TeX/AMSmath.js
*
* Copyright (c) 2010 Design Science, Inc.
*
* Part of the MathJax library.
* See http://www.mathjax.org for details.
*
* Licensed under the Apache License, Version 2.0;
* you may not use this file except in compliance with the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
2011-06-03 09:03:06 +02:00
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var e="1.1";var a=MathJax.ElementJax.mml;var f=MathJax.InputJax.TeX;var c=f.Definitions;var d=f.Stack.Item;var b=function(g){return g.join("em ")+"em"};MathJax.Hub.Insert(c,{macros:{mathring:["Accent","2DA"],nobreakspace:"Tilde",negmedspace:["Spacer",a.LENGTH.NEGATIVEMEDIUMMATHSPACE],negthickspace:["Spacer",a.LENGTH.NEGATIVETHICKMATHSPACE],intI:["Macro","\\mathchoice{\\!}{}{}{}\\!\\!\\int"],iiiint:["MultiIntegral","\\int\\intI\\intI\\intI"],idotsint:["MultiIntegral","\\int\\cdots\\int"],dddot:["Macro","\\mathop{#1}\\limits^{\\textstyle \\mathord{.}\\mathord{.}\\mathord{.}}",1],ddddot:["Macro","\\mathop{#1}\\limits^{\\textstyle \\mathord{.}\\mathord{.}\\mathord{.}\\mathord{.}}",1],sideset:["Macro","\\mathop{\\mathop{\\rlap{\\phantom{#3}}}\\nolimits#1\\!\\mathop{#3}\\nolimits#2}",3],boxed:["Macro","\\fbox{$\\displaystyle{#1}$}",1],tag:"HandleTag",notag:"HandleNoTag",substack:["Macro","\\begin{subarray}{c}#1\\end{subarray}",1],injlim:["Macro","\\mathop{\\rm inj\\,lim}"],projlim:["Macro","\\mathop{\\rm proj\\,lim}"],varliminf:["Macro","\\mathop{\\underline{\\rm lim}}"],varlimsup:["Macro","\\mathop{\\overline{\\rm lim}}"],varinjlim:["Macro","\\mathop{\\underrightarrow{\\rm lim\\Rule{-1pt}{0pt}{1pt}}\\Rule{0pt}{0pt}{.45em}}"],varprojlim:["Macro","\\mathop{\\underleftarrow{\\rm lim\\Rule{-1pt}{0pt}{1pt}}\\Rule{0pt}{0pt}{.45em}}"],DeclareMathOperator:"HandleDeclareOp",operatorname:"HandleOperatorName",genfrac:"Genfrac",frac:["Genfrac","","","",""],tfrac:["Genfrac","","","",1],dfrac:["Genfrac","","","",0],binom:["Genfrac","(",")","0em",""],tbinom:["Genfrac","(",")","0em",1],dbinom:["Genfrac","(",")","0em",0],cfrac:"CFrac",shoveleft:["HandleShove",a.ALIGN.LEFT],shoveright:["HandleShove",a.ALIGN.RIGHT],xrightarrow:["xArrow",8594,5,6],xleftarrow:["xArrow",8592,7,3]},environment:{align:["AMSarray",null,true,true,"rlrlrlrlrlrl",b([5/18,2,5/18,2,5/18,2,5/18,2,5/18,2,5/18])],"align*":["AMSarray",null,false,true,"rlrlrlrlrlrl",b([5/18,2,5/18,2,5/18,2,5/18,2,5/18,2,5/18])],multline:["Multline",null,true],"multline*":["Multline",null,false],split:["AMSarray",null,false,false,"rl",b([5/18])],gather:["AMSarray",null,true,true,"c"],"gather*":["AMSarray",null,false,true,"c"],alignat:["AlignAt",null,true,true],"alignat*":["AlignAt",null,false,true],alignedat:["AlignAt",null,false,false],aligned:["Array",null,null,null,"rlrlrlrlrlrl",b([5/18,2,5/18,2,5/18,2,5/18,2,5/18,2,5/18]),".5em","D"],gathered:["Array",null,null,null,"c",null,".5em","D"],subarray:["Array",null,null,null,null,b([0,0,0,0]),"0.1em","S",1],smallmatrix:["Array",null,null,null,"c",b([1/3]),".2em","S",1]},delimiter:{"\\lvert":["2223",{texClass:a.TEXCLASS.OPEN}],"\\rvert":["2223",{texClass:a.TEXCLASS.CLOSE}],"\\lVert":["2225",{texClass:a.TEXCLASS.OPEN}],"\\rVert":["2225",{texClass:a.TEXCLASS.CLOSE}]}});f.Parse.Augment({HandleTag:function(h){var g=this.trimSpaces(this.GetArgument(h));if(g==="*"){g=this.GetArgument(h)}else{g="("+g+")"}if(this.stack.global.notag){f.Error(h+" not allowed in "+this.stack.global.notag+" environment")}if(this.stack.global.tag){f.Error("Multiple "+h)}this.stack.global.tag=a.mtd.apply(a,this.InternalMath(g))},HandleNoTag:function(g){if(this.stack.global.tag){delete this.stack.global.tag}},HandleDeclareOp:function(h){var g="";var i=this.trimSpaces(this.GetArgument(h));if(i=="*"){g="\\limits";i=this.trimSpaces(this.GetArgument(h))}if(i.charAt(0)=="\\"){i=i.substr(1)}var j=this.GetArgument(h);j=j.replace(/\*/g,"\\text{*}").replace(/-/g,"\\text{-}");f.Definitions.macros[i]=["Macro","\\mathop{\\rm "+j+"}"+g]},HandleOperatorName:function(h){var g="\\nolimits";var i=this.trimSpaces(this.GetArgument(h));if(i=="*"){g="\\limits";i=this.trimSpaces(this.GetArgument(h))}i=i.replace(/\*/g,"\\text{*}").replace(/-/g,"\\text{-}");this.string="\\mathop{\\rm "+i+"}"+g+" "+this.string.slice(this.i);this.i=0},HandleShove:function(h,g){var i=this.stack.Top();if(i.type!=="multline"||i.data.length){f.Error(h+" must come at the beginning of the line")}i.data.shove=g},CFrac:function(j){var g=this.trimSpaces(this.GetBracket