JAVASCRIPT   44

LaTeXMathML.js

Guest on 31st August 2021 09:57:15 AM

  1. var checkForMathML=true;var notifyIfNoMathML=true;var alertIfNoMathML=false;var mathcolor="";var mathfontfamily="";var showasciiformulaonhover=true;var isIE=document.createElementNS==null;if(document.getElementById==null){alert("This webpage requires a recent browser such as \nMozilla/Netscape 7+ or Internet Explorer 6+MathPlayer")}function AMcreateElementXHTML(a){if(isIE){return document.createElement(a)}else{return document.createElementNS("http://www.w3.org/1999/xhtml",a)}}function AMnoMathMLNote(){var b=AMcreateElementXHTML("h3");b.setAttribute("align","center");b.appendChild(AMcreateElementXHTML("p"));b.appendChild(document.createTextNode("To view the "));var a=AMcreateElementXHTML("a");a.appendChild(document.createTextNode("LaTeXMathML"));a.setAttribute("href","http://www.maths.nott.ac.uk/personal/drw/lm.html");b.appendChild(a);b.appendChild(document.createTextNode(" notation use Internet Explorer 6+"));a=AMcreateElementXHTML("a");a.appendChild(document.createTextNode("MathPlayer"));a.setAttribute("href","http://www.dessci.com/en/products/mathplayer/download.htm");b.appendChild(a);b.appendChild(document.createTextNode(" or Netscape/Mozilla/Firefox"));b.appendChild(AMcreateElementXHTML("p"));return b}function AMisMathMLavailable(){if(navigator.appName.slice(0,8)=="Netscape"){if(navigator.appVersion.slice(0,1)>="5"){return null}else{return AMnoMathMLNote()}}else{if(navigator.appName.slice(0,9)=="Microsoft"){try{var b=new ActiveXObject("MathPlayer.Factory.1");return null}catch(a){return AMnoMathMLNote()}}else{return AMnoMathMLNote()}}}var AMcal=["\uD835\uDC9C","\uD835\uDC9D","\uD835\uDC9E","\uD835\uDC9F","\uD835\uDCA0","\uD835\uDCA1","\uD835\uDCA2","\uD835\uDCA3","\uD835\uDCA4","\uD835\uDCA5","\uD835\uDCA6","\uD835\uDCA7","\uD835\uDCA8","\uD835\uDCA9","\uD835\uDCAA","\uD835\uDCAB","\uD835\uDCAC","\uD835\uDCAD","\uD835\uDCAE","\uD835\uDCAF","\uD835\uDCB0","\uD835\uDCB1","\uD835\uDCB2","\uD835\uDCB3","\uD835\uDCB4","\uD835\uDCB5"];var AMfrk=["\uD835\uDD04","\uD835\uDD05","\uD835\uDD06","\uD835\uDD07","\uD835\uDD08","\uD835\uDD09","\uD835\uDD0A","\uD835\uDD0B","\uD835\uDD0C","\uD835\uDD0D","\uD835\uDD0E","\uD835\uDD0F","\uD835\uDD10","\uD835\uDD11","\uD835\uDD12","\uD835\uDD13","\uD835\uDD14","\uD835\uDD15","\uD835\uDD16","\uD835\uDD17","\uD835\uDD18","\uD835\uDD19","\uD835\uDD1A","\uD835\uDD1B","\uD835\uDD1C","\uD835\uDD1D"];var AMbbb=["\uD835\uDD38","\uD835\uDD39","\uD835\uDD3A","\uD835\uDD3B","\uD835\uDD3C","\uD835\uDD3D","\uD835\uDD3E","\uD835\uDD3F","\uD835\uDD40","\uD835\uDD41","\uD835\uDD42","\uD835\uDD43","\uD835\uDD44","\uD835\uDD45","\uD835\uDD46","\uD835\uDD47","\uD835\uDD48","\uD835\uDD49","\uD835\uDD4A","\uD835\uDD4B","\uD835\uDD4C","\uD835\uDD4D","\uD835\uDD4E","\uD835\uDD4F","\uD835\uDD50","\uD835\uDD51"];var CONST=0,UNARY=1,BINARY=2,INFIX=3,LEFTBRACKET=4,RIGHTBRACKET=5,SPACE=6,UNDEROVER=7,DEFINITION=8,TEXT=9,BIG=10,LONG=11,STRETCHY=12,MATRIX=13;var AMsqrt={input:"\\sqrt",tag:"msqrt",output:"sqrt",ttype:UNARY},AMnot={input:"\\not",tag:"mnot",output:"not",ttype:UNARY},AMroot={input:"\\root",tag:"mroot",output:"root",ttype:BINARY},AMfrac={input:"\\frac",tag:"mfrac",output:"/",ttype:BINARY},AMover={input:"\\stackrel",tag:"mover",output:"stackrel",ttype:BINARY},AMatop={input:"\\atop",tag:"mfrac",output:"",ttype:INFIX},AMchoose={input:"\\choose",tag:"mfrac",output:"",ttype:INFIX},AMsub={input:"_",tag:"msub",output:"_",ttype:INFIX},AMsup={input:"^",tag:"msup",output:"^",ttype:INFIX},AMtext={input:"\\mathrm",tag:"mtext",output:"text",ttype:TEXT},AMmbox={input:"\\mbox",tag:"mtext",output:"mbox",ttype:TEXT};var AMRelationNegations={"\u003C":"\u226E","\u003E":"\u226F","\u2264":"\u2270","\u2265":"\u2271","\u003D":"\u2260","\u2261":"\u2262","\u227A":"\u2280","\u227B":"\u2281","\u227C":"\u22E0","\u227D":"\u22E1","\u223C":"\u2241","\u2243":"\u2244","\u2282":"\u2284","\u2283":"\u2285","\u2286":"\u2288","\u2287":"\u2289","\u2248":"\u2249","\u2245":"\u2247","\u2291":"\u22E2","\u2292":"\u22E3","\u224D":"\u226D"};var AMsymbols=[{input:"\\alpha",tag:"mi",output:"\u03B1",ttype:CONST},{input:"\\beta",tag:"mi",output:"\u03B2",ttype:CONST},{input:"\\gamma",tag:"mi",output:"\u03B3",ttype:CONST},{input:"\\delta",tag:"mi",output:"\u03B4",ttype:CONST},{input:"\\epsilon",tag:"mi",output:"\u03B5",ttype:CONST},{input:"\\varepsilon",tag:"mi",output:"\u025B",ttype:CONST},{input:"\\zeta",tag:"mi",output:"\u03B6",ttype:CONST},{input:"\\eta",tag:"mi",output:"\u03B7",ttype:CONST},{input:"\\theta",tag:"mi",output:"\u03B8",ttype:CONST},{input:"\\vartheta",tag:"mi",output:"\u03D1",ttype:CONST},{input:"\\iota",tag:"mi",output:"\u03B9",ttype:CONST},{input:"\\kappa",tag:"mi",output:"\u03BA",ttype:CONST},{input:"\\lambda",tag:"mi",output:"\u03BB",ttype:CONST},{input:"\\mu",tag:"mi",output:"\u03BC",ttype:CONST},{input:"\\nu",tag:"mi",output:"\u03BD",ttype:CONST},{input:"\\xi",tag:"mi",output:"\u03BE",ttype:CONST},{input:"\\pi",tag:"mi",output:"\u03C0",ttype:CONST},{input:"\\varpi",tag:"mi",output:"\u03D6",ttype:CONST},{input:"\\rho",tag:"mi",output:"\u03C1",ttype:CONST},{input:"\\varrho",tag:"mi",output:"\u03F1",ttype:CONST},{input:"\\varsigma",tag:"mi",output:"\u03C2",ttype:CONST},{input:"\\sigma",tag:"mi",output:"\u03C3",ttype:CONST},{input:"\\tau",tag:"mi",output:"\u03C4",ttype:CONST},{input:"\\upsilon",tag:"mi",output:"\u03C5",ttype:CONST},{input:"\\phi",tag:"mi",output:"\u03C6",ttype:CONST},{input:"\\varphi",tag:"mi",output:"\u03D5",ttype:CONST},{input:"\\chi",tag:"mi",output:"\u03C7",ttype:CONST},{input:"\\psi",tag:"mi",output:"\u03C8",ttype:CONST},{input:"\\omega",tag:"mi",output:"\u03C9",ttype:CONST},{input:"\\Gamma",tag:"mo",output:"\u0393",ttype:CONST},{input:"\\Delta",tag:"mo",output:"\u0394",ttype:CONST},{input:"\\Theta",tag:"mo",output:"\u0398",ttype:CONST},{input:"\\Lambda",tag:"mo",output:"\u039B",ttype:CONST},{input:"\\Xi",tag:"mo",output:"\u039E",ttype:CONST},{input:"\\Pi",tag:"mo",output:"\u03A0",ttype:CONST},{input:"\\Sigma",tag:"mo",output:"\u03A3",ttype:CONST},{input:"\\Upsilon",tag:"mo",output:"\u03A5",ttype:CONST},{input:"\\Phi",tag:"mo",output:"\u03A6",ttype:CONST},{input:"\\Psi",tag:"mo",output:"\u03A8",ttype:CONST},{input:"\\Omega",tag:"mo",output:"\u03A9",ttype:CONST},{input:"\\frac12",tag:"mo",output:"\u00BD",ttype:CONST},{input:"\\frac14",tag:"mo",output:"\u00BC",ttype:CONST},{input:"\\frac34",tag:"mo",output:"\u00BE",ttype:CONST},{input:"\\frac13",tag:"mo",output:"\u2153",ttype:CONST},{input:"\\frac23",tag:"mo",output:"\u2154",ttype:CONST},{input:"\\frac15",tag:"mo",output:"\u2155",ttype:CONST},{input:"\\frac25",tag:"mo",output:"\u2156",ttype:CONST},{input:"\\frac35",tag:"mo",output:"\u2157",ttype:CONST},{input:"\\frac45",tag:"mo",output:"\u2158",ttype:CONST},{input:"\\frac16",tag:"mo",output:"\u2159",ttype:CONST},{input:"\\frac56",tag:"mo",output:"\u215A",ttype:CONST},{input:"\\frac18",tag:"mo",output:"\u215B",ttype:CONST},{input:"\\frac38",tag:"mo",output:"\u215C",ttype:CONST},{input:"\\frac58",tag:"mo",output:"\u215D",ttype:CONST},{input:"\\frac78",tag:"mo",output:"\u215E",ttype:CONST},{input:"\\pm",tag:"mo",output:"\u00B1",ttype:CONST},{input:"\\mp",tag:"mo",output:"\u2213",ttype:CONST},{input:"\\triangleleft",tag:"mo",output:"\u22B2",ttype:CONST},{input:"\\triangleright",tag:"mo",output:"\u22B3",ttype:CONST},{input:"\\cdot",tag:"mo",output:"\u22C5",ttype:CONST},{input:"\\star",tag:"mo",output:"\u22C6",ttype:CONST},{input:"\\ast",tag:"mo",output:"\u002A",ttype:CONST},{input:"\\times",tag:"mo",output:"\u00D7",ttype:CONST},{input:"\\div",tag:"mo",output:"\u00F7",ttype:CONST},{input:"\\circ",tag:"mo",output:"\u2218",ttype:CONST},{input:"\\bullet",tag:"mo",output:"\u2022",ttype:CONST},{input:"\\oplus",tag:"mo",output:"\u2295",ttype:CONST},{input:"\\ominus",tag:"mo",output:"\u2296",ttype:CONST},{input:"\\otimes",tag:"mo",output:"\u2297",ttype:CONST},{input:"\\bigcirc",tag:"mo",output:"\u25CB",ttype:CONST},{input:"\\oslash",tag:"mo",output:"\u2298",ttype:CONST},{input:"\\odot",tag:"mo",output:"\u2299",ttype:CONST},{input:"\\land",tag:"mo",output:"\u2227",ttype:CONST},{input:"\\wedge",tag:"mo",output:"\u2227",ttype:CONST},{input:"\\lor",tag:"mo",output:"\u2228",ttype:CONST},{input:"\\vee",tag:"mo",output:"\u2228",ttype:CONST},{input:"\\cap",tag:"mo",output:"\u2229",ttype:CONST},{input:"\\cup",tag:"mo",output:"\u222A",ttype:CONST},{input:"\\sqcap",tag:"mo",output:"\u2293",ttype:CONST},{input:"\\sqcup",tag:"mo",output:"\u2294",ttype:CONST},{input:"\\uplus",tag:"mo",output:"\u228E",ttype:CONST},{input:"\\amalg",tag:"mo",output:"\u2210",ttype:CONST},{input:"\\bigtriangleup",tag:"mo",output:"\u25B3",ttype:CONST},{input:"\\bigtriangledown",tag:"mo",output:"\u25BD",ttype:CONST},{input:"\\dag",tag:"mo",output:"\u2020",ttype:CONST},{input:"\\dagger",tag:"mo",output:"\u2020",ttype:CONST},{input:"\\ddag",tag:"mo",output:"\u2021",ttype:CONST},{input:"\\ddagger",tag:"mo",output:"\u2021",ttype:CONST},{input:"\\lhd",tag:"mo",output:"\u22B2",ttype:CONST},{input:"\\rhd",tag:"mo",output:"\u22B3",ttype:CONST},{input:"\\unlhd",tag:"mo",output:"\u22B4",ttype:CONST},{input:"\\unrhd",tag:"mo",output:"\u22B5",ttype:CONST},{input:"\\sum",tag:"mo",output:"\u2211",ttype:UNDEROVER},{input:"\\prod",tag:"mo",output:"\u220F",ttype:UNDEROVER},{input:"\\bigcap",tag:"mo",output:"\u22C2",ttype:UNDEROVER},{input:"\\bigcup",tag:"mo",output:"\u22C3",ttype:UNDEROVER},{input:"\\bigwedge",tag:"mo",output:"\u22C0",ttype:UNDEROVER},{input:"\\bigvee",tag:"mo",output:"\u22C1",ttype:UNDEROVER},{input:"\\bigsqcap",tag:"mo",output:"\u2A05",ttype:UNDEROVER},{input:"\\bigsqcup",tag:"mo",output:"\u2A06",ttype:UNDEROVER},{input:"\\coprod",tag:"mo",output:"\u2210",ttype:UNDEROVER},{input:"\\bigoplus",tag:"mo",output:"\u2A01",ttype:UNDEROVER},{input:"\\bigotimes",tag:"mo",output:"\u2A02",ttype:UNDEROVER},{input:"\\bigodot",tag:"mo",output:"\u2A00",ttype:UNDEROVER},{input:"\\biguplus",tag:"mo",output:"\u2A04",ttype:UNDEROVER},{input:"\\int",tag:"mo",output:"\u222B",ttype:CONST},{input:"\\oint",tag:"mo",output:"\u222E",ttype:CONST},{input:":=",tag:"mo",output:":=",ttype:CONST},{input:"\\lt",tag:"mo",output:"<",ttype:CONST},{input:"\\gt",tag:"mo",output:">",ttype:CONST},{input:"\\ne",tag:"mo",output:"\u2260",ttype:CONST},{input:"\\neq",tag:"mo",output:"\u2260",ttype:CONST},{input:"\\le",tag:"mo",output:"\u2264",ttype:CONST},{input:"\\leq",tag:"mo",output:"\u2264",ttype:CONST},{input:"\\leqslant",tag:"mo",output:"\u2264",ttype:CONST},{input:"\\ge",tag:"mo",output:"\u2265",ttype:CONST},{input:"\\geq",tag:"mo",output:"\u2265",ttype:CONST},{input:"\\geqslant",tag:"mo",output:"\u2265",ttype:CONST},{input:"\\equiv",tag:"mo",output:"\u2261",ttype:CONST},{input:"\\ll",tag:"mo",output:"\u226A",ttype:CONST},{input:"\\gg",tag:"mo",output:"\u226B",ttype:CONST},{input:"\\doteq",tag:"mo",output:"\u2250",ttype:CONST},{input:"\\prec",tag:"mo",output:"\u227A",ttype:CONST},{input:"\\succ",tag:"mo",output:"\u227B",ttype:CONST},{input:"\\preceq",tag:"mo",output:"\u227C",ttype:CONST},{input:"\\succeq",tag:"mo",output:"\u227D",ttype:CONST},{input:"\\subset",tag:"mo",output:"\u2282",ttype:CONST},{input:"\\supset",tag:"mo",output:"\u2283",ttype:CONST},{input:"\\subseteq",tag:"mo",output:"\u2286",ttype:CONST},{input:"\\supseteq",tag:"mo",output:"\u2287",ttype:CONST},{input:"\\subsetneq",tag:"mo",output:"\u228A",ttype:CONST},{input:"\\supsetneq",tag:"mo",output:"\u228B",ttype:CONST},{input:"\\sqsubset",tag:"mo",output:"\u228F",ttype:CONST},{input:"\\sqsupset",tag:"mo",output:"\u2290",ttype:CONST},{input:"\\sqsubseteq",tag:"mo",output:"\u2291",ttype:CONST},{input:"\\sqsupseteq",tag:"mo",output:"\u2292",ttype:CONST},{input:"\\sim",tag:"mo",output:"\u223C",ttype:CONST},{input:"\\simeq",tag:"mo",output:"\u2243",ttype:CONST},{input:"\\approx",tag:"mo",output:"\u2248",ttype:CONST},{input:"\\cong",tag:"mo",output:"\u2245",ttype:CONST},{input:"\\Join",tag:"mo",output:"\u22C8",ttype:CONST},{input:"\\bowtie",tag:"mo",output:"\u22C8",ttype:CONST},{input:"\\in",tag:"mo",output:"\u2208",ttype:CONST},{input:"\\ni",tag:"mo",output:"\u220B",ttype:CONST},{input:"\\owns",tag:"mo",output:"\u220B",ttype:CONST},{input:"\\propto",tag:"mo",output:"\u221D",ttype:CONST},{input:"\\vdash",tag:"mo",output:"\u22A2",ttype:CONST},{input:"\\dashv",tag:"mo",output:"\u22A3",ttype:CONST},{input:"\\models",tag:"mo",output:"\u22A8",ttype:CONST},{input:"\\perp",tag:"mo",output:"\u22A5",ttype:CONST},{input:"\\smile",tag:"mo",output:"\u2323",ttype:CONST},{input:"\\frown",tag:"mo",output:"\u2322",ttype:CONST},{input:"\\asymp",tag:"mo",output:"\u224D",ttype:CONST},{input:"\\notin",tag:"mo",output:"\u2209",ttype:CONST},{input:"\\begin{eqnarray}",output:"X",ttype:MATRIX,invisible:true},{input:"\\begin{array}",output:"X",ttype:MATRIX,invisible:true},{input:"\\\\",output:"}&{",ttype:DEFINITION},{input:"\\end{eqnarray}",output:"}}",ttype:DEFINITION},{input:"\\end{array}",output:"}}",ttype:DEFINITION},{input:"\\big",tag:"mo",output:"X",atval:"1.2",ieval:"2.2",ttype:BIG},{input:"\\Big",tag:"mo",output:"X",atval:"1.6",ieval:"2.6",ttype:BIG},{input:"\\bigg",tag:"mo",output:"X",atval:"2.2",ieval:"3.2",ttype:BIG},{input:"\\Bigg",tag:"mo",output:"X",atval:"2.9",ieval:"3.9",ttype:BIG},{input:"\\left",tag:"mo",output:"X",ttype:LEFTBRACKET},{input:"\\right",tag:"mo",output:"X",ttype:RIGHTBRACKET},{input:"{",output:"{",ttype:LEFTBRACKET,invisible:true},{input:"}",output:"}",ttype:RIGHTBRACKET,invisible:true},{input:"(",tag:"mo",output:"(",atval:"1",ttype:STRETCHY},{input:"[",tag:"mo",output:"[",atval:"1",ttype:STRETCHY},{input:"\\lbrack",tag:"mo",output:"[",atval:"1",ttype:STRETCHY},{input:"\\{",tag:"mo",output:"{",atval:"1",ttype:STRETCHY},{input:"\\lbrace",tag:"mo",output:"{",atval:"1",ttype:STRETCHY},{input:"\\langle",tag:"mo",output:"\u2329",atval:"1",ttype:STRETCHY},{input:"\\lfloor",tag:"mo",output:"\u230A",atval:"1",ttype:STRETCHY},{input:"\\lceil",tag:"mo",output:"\u2308",atval:"1",ttype:STRETCHY},{input:")",tag:"mo",output:")",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"]",tag:"mo",output:"]",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rbrack",tag:"mo",output:"]",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\}",tag:"mo",output:"}",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rbrace",tag:"mo",output:"}",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rangle",tag:"mo",output:"\u232A",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rfloor",tag:"mo",output:"\u230B",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"\\rceil",tag:"mo",output:"\u2309",rtag:"mi",atval:"1",ttype:STRETCHY},{input:"|",tag:"mo",output:"\u2223",atval:"1",ttype:STRETCHY},{input:"\\|",tag:"mo",output:"\u2225",atval:"1",ttype:STRETCHY},{input:"\\vert",tag:"mo",output:"\u2223",atval:"1",ttype:STRETCHY},{input:"\\Vert",tag:"mo",output:"\u2225",atval:"1",ttype:STRETCHY},{input:"\\mid",tag:"mo",output:"\u2223",atval:"1",ttype:STRETCHY},{input:"\\parallel",tag:"mo",output:"\u2225",atval:"1",ttype:STRETCHY},{input:"/",tag:"mo",output:"/",atval:"1.01",ttype:STRETCHY},{input:"\\backslash",tag:"mo",output:"\u2216",atval:"1",ttype:STRETCHY},{input:"\\setminus",tag:"mo",output:"\\",ttype:CONST},{input:"\\!",tag:"mspace",atname:"width",atval:"-0.167em",ttype:SPACE},{input:"\\,",tag:"mspace",atname:"width",atval:"0.167em",ttype:SPACE},{input:"\\>",tag:"mspace",atname:"width",atval:"0.222em",ttype:SPACE},{input:"\\:",tag:"mspace",atname:"width",atval:"0.222em",ttype:SPACE},{input:"\\;",tag:"mspace",atname:"width",atval:"0.278em",ttype:SPACE},{input:"~",tag:"mspace",atname:"width",atval:"0.333em",ttype:SPACE},{input:"\\quad",tag:"mspace",atname:"width",atval:"1em",ttype:SPACE},{input:"\\qquad",tag:"mspace",atname:"width",atval:"2em",ttype:SPACE},{input:"\\prime",tag:"mo",output:"\u2032",ttype:CONST},{input:"'",tag:"mo",output:"\u02B9",ttype:CONST},{input:"''",tag:"mo",output:"\u02BA",ttype:CONST},{input:"'''",tag:"mo",output:"\u2034",ttype:CONST},{input:"''''",tag:"mo",output:"\u2057",ttype:CONST},{input:"\\ldots",tag:"mo",output:"\u2026",ttype:CONST},{input:"\\cdots",tag:"mo",output:"\u22EF",ttype:CONST},{input:"\\vdots",tag:"mo",output:"\u22EE",ttype:CONST},{input:"\\ddots",tag:"mo",output:"\u22F1",ttype:CONST},{input:"\\forall",tag:"mo",output:"\u2200",ttype:CONST},{input:"\\exists",tag:"mo",output:"\u2203",ttype:CONST},{input:"\\Re",tag:"mo",output:"\u211C",ttype:CONST},{input:"\\Im",tag:"mo",output:"\u2111",ttype:CONST},{input:"\\aleph",tag:"mo",output:"\u2135",ttype:CONST},{input:"\\hbar",tag:"mo",output:"\u210F",ttype:CONST},{input:"\\ell",tag:"mo",output:"\u2113",ttype:CONST},{input:"\\wp",tag:"mo",output:"\u2118",ttype:CONST},{input:"\\emptyset",tag:"mo",output:"\u2205",ttype:CONST},{input:"\\infty",tag:"mo",output:"\u221E",ttype:CONST},{input:"\\surd",tag:"mo",output:"\\sqrt{}",ttype:DEFINITION},{input:"\\partial",tag:"mo",output:"\u2202",ttype:CONST},{input:"\\nabla",tag:"mo",output:"\u2207",ttype:CONST},{input:"\\triangle",tag:"mo",output:"\u25B3",ttype:CONST},{input:"\\therefore",tag:"mo",output:"\u2234",ttype:CONST},{input:"\\angle",tag:"mo",output:"\u2220",ttype:CONST},{input:"\\diamond",tag:"mo",output:"\u22C4",ttype:CONST},{input:"\\Diamond",tag:"mo",output:"\u25C7",ttype:CONST},{input:"\\neg",tag:"mo",output:"\u00AC",ttype:CONST},{input:"\\lnot",tag:"mo",output:"\u00AC",ttype:CONST},{input:"\\bot",tag:"mo",output:"\u22A5",ttype:CONST},{input:"\\top",tag:"mo",output:"\u22A4",ttype:CONST},{input:"\\square",tag:"mo",output:"\u25AB",ttype:CONST},{input:"\\Box",tag:"mo",output:"\u25A1",ttype:CONST},{input:"\\wr",tag:"mo",output:"\u2240",ttype:CONST},{input:"\\arccos",tag:"mi",output:"arccos",ttype:UNARY,func:true},{input:"\\arcsin",tag:"mi",output:"arcsin",ttype:UNARY,func:true},{input:"\\arctan",tag:"mi",output:"arctan",ttype:UNARY,func:true},{input:"\\arg",tag:"mi",output:"arg",ttype:UNARY,func:true},{input:"\\cos",tag:"mi",output:"cos",ttype:UNARY,func:true},{input:"\\cosh",tag:"mi",output:"cosh",ttype:UNARY,func:true},{input:"\\cot",tag:"mi",output:"cot",ttype:UNARY,func:true},{input:"\\coth",tag:"mi",output:"coth",ttype:UNARY,func:true},{input:"\\csc",tag:"mi",output:"csc",ttype:UNARY,func:true},{input:"\\deg",tag:"mi",output:"deg",ttype:UNARY,func:true},{input:"\\det",tag:"mi",output:"det",ttype:UNARY,func:true},{input:"\\dim",tag:"mi",output:"dim",ttype:UNARY,func:true},{input:"\\exp",tag:"mi",output:"exp",ttype:UNARY,func:true},{input:"\\gcd",tag:"mi",output:"gcd",ttype:UNARY,func:true},{input:"\\hom",tag:"mi",output:"hom",ttype:UNARY,func:true},{input:"\\inf",tag:"mo",output:"inf",ttype:UNDEROVER},{input:"\\ker",tag:"mi",output:"ker",ttype:UNARY,func:true},{input:"\\lg",tag:"mi",output:"lg",ttype:UNARY,func:true},{input:"\\lim",tag:"mo",output:"lim",ttype:UNDEROVER},{input:"\\liminf",tag:"mo",output:"liminf",ttype:UNDEROVER},{input:"\\limsup",tag:"mo",output:"limsup",ttype:UNDEROVER},{input:"\\ln",tag:"mi",output:"ln",ttype:UNARY,func:true},{input:"\\log",tag:"mi",output:"log",ttype:UNARY,func:true},{input:"\\max",tag:"mo",output:"max",ttype:UNDEROVER},{input:"\\min",tag:"mo",output:"min",ttype:UNDEROVER},{input:"\\Pr",tag:"mi",output:"Pr",ttype:UNARY,func:true},{input:"\\sec",tag:"mi",output:"sec",ttype:UNARY,func:true},{input:"\\sin",tag:"mi",output:"sin",ttype:UNARY,func:true},{input:"\\sinh",tag:"mi",output:"sinh",ttype:UNARY,func:true},{input:"\\sup",tag:"mo",output:"sup",ttype:UNDEROVER},{input:"\\tan",tag:"mi",output:"tan",ttype:UNARY,func:true},{input:"\\tanh",tag:"mi",output:"tanh",ttype:UNARY,func:true},{input:"\\gets",tag:"mo",output:"\u2190",ttype:CONST},{input:"\\leftarrow",tag:"mo",output:"\u2190",ttype:CONST},{input:"\\to",tag:"mo",output:"\u2192",ttype:CONST},{input:"\\rightarrow",tag:"mo",output:"\u2192",ttype:CONST},{input:"\\leftrightarrow",tag:"mo",output:"\u2194",ttype:CONST},{input:"\\uparrow",tag:"mo",output:"\u2191",ttype:CONST},{input:"\\downarrow",tag:"mo",output:"\u2193",ttype:CONST},{input:"\\updownarrow",tag:"mo",output:"\u2195",ttype:CONST},{input:"\\Leftarrow",tag:"mo",output:"\u21D0",ttype:CONST},{input:"\\Rightarrow",tag:"mo",output:"\u21D2",ttype:CONST},{input:"\\Leftrightarrow",tag:"mo",output:"\u21D4",ttype:CONST},{input:"\\iff",tag:"mo",output:"~\\Longleftrightarrow~",ttype:DEFINITION},{input:"\\Uparrow",tag:"mo",output:"\u21D1",ttype:CONST},{input:"\\Downarrow",tag:"mo",output:"\u21D3",ttype:CONST},{input:"\\Updownarrow",tag:"mo",output:"\u21D5",ttype:CONST},{input:"\\mapsto",tag:"mo",output:"\u21A6",ttype:CONST},{input:"\\longleftarrow",tag:"mo",output:"\u2190",ttype:LONG},{input:"\\longrightarrow",tag:"mo",output:"\u2192",ttype:LONG},{input:"\\longleftrightarrow",tag:"mo",output:"\u2194",ttype:LONG},{input:"\\Longleftarrow",tag:"mo",output:"\u21D0",ttype:LONG},{input:"\\Longrightarrow",tag:"mo",output:"\u21D2",ttype:LONG},{input:"\\Longleftrightarrow",tag:"mo",output:"\u21D4",ttype:LONG},{input:"\\longmapsto",tag:"mo",output:"\u21A6",ttype:CONST},AMsqrt,AMnot,AMroot,AMfrac,AMover,AMsub,AMsup,AMtext,AMmbox,AMatop,AMchoose,{input:"\\acute",tag:"mover",output:"\u00B4",ttype:UNARY,acc:true},{input:"\\grave",tag:"mover",output:"\u0060",ttype:UNARY,acc:true},{input:"\\breve",tag:"mover",output:"\u02D8",ttype:UNARY,acc:true},{input:"\\check",tag:"mover",output:"\u02C7",ttype:UNARY,acc:true},{input:"\\dot",tag:"mover",output:".",ttype:UNARY,acc:true},{input:"\\ddot",tag:"mover",output:"..",ttype:UNARY,acc:true},{input:"\\mathring",tag:"mover",output:"\u00B0",ttype:UNARY,acc:true},{input:"\\vec",tag:"mover",output:"\u20D7",ttype:UNARY,acc:true},{input:"\\overrightarrow",tag:"mover",output:"\u20D7",ttype:UNARY,acc:true},{input:"\\overleftarrow",tag:"mover",output:"\u20D6",ttype:UNARY,acc:true},{input:"\\hat",tag:"mover",output:"\u005E",ttype:UNARY,acc:true},{input:"\\widehat",tag:"mover",output:"\u0302",ttype:UNARY,acc:true},{input:"\\tilde",tag:"mover",output:"~",ttype:UNARY,acc:true},{input:"\\widetilde",tag:"mover",output:"\u02DC",ttype:UNARY,acc:true},{input:"\\bar",tag:"mover",output:"\u203E",ttype:UNARY,acc:true},{input:"\\overbrace",tag:"mover",output:"\uFE37",ttype:UNARY,acc:true},{input:"\\overbracket",tag:"mover",output:"\u23B4",ttype:UNARY,acc:true},{input:"\\overline",tag:"mover",output:"\u00AF",ttype:UNARY,acc:true},{input:"\\underbrace",tag:"munder",output:"\uFE38",ttype:UNARY,acc:true},{input:"\\underbracket",tag:"munder",output:"\u23B5",ttype:UNARY,acc:true},{input:"\\underline",tag:"munder",output:"\u00AF",ttype:UNARY,acc:true},{input:"\\displaystyle",tag:"mstyle",atname:"displaystyle",atval:"true",ttype:UNARY},{input:"\\textstyle",tag:"mstyle",atname:"displaystyle",atval:"false",ttype:UNARY},{input:"\\scriptstyle",tag:"mstyle",atname:"scriptlevel",atval:"1",ttype:UNARY},{input:"\\scriptscriptstyle",tag:"mstyle",atname:"scriptlevel",atval:"2",ttype:UNARY},{input:"\\textrm",tag:"mstyle",output:"\\mathrm",ttype:DEFINITION},{input:"\\mathbf",tag:"mstyle",atname:"mathvariant",atval:"bold",ttype:UNARY},{input:"\\textbf",tag:"mstyle",atname:"mathvariant",atval:"bold",ttype:UNARY},{input:"\\mathit",tag:"mstyle",atname:"mathvariant",atval:"italic",ttype:UNARY},{input:"\\textit",tag:"mstyle",atname:"mathvariant",atval:"italic",ttype:UNARY},{input:"\\mathtt",tag:"mstyle",atname:"mathvariant",atval:"monospace",ttype:UNARY},{input:"\\texttt",tag:"mstyle",atname:"mathvariant",atval:"monospace",ttype:UNARY},{input:"\\mathsf",tag:"mstyle",atname:"mathvariant",atval:"sans-serif",ttype:UNARY},{input:"\\mathbb",tag:"mstyle",atname:"mathvariant",atval:"double-struck",ttype:UNARY,codes:AMbbb},{input:"\\mathcal",tag:"mstyle",atname:"mathvariant",atval:"script",ttype:UNARY,codes:AMcal},{input:"\\mathfrak",tag:"mstyle",atname:"mathvariant",atval:"fraktur",ttype:UNARY,codes:AMfrk},{input:"\\textcolor",tag:"mstyle",atname:"mathvariant",atval:"mathcolor",ttype:BINARY},{input:"\\colorbox",tag:"mstyle",atname:"mathvariant",atval:"background",ttype:BINARY}];function compareNames(b,a){if(b.input>a.input){return 1}else{return -1}}var AMnames=[];function AMinitSymbols(){AMsymbols.sort(compareNames);for(i=0;i<AMsymbols.length;i++){AMnames[i]=AMsymbols[i].input}}var AMmathml="http://www.w3.org/1998/Math/MathML";function AMcreateElementMathML(a){if(isIE){return document.createElement("m:"+a)}else{return document.createElementNS(AMmathml,a)}}function AMcreateMmlNode(a,c){if(isIE){var b=document.createElement("m:"+a)}else{var b=document.createElementNS(AMmathml,a)}b.appendChild(c);return b}function newcommand(a,b){AMsymbols=AMsymbols.concat([{input:a,tag:"mo",output:b,ttype:DEFINITION}])}function AMremoveCharsAndBlanks(c,d){var a;a=c.slice(d);for(var b=0;b<a.length&&a.charCodeAt(b)<=32;b=b+1){}return a.slice(b)}function AMposition(b,e,f){if(f==0){var d,a;f=-1;d=b.length;while(f+1<d){a=(f+d)>>1;if(b[a]<e){f=a}else{d=a}}return d}else{for(var c=f;c<b.length&&b[c]<e;c++){}}return c}function AMgetSymbol(g){var a=0;var b=0;var d;var l;var h;var e="";var f=true;for(var c=1;c<=g.length&&f;c++){l=g.slice(0,c);b=a;a=AMposition(AMnames,l,b);if(a<AMnames.length&&g.slice(0,AMnames[a].length)==AMnames[a]){e=AMnames[a];d=a;c=e.length}f=a<AMnames.length&&g.slice(0,AMnames[a].length)>=AMnames[a]}AMpreviousSymbol=AMcurrentSymbol;if(e!=""){AMcurrentSymbol=AMsymbols[d].ttype;return AMsymbols[d]}AMcurrentSymbol=CONST;a=1;l=g.slice(0,1);if("0"<=l&&l<="9"){h="mn"}else{h=(("A">l||l>"Z")&&("a">l||l>"z")?"mo":"mi")}return{input:l,tag:h,output:l,ttype:CONST}}var AMpreviousSymbol,AMcurrentSymbol;function AMparseSexpr(n){var p,o,k,a,s,m,l=document.createDocumentFragment();n=AMremoveCharsAndBlanks(n,0);p=AMgetSymbol(n);if(p==null||p.ttype==RIGHTBRACKET){return[null,n,null]}if(p.ttype==DEFINITION){n=p.output+AMremoveCharsAndBlanks(n,p.input.length);p=AMgetSymbol(n);if(p==null||p.ttype==RIGHTBRACKET){return[null,n,null]}}n=AMremoveCharsAndBlanks(n,p.input.length);switch(p.ttype){case SPACE:o=AMcreateElementMathML(p.tag);o.setAttribute(p.atname,p.atval);return[o,n,p.tag];case UNDEROVER:if(isIE){if(p.input.substr(0,4)=="\\big"){n="\\"+p.input.substr(4)+n;p=AMgetSymbol(n);p.ttype=UNDEROVER;n=AMremoveCharsAndBlanks(n,p.input.length)}}return[AMcreateMmlNode(p.tag,document.createTextNode(p.output)),n,p.tag];case CONST:var g=p.output;if(isIE){if(p.input=="'"){g="\u2032"}else{if(p.input=="''"){g="\u2033"}else{if(p.input=="'''"){g="\u2033\u2032"}else{if(p.input=="''''"){g="\u2033\u2033"}else{if(p.input=="\\square"){g="\u25A1"}else{if(p.input.substr(0,5)=="\\frac"){var c=p.input.substr(6,1);if(c=="5"||c=="6"){n=p.input.replace(/\\frac/,"\\frac ")+n;return[o,n,p.tag]}}}}}}}}o=AMcreateMmlNode(p.tag,document.createTextNode(g));return[o,n,p.tag];case LONG:o=AMcreateMmlNode(p.tag,document.createTextNode(p.output));o.setAttribute("minsize","1.5");o.setAttribute("maxsize","1.5");o=AMcreateMmlNode("mover",o);o.appendChild(AMcreateElementMathML("mspace"));return[o,n,p.tag];case STRETCHY:if(isIE&&p.input=="\\backslash"){p.output="\\"}o=AMcreateMmlNode(p.tag,document.createTextNode(p.output));if(p.input=="|"||p.input=="\\vert"||p.input=="\\|"||p.input=="\\Vert"){o.setAttribute("lspace","0em");o.setAttribute("rspace","0em")}o.setAttribute("maxsize",p.atval);if(p.rtag!=null){return[o,n,p.rtag]}else{return[o,n,p.tag]}case BIG:var e=p.atval;if(isIE){e=p.ieval}p=AMgetSymbol(n);if(p==null){return[null,n,null]}n=AMremoveCharsAndBlanks(n,p.input.length);o=AMcreateMmlNode(p.tag,document.createTextNode(p.output));if(isIE){var u=AMcreateElementMathML("mspace");u.setAttribute("height",e+"ex");o=AMcreateMmlNode("mrow",o);o.appendChild(u)}else{o.setAttribute("minsize",e);o.setAttribute("maxsize",e)}return[o,n,p.tag];case LEFTBRACKET:if(p.input=="\\left"){p=AMgetSymbol(n);if(p!=null){if(p.input=="."){p.invisible=true}n=AMremoveCharsAndBlanks(n,p.input.length)}}k=AMparseExpr(n,true,false);if(p==null||(typeof p.invisible=="boolean"&&p.invisible)){o=AMcreateMmlNode("mrow",k[0])}else{o=AMcreateMmlNode("mo",document.createTextNode(p.output));o=AMcreateMmlNode("mrow",o);o.appendChild(k[0])}return[o,k[1],k[2]];case MATRIX:if(p.input=="\\begin{array}"){var r="";p=AMgetSymbol(n);n=AMremoveCharsAndBlanks(n,0);if(p==null){r="l"}else{n=AMremoveCharsAndBlanks(n,p.input.length);if(p.input!="{"){r="l"}else{do{p=AMgetSymbol(n);if(p!=null){n=AMremoveCharsAndBlanks(n,p.input.length);if(p.input!="}"){r=r+p.input}}}while(p!=null&&p.input!=""&&p.input!="}")}}k=AMparseExpr("{"+n,true,true);o=AMcreateMmlNode("mtable",k[0]);r=r.replace(/l/g,"left ");r=r.replace(/r/g,"right ");r=r.replace(/c/g,"center ");o.setAttribute("columnalign",r);o.setAttribute("displaystyle","false");if(isIE){return[o,k[1],null]}var d=AMcreateElementMathML("mspace");d.setAttribute("width","0.167em");var t=AMcreateElementMathML("mspace");t.setAttribute("width","0.167em");var b=AMcreateMmlNode("mrow",d);b.appendChild(o);b.appendChild(t);return[b,k[1],null]}else{k=AMparseExpr("{"+n,true,true);o=AMcreateMmlNode("mtable",k[0]);if(isIE){o.setAttribute("columnspacing","0.25em")}else{o.setAttribute("columnspacing","0.167em")}o.setAttribute("columnalign","right center left");o.setAttribute("displaystyle","true");o=AMcreateMmlNode("mrow",o);return[o,k[1],null]}case TEXT:if(n.charAt(0)=="{"){s=n.indexOf("}")}else{s=0}if(s==-1){s=n.length}m=n.slice(1,s);if(m.charAt(0)==" "){o=AMcreateElementMathML("mspace");o.setAttribute("width","0.33em");l.appendChild(o)}l.appendChild(AMcreateMmlNode(p.tag,document.createTextNode(m)));if(m.charAt(m.length-1)==" "){o=AMcreateElementMathML("mspace");o.setAttribute("width","0.33em");l.appendChild(o)}n=AMremoveCharsAndBlanks(n,s+1);return[AMcreateMmlNode("mrow",l),n,null];case UNARY:k=AMparseSexpr(n);if(k[0]==null){return[AMcreateMmlNode(p.tag,document.createTextNode(p.output)),n]}if(typeof p.func=="boolean"&&p.func){m=n.charAt(0);if(m=="^"||m=="_"||m==","){return[AMcreateMmlNode(p.tag,document.createTextNode(p.output)),n,p.tag]}else{o=AMcreateMmlNode("mrow",AMcreateMmlNode(p.tag,document.createTextNode(p.output)));if(isIE){var u=AMcreateElementMathML("mspace");u.setAttribute("width","0.167em");o.appendChild(u)}o.appendChild(k[0]);return[o,k[1],p.tag]}}if(p.input=="\\sqrt"){if(isIE){var u=AMcreateElementMathML("mspace");u.setAttribute("height","1.2ex");u.setAttribute("width","0em");o=AMcreateMmlNode(p.tag,k[0]);o.appendChild(u);return[o,k[1],p.tag]}else{return[AMcreateMmlNode(p.tag,k[0]),k[1],p.tag]}}else{if(typeof p.acc=="boolean"&&p.acc){o=AMcreateMmlNode(p.tag,k[0]);var g=p.output;if(isIE){if(p.input=="\\hat"){g="\u0302"}else{if(p.input=="\\widehat"){g="\u005E"}else{if(p.input=="\\bar"){g="\u00AF"}else{if(p.input=="\\grave"){g="\u0300"}else{if(p.input=="\\tilde"){g="\u0303"}}}}}}var b=AMcreateMmlNode("mo",document.createTextNode(g));if(p.input=="\\vec"||p.input=="\\check"){b.setAttribute("maxsize","1.2")}if(isIE&&p.input=="\\bar"){b.setAttribute("maxsize","0.5")}if(p.input=="\\underbrace"||p.input=="\\underline"){b.setAttribute("accentunder","true")}else{b.setAttribute("accent","true")}o.appendChild(b);if(p.input=="\\overbrace"||p.input=="\\underbrace"){o.ttype=UNDEROVER}return[o,k[1],p.tag]}else{if(p.input=="\\not"){text=k[0].childNodes[0].nodeValue;if(typeof text=="string"&&text.length==1&&text in AMRelationNegations){k[0].childNodes[0].nodeValue=AMRelationNegations[text];return[AMcreateMmlNode(p.tag,k[0]),k[1],p.tag]}return[AMcreateMmlNode("mo",document.createTextNode("\\")),"not "+n,p.tag]}else{if(!isIE&&typeof p.codes!="undefined"){for(s=0;s<k[0].childNodes.length;s++){if(k[0].childNodes[s].nodeName=="mi"||k[0].nodeName=="mi"){m=(k[0].nodeName=="mi"?k[0].firstChild.nodeValue:k[0].childNodes[s].firstChild.nodeValue);var h=[];for(var q=0;q<m.length;q++){if(m.charCodeAt(q)>64&&m.charCodeAt(q)<91){h=h+p.codes[m.charCodeAt(q)-65]}else{h=h+m.charAt(q)}}if(k[0].nodeName=="mi"){k[0]=AMcreateElementMathML("mo").appendChild(document.createTextNode(h))}else{k[0].replaceChild(AMcreateElementMathML("mo").appendChild(document.createTextNode(h)),k[0].childNodes[s])}}}}o=AMcreateMmlNode(p.tag,k[0]);o.setAttribute(p.atname,p.atval);if(p.input=="\\scriptstyle"||p.input=="\\scriptscriptstyle"){o.setAttribute("displaystyle","false")}return[o,k[1],p.tag]}}}case BINARY:k=AMparseSexpr(n);if(k[0]==null){return[AMcreateMmlNode("mo",document.createTextNode(p.input)),n,null]}a=AMparseSexpr(k[1]);if(a[0]==null){return[AMcreateMmlNode("mo",document.createTextNode(p.input)),n,null]}if(p.input=="\\textcolor"||p.input=="\\colorbox"){var f=n.match(/\{\s*([#\w]+)\s*\}/);n=n.replace(/\{\s*[#\w]+\s*\}/,"");if(f!=null){if(IsColorName.test(f[1].toLowerCase())){f=LaTeXColor[f[1].toLowerCase()]}else{f=f[1]}o=AMcreateElementMathML("mstyle");o.setAttribute(p.atval,f);o.appendChild(a[0]);return[o,a[1],p.tag]}}if(p.input=="\\root"||p.input=="\\stackrel"){l.appendChild(a[0])}l.appendChild(k[0]);if(p.input=="\\frac"){l.appendChild(a[0])}return[AMcreateMmlNode(p.tag,l),a[1],p.tag];case INFIX:n=AMremoveCharsAndBlanks(n,p.input.length);return[AMcreateMmlNode("mo",document.createTextNode(p.output)),n,p.tag];default:return[AMcreateMmlNode(p.tag,document.createTextNode(p.output)),n,p.tag]}}function AMparseIexpr(f){var e,c,b,d,h,j,g;f=AMremoveCharsAndBlanks(f,0);c=AMgetSymbol(f);h=AMparseSexpr(f);d=h[0];f=h[1];j=h[2];e=AMgetSymbol(f);if(e.ttype==INFIX){f=AMremoveCharsAndBlanks(f,e.input.length);h=AMparseSexpr(f);if(h[0]==null){h[0]=AMcreateMmlNode("mo",document.createTextNode("\u25A1"))}f=h[1];j=h[2];if(e.input=="_"||e.input=="^"){b=AMgetSymbol(f);j=null;g=((c.ttype==UNDEROVER)||(d.ttype==UNDEROVER));if(e.input=="_"&&b.input=="^"){f=AMremoveCharsAndBlanks(f,b.input.length);var a=AMparseSexpr(f);f=a[1];j=a[2];d=AMcreateMmlNode((g?"munderover":"msubsup"),d);d.appendChild(h[0]);d.appendChild(a[0])}else{if(e.input=="_"){d=AMcreateMmlNode((g?"munder":"msub"),d);d.appendChild(h[0])}else{d=AMcreateMmlNode((g?"mover":"msup"),d);d.appendChild(h[0])}}d=AMcreateMmlNode("mrow",d)}else{d=AMcreateMmlNode(e.tag,d);if(e.input=="\\atop"||e.input=="\\choose"){d.setAttribute("linethickness","0ex")}d.appendChild(h[0]);if(e.input=="\\choose"){d=AMcreateMmlNode("mfenced",d)}}}return[d,f,j]}function AMparseExpr(h,g,r){var q,l,d,t,x,e=document.createDocumentFragment();do{h=AMremoveCharsAndBlanks(h,0);d=AMparseIexpr(h);l=d[0];h=d[1];x=d[2];q=AMgetSymbol(h);if(l!=undefined){if((x=="mn"||x=="mi")&&q!=null&&typeof q.func=="boolean"&&q.func){var w=AMcreateElementMathML("mspace");w.setAttribute("width","0.167em");l=AMcreateMmlNode("mrow",l);l.appendChild(w)}e.appendChild(l)}}while((q.ttype!=RIGHTBRACKET)&&q!=null&&q.output!="");x=null;if(q.ttype==RIGHTBRACKET){if(q.input=="\\right"){h=AMremoveCharsAndBlanks(h,q.input.length);q=AMgetSymbol(h);if(q!=null&&q.input=="."){q.invisible=true}if(q!=null){x=q.rtag}}if(q!=null){h=AMremoveCharsAndBlanks(h,q.input.length)}var u=e.childNodes.length;if(r&&u>0&&e.childNodes[u-1].nodeName=="mrow"&&u>1&&e.childNodes[u-2].nodeName=="mo"&&e.childNodes[u-2].firstChild.nodeValue=="&"){var b=[];var o=e.childNodes.length;for(t=0;r&&t<o;t=t+2){b[t]=[];l=e.childNodes[t];for(var s=0;s<l.childNodes.length;s++){if(l.childNodes[s].firstChild.nodeValue=="&"){b[t][b[t].length]=s}}}var c,a,f,p,v=document.createDocumentFragment();for(t=0;t<o;t=t+2){c=document.createDocumentFragment();a=document.createDocumentFragment();l=e.firstChild;f=l.childNodes.length;p=0;for(s=0;s<f;s++){if(typeof b[t][p]!="undefined"&&s==b[t][p]){l.removeChild(l.firstChild);c.appendChild(AMcreateMmlNode("mtd",a));p++}else{a.appendChild(l.firstChild)}}c.appendChild(AMcreateMmlNode("mtd",a));if(e.childNodes.length>2){e.removeChild(e.firstChild);e.removeChild(e.firstChild)}v.appendChild(AMcreateMmlNode("mtr",c))}return[v,h]}if(typeof q.invisible!="boolean"||!q.invisible){l=AMcreateMmlNode("mo",document.createTextNode(q.output));e.appendChild(l)}}return[e,h,x]}function AMparseMath(e){var a,d=AMcreateElementMathML("mstyle");var c=e.match(/\\color\s*\{\s*([#\w]+)\s*\}/);e=e.replace(/\\color\s*\{\s*[#\w]+\s*\}/g,"");if(c!=null){if(IsColorName.test(c[1].toLowerCase())){c=LaTeXColor[c[1].toLowerCase()]}else{c=c[1]}d.setAttribute("mathcolor",c)}else{if(mathcolor!=""){d.setAttribute("mathcolor",mathcolor)}}if(mathfontfamily!=""){d.setAttribute("fontfamily",mathfontfamily)}d.appendChild(AMparseExpr(e.replace(/^\s+/g,""),false,false)[0]);d=AMcreateMmlNode("math",d);if(showasciiformulaonhover){d.setAttribute("title",e.replace(/\s+/g," "))}if(false){var b=AMcreateElementXHTML("font");b.setAttribute("face",mathfontfamily);b.appendChild(d);return b}return d}function AMstrarr2docFrag(a,d){var g=document.createDocumentFragment();var f=false;for(var e=0;e<a.length;e++){if(f){g.appendChild(AMparseMath(a[e]))}else{var b=(d?a[e].split("\n\n"):[a[e]]);g.appendChild(AMcreateElementXHTML("span").appendChild(document.createTextNode(b[0])));for(var c=1;c<b.length;c++){g.appendChild(AMcreateElementXHTML("p"));g.appendChild(AMcreateElementXHTML("span").appendChild(document.createTextNode(b[c])))}}f=!f}return g}function AMprocessNodeR(b,g){var j,h,e,a,d;if(b.childNodes.length==0){if((b.nodeType!=8||g)&&b.parentNode.nodeName!="form"&&b.parentNode.nodeName!="FORM"&&b.parentNode.nodeName!="textarea"&&b.parentNode.nodeName!="TEXTAREA"&&b.parentNode.nodeName!="pre"&&b.parentNode.nodeName!="PRE"){h=b.nodeValue;if(!(h==null)){h=h.replace(/\r\n\r\n/g,"\n\n");h=h.replace(/\x20+/g," ");h=h.replace(/\s*\r\n/g," ");j=(h.indexOf("$")==-1?false:true);h=h.replace(/([^\\])\$/g,"$1 $");h=h.replace(/^\$/," $");e=h.split(" $");for(d=0;d<e.length;d++){e[d]=e[d].replace(/\\\$/g,"$")}if(e.length>1||j){if(checkForMathML){checkForMathML=false;var c=AMisMathMLavailable();AMnoMathML=c!=null;if(AMnoMathML&&notifyIfNoMathML){if(alertIfNoMathML){alert("To view the ASCIIMathML notation use Internet Explorer 6 +\nMathPlayer (free from www.dessci.com)\n                              or Firefox/Mozilla/Netscape")}else{AMbody.insertBefore(c,AMbody.childNodes[0])}}}if(!AMnoMathML){a=AMstrarr2docFrag(e,b.nodeType==8);var f=a.childNodes.length;b.parentNode.replaceChild(a,b);return f-1}else{return 0}}}}else{return 0}}else{if(b.nodeName!="math"){for(d=0;d<b.childNodes.length;d++){d+=AMprocessNodeR(b.childNodes[d],g)}}}return 0}function AMprocessNode(g,b,e){var f,a;if(e!=null){f=document.getElementsByTagName("span");for(var c=0;c<f.length;c++){if(f[c].className=="AM"){AMprocessNodeR(f[c],b)}}}else{try{a=g.innerHTML}catch(d){}if(a==null||a.indexOf("$")!=-1){AMprocessNodeR(g,b)}}if(isIE){f=document.getElementsByTagName("math");for(var c=0;c<f.length;c++){f[c].update()}}}var inAppendix=false;var sectionCntr=0;var IEcommentWarning=true;var biblist=[];var bibcntr=0;var LaTeXCounter=[];LaTeXCounter.definition=0;LaTeXCounter.proposition=0;LaTeXCounter.lemma=0;LaTeXCounter.theorem=0;LaTeXCounter.corollary=0;LaTeXCounter.example=0;LaTeXCounter.exercise=0;LaTeXCounter.subsection=0;LaTeXCounter.subsubsection=0;LaTeXCounter.figure=0;LaTeXCounter.equation=0;LaTeXCounter.table=0;LaTeXCounter.label=0;var LaTeXColor=[];LaTeXColor.greenyellow="#D9FF4F";LaTeXColor.yellow="#FFFF00";LaTeXColor.goldenrod="#FFE529";LaTeXColor.dandelion="#FFB529";LaTeXColor.apricot="#FFAD7A";LaTeXColor.peach="#FF804D";LaTeXColor.melon="#FF8A80";LaTeXColor.yelloworange="#FF9400";LaTeXColor.orange="#FF6321";LaTeXColor.burntorange="#FF7D00";LaTeXColor.bittersweet="#C20300";LaTeXColor.redorange="#FF3B21";LaTeXColor.mahogany="#A60000";LaTeXColor.maroon="#AD0000";LaTeXColor.brickred="#B80000";LaTeXColor.red="#FF0000";LaTeXColor.orangered="#FF0080";LaTeXColor.rubinered="#FF00DE";LaTeXColor.wildstrawberry="#FF0A9C";LaTeXColor.salmon="#FF789E";LaTeXColor.carnationpink="#FF5EFF";LaTeXColor.magenta="#FF00FF";LaTeXColor.violetred="#FF30FF";LaTeXColor.rhodamine="#FF2EFF";LaTeXColor.mulberry="#A314FA";LaTeXColor.redviolet="#9600A8";LaTeXColor.fuchsia="#7303EB";LaTeXColor.lavender="#FF85FF";LaTeXColor.thistle="#E069FF";LaTeXColor.orchid="#AD5CFF";LaTeXColor.darkorchid="#9933CC";LaTeXColor.purple="#8C24FF";LaTeXColor.plum="#8000FF";LaTeXColor.violet="#361FFF";LaTeXColor.royalpurple="#401AFF";LaTeXColor.blueviolet="#1A0DF5";LaTeXColor.periwinkle="#6E73FF";LaTeXColor.cadetblue="#616EC4";LaTeXColor.cornflowerblue="#59DEFF";LaTeXColor.midnightblue="#007091";LaTeXColor.navyblue="#0F75FF";LaTeXColor.royalblue="#0080FF";LaTeXColor.blue="#0000FF";LaTeXColor.cerulean="#0FE3FF";LaTeXColor.cyan="#00FFFF";LaTeXColor.processblue="#0AFFFF";LaTeXColor.skyblue="#61FFE0";LaTeXColor.turquoise="#26FFCC";LaTeXColor.tealblue="#1FFAA3";LaTeXColor.aquamarine="#2EFFB2";LaTeXColor.bluegreen="#26FFAB";LaTeXColor.emerald="#00FF80";LaTeXColor.junglegreen="#03FF7A";LaTeXColor.seagreen="#4FFF80";LaTeXColor.green="#00FF00";LaTeXColor.forestgreen="#00E000";LaTeXColor.pinegreen="#00BF29";LaTeXColor.limegreen="#80FF00";LaTeXColor.yellowgreen="#8FFF42";LaTeXColor.springgreen="#BDFF3D";LaTeXColor.olivegreen="#009900";LaTeXColor.rawsienna="#8C0000";LaTeXColor.sepia="#4D0000";LaTeXColor.brown="#660000";LaTeXColor.tan="#DB9470";LaTeXColor.gray="#808080";LaTeXColor.grey="#808080";LaTeXColor.black="#000000";LaTeXColor.white="#FFFFFF";var IsColorName=/^(?:greenyellow|yellow|goldenrod|dandelion|apricot|peach|melon|yelloworange|orange|burntorange|bittersweet|redorange|mahogany|maroon|brickred|red|orangered|rubinered|wildstrawberry|salmon|carnationpink|magenta|violetred|rhodamine|mulberry|redviolet|fuchsia|lavender|thistle|orchid|darkorchid|purple|plum|violet|royalpurple|blueviolet|periwinkle|cadetblue|cornflowerblue|midnightblue|navyblue|royalblue|blue|cerulean|cyan|processblue|skyblue|turquoise|tealblue|aquamarine|bluegreen|emerald|junglegreen|seagreen|green|forestgreen|pinegreen|limegreen|yellowgreen|springgreen|olivegreen|rawsienna|sepia|brown|tan|gray|grey|black|white)$/;var IsCounter=/^(?:definition|proposition|lemma|theorem|corollary|example|exercise|subsection|subsubsection|figure|equation|table)$/;var IsLaTeXElement=/^(?:displayequation|title|author|address|date|abstract|keyword|section|subsection|subsubsection|ref|cite|thebibliography|definition|proposition|lemma|theorem|corollary|example|exercise|itemize|enumerate|enddefinition|endproposition|endlemma|endtheorem|endcorollary|endexample|endexercise|enditemize|endenumerate|LaTeXMathMLlabel|LaTeXMathML|smallskip|medskip|bigskip|quote|quotation|endquote|endquotation|center|endcenter|description|enddescription|inlinemath)$/;var IsTextOnlyArea=/^(?:form|textarea|pre)$/i;var tableid=0;function makeNumberString(a){if(sectionCntr>0){if(inAppendix){return"A"+sectionCntr+"."+a}else{return sectionCntr+"."+a}}else{return""+a}}function LaTeXpreProcess(X){var O=X;if(O.hasChildNodes()){if(!(IsLaTeXElement.test(O.className))){for(var I=0;I<O.childNodes.length;I++){LaTeXpreProcess(O.childNodes[I])}}}else{if(O.nodeType==3&&!(IsTextOnlyArea.test(O.parentNode.nodeName))){var ax=O.nodeValue;if(!(ax==null)){ax=ax.replace(/\\%/g,"<per>");ax=ax.replace(/%[^\n]*(?=\n)/g,"");ax=ax.replace(/%[^\r]*(?=\r)/g,"");ax=ax.replace(/%[^\n]*$/,"");if(isIE&&ax.match(/%/g)!=null&&IEcommentWarning){alert("Comments may not have parsed properly.  Try putting in <pre class='LaTeX><div>..</div></pre> structure.");IEcommentWarning=false}ax=ax.replace(/<per>/g,"%");ax=ax.replace(/([^\\])\\(\s)/g,"$1\u00A0$2");ax=ax.replace(/\\quad/g,"\u2001");ax=ax.replace(/\\qquad/g,"\u2001\u2001");ax=ax.replace(/\\enspace/g,"\u2002");ax=ax.replace(/\\;/g,"\u2004");ax=ax.replace(/\\:/g,"\u2005");ax=ax.replace(/\\,/g,"\u2006");ax=ax.replace(/\\thinspace/g,"\u200A");ax=ax.replace(/([^\\])~/g,"$1\u00A0");ax=ax.replace(/\\~/g,"~");ax=ax.replace(/\\\[/g," <DEQ> $\\displaystyle{");ax=ax.replace(/\\\]/g,"}$ <DEQ> ");ax=ax.replace(/\$\$/g,"${$<DEQ>$}$");ax=ax.replace(/\\begin\s*\{\s*array\s*\}/g,"\\begin{array}");ax=ax.replace(/\\end\s*\{\s*array\s*\}/g,"\\end{array}");ax=ax.replace(/\\begin\s*\{\s*eqnarray\s*\}/g,"  <DEQ>eqno$\\begin{eqnarray}");ax=ax.replace(/\\end\s*\{\s*eqnarray\s*\}/g,"\\end{eqnarray}$<DEQ>  ");ax=ax.replace(/\\begin\s*\{\s*eqnarray\*\s*\}/g,"  <DEQ>$\\begin{eqnarray}");ax=ax.replace(/\\end\s*\{\s*eqnarray\*\s*\}/g,"\\end{eqnarray}$<DEQ>  ");ax=ax.replace(/\\begin\s*\{\s*displaymath\s*\}/g," <DEQ> $\\displaystyle{");ax=ax.replace(/\\end\s*\{\s*displaymath\s*\}/g,"}$ <DEQ> ");ax=ax.replace(/\\begin\s*\{\s*equation\s*\*\s*\}/g," <DEQ> $\\displaystyle{");ax=ax.replace(/\\end\s*\{\s*equation\s*\*\s*\}/g,"}$ <DEQ> ");ax=ax.replace(/\\begin\s*\{\s*equation\s*\}/g," <DEQ>eqno$\\displaystyle{");ax=ax.replace(/\\end\s*\{\s*equation\s*\}/g,"}$ <DEQ> ");ax=ax.split("<DEQ>");var ab=document.createDocumentFragment();for(var I=0;I<ax.length;I++){if(I%2){var T=document.createElement("table");T.className="displayequation";var K=document.createElement("tbody");var b=document.createElement("tr");var v=document.createElement("td");v.className="eq";ax[I]=ax[I].replace(/\$\}\$/g,"$\\displaystyle{");ax[I]=ax[I].replace(/\$\{\$/g,"}");var k=ax[I].match(/\\label\s*\{\s*(\w+)\s*\}/);var C=ax[I].match(/^eqno/);ax[I]=ax[I].replace(/^eqno/," ");ax[I]=ax[I].replace(/\\label\s*\{\s*\w+\s*\}/," ");v.appendChild(document.createTextNode(ax[I]));b.appendChild(v);ax[I]=ax[I].replace(/\\nonumber/g,"");if(C!=null||k!=null){var ah=document.createElement("td");ah.className="eqno";LaTeXCounter.equation++;var B=makeNumberString(LaTeXCounter.equation);var ae=document.createElement("a");if(k!=null){ae.id=k[1]}ae.className="eqno";var U=document.createElement("span");U.className="eqno";U.style.display="none";U.appendChild(document.createTextNode(B));ae.appendChild(U);ah.appendChild(ae);var M=document.createElement("span");M.className="eqno";M.appendChild(document.createTextNode("("+B+")"));ah.appendChild(M);b.appendChild(ah)}K.appendChild(b);T.appendChild(K);ab.appendChild(T)}else{ax[I]=ax[I].replace(/\$\}\$/g,"");ax[I]=ax[I].replace(/\$\{\$/g,"");ax[I]=ax[I].replace(/\\maketitle/g,"");ax[I]=ax[I].replace(/\\begin\s*\{\s*document\s*\}/g,"");ax[I]=ax[I].replace(/\\end\s*\{\s*document\s*\}/g,"");ax[I]=ax[I].replace(/\\documentclass[^\}]*?\}/g,"");ax[I]=ax[I].replace(/\\usepackage[^\}]*?\}/g,"");ax[I]=ax[I].replace(/\\noindent/g,"");ax[I]=ax[I].replace(/\\notag/g,"");ax[I]=ax[I].replace(/\\ref\s*\{\s*(\w+)\}/g," \\[ref\\]$1\\[ ");ax[I]=ax[I].replace(/\\url\s*\{\s*([^\}\n]+)\}/g," \\[url\\]$1\\[ ");ax[I]=ax[I].replace(/\\href\s*\{\s*([^\}]+)\}\s*\{\s*([^\}]+)\}/g," \\[href\\]$1\\]$2\\[ ");ax[I]=ax[I].replace(/\\cite\s*\{\s*(\w+)\}/g," \\[cite\\]$1\\[ ");ax[I]=ax[I].replace(/\\qed/g,"\u220E");ax[I]=ax[I].replace(/\\endproof/g,"\u220E");ax[I]=ax[I].replace(/\\proof/g,"\\textbf{Proof: }");ax[I]=ax[I].replace(/\\n(?=\s)/g," \\[br\\] \\[ ");ax[I]=ax[I].replace(/\\newline/g," \\[br\\] \\[ ");ax[I]=ax[I].replace(/\\linebreak/g," \\[br\\] \\[ ");ax[I]=ax[I].replace(/\\smallskip/g," \\[logicalbreak\\]smallskip\\[ ");ax[I]=ax[I].replace(/\\medskip/g," \\[logicalbreak\\]medskip\\[ ");ax[I]=ax[I].replace(/\\bigskip/g," \\[logicalbreak\\]bigskip\\[ ");ax[I]=ax[I].replace(/[\n\r]+[ \f\n\r\t\v\u2028\u2029]*[\n\r]+/g," \\[logicalbreak\\]LaTeXMathML\\[ ");if(isIE){ax[I]=ax[I].replace(/\r/g," ")}ax[I]=ax[I].replace(/\\bibitem\s*([^\{]*\{\s*\w*\s*\})/g," \\[bibitem\\]$1\\[ ");ax[I]=ax[I].replace(/\\bibitem\s*/g," \\[bibitem\\] \\[ ");ax[I]=ax[I].replace(/\\item\s*\[\s*(\w+)\s*\]/g," \\[alistitem\\]$1\\[ ");ax[I]=ax[I].replace(/\\item\s*/g," \\[alistitem\\] \\[ ");ax[I]=ax[I].replace(/\\appendix/g," \\[appendix\\] \\[ ");ax[I]=ax[I].replace(/\\begin\s*\{\s*figure\s*\}([\s\S]+?)\\end\s*\{\s*figure\s*\}/g," \\[figure\\]$1\\[ ");ax[I]=ax[I].replace(/\\begin\s*\{\s*table\s*\}([\s\S]+?)\\end\s*\{\s*table\s*\}/g," \\[table\\]$1\\[ ");ax[I]=ax[I].replace(/\\begin\s*\{\s*theorem\s*\}/g," \\[theorem\\]Theorem \\[ ");ax[I]=ax[I].replace(/\\end\s*\{\s*theorem\s*\}/g," \\[endtheorem\\] \\[ ");ax[I]=ax[I].replace(/\\begin\s*\{\s*definition\s*\}/g," \\[definition\\]Definition \\[ ");ax[I]=ax[I].replace(/\\end\s*\{\s*definition\s*\}/g," \\[enddefinition\\] \\[ ");ax[I]=ax[I].replace(/\\begin\s*\{\s*lemma\s*\}/g," \\[lemma\\]Lemma \\[ ");ax[I]=ax[I].replace(/\\end\s*\{\s*lemma\s*\}/g," \\[endlemma\\] \\[ ");ax[I]=ax[I].replace(/\\begin\s*\{\s*corollary\s*\}/g," \\[corollary\\]Corollary \\[ ");ax[I]=ax[I].replace(/\\end\s*\{\s*corollary\s*\}/g," \\[endcorollary\\] \\[ ");ax[I]=ax[I].replace(/\\begin\s*\{\s*proposition\s*\}/g," \\[proposition\\]Proposition \\[ ");ax[I]=ax[I].replace(/\\end\s*\{\s*proposition\s*\}/g," \\[endproposition\\] \\[ ");ax[I]=ax[I].replace(/\\begin\s*\{\s*example\s*\}/g," \\[example\\]Example \\[ ");ax[I]=ax[I].replace(/\\end\s*\{\s*example\s*\}/g," \\[endexample\\] \\[ ");ax[I]=ax[I].replace(/\\begin\s*\{\s*exercise\s*\}/g," \\[exercise\\]Exercise \\[ ");ax[I]=ax[I].replace(/\\end\s*\{\s*exercise\s*\}/g," \\[endexercise\\] \\[ ");ax[I]=ax[I].replace(/\\begin\s*\{\s*thebibliography\s*\}\s*\{\s*\w+\s*\}/g," \\[thebibliography\\]References \\[ ");ax[I]=ax[I].replace(/\\begin\s*\{\s*thebibliography\s*\}/g," \\[thebibliography\\]References \\[ ");ax[I]=ax[I].replace(/\\end\s*\{\s*thebibliography\s*\}/g," \\[endthebibliography\\]References \\[ ");ax[I]=ax[I].replace(/\\begin\s*\{\s*proof\s*\}/g," \\[proof\\]Proof: \\[ ");if(isIE){ax[I]=ax[I].replace(/\\end\s*\{\s*proof\s*\}/g,"\u220E \\[endproof\\] \\[ ")}else{ax[I]=ax[I].replace(/\\end\s*\{\s*proof\s*\}/g," \\[endproof\\] \\[ ")}ax[I]=ax[I].replace(/\\title\s*\{\s*([^\}]+)\}/g," \\[title\\] \\[$1 \\[endtitle\\] \\[ ");ax[I]=ax[I].replace(/\\author\s*\{\s*([^\}]+)\}/g," \\[author\\] \\[$1 \\[endauthor\\] \\[ ");ax[I]=ax[I].replace(/\\address\s*\{\s*([^\}]+)\}/g," \\[address\\] \\[$1 \\[endaddress\\] \\[ ");ax[I]=ax[I].replace(/\\date\s*\{\s*([^\}]+)\}/g," \\[date\\] \\[$1 \\[enddate\\] \\[ ");ax[I]=ax[I].replace(/\\begin\s*\{\s*keyword\s*\}/g," \\[keyword\\] \\[ ");ax[I]=ax[I].replace(/\\end\s*\{\s*keyword\s*\}/g," \\[endkeyword\\] \\[ ");ax[I]=ax[I].replace(/\\begin\s*\{\s*abstract\s*\}/g," \\[abstract\\] \\[ ");ax[I]=ax[I].replace(/\\end\s*\{\s*abstract\s*\}/g," \\[endabstract\\] \\[ ");ax[I]=ax[I].replace(/\\begin\s*\{\s*(?!array|tabular)(\w+)\s*\}/g," \\[$1\\] \\[ ");ax[I]=ax[I].replace(/\\end\s*\{\s*(?!array|tabular)(\w+)\s*\}/g," \\[end$1\\] \\[ ");var E=ax[I].search(/\\section\s*\{\s*[\s\S]+\}/);while(E>=0){ax[I]=ax[I].replace(/\\section\s*\{/," \\[section\\]");var ay=1;for(var F=E;F<ax[I].length;F++){if(ax[I].charAt(F)=="{"){ay++}if(ax[I].charAt(F)=="}"){ay--}if(ay==0){ax[I]=ax[I].substring(0,F)+"\\[ "+ax[I].substring(F+1,ax[I].length);break}}E=ax[I].search(/\\section\s*\{\s*[\s\S]+\}/)}E=ax[I].search(/\\subsection\s*\{\s*[\s\S]+\}/);while(E>=0){ax[I]=ax[I].replace(/\\subsection\s*\{/," \\[subsection\\]");var ay=1;for(var F=E;F<ax[I].length;F++){if(ax[I].charAt(F)=="{"){ay++}if(ax[I].charAt(F)=="}"){ay--}if(ay==0){ax[I]=ax[I].substring(0,F)+"\\[ "+ax[I].substring(F+1,ax[I].length);break}}E=ax[I].search(/\\subsection\s*\{\s*[\s\S]+\}/)}E=ax[I].search(/\\subsubsection\s*\{\s*[\s\S]+\}/);while(E>=0){ax[I]=ax[I].replace(/\\subsubsection\s*\{/," \\[subsubsection\\]");var ay=1;for(var F=E;F<ax[I].length;F++){if(ax[I].charAt(F)=="{"){ay++}if(ax[I].charAt(F)=="}"){ay--}if(ay==0){ax[I]=ax[I].substring(0,F)+"\\[ "+ax[I].substring(F+1,ax[I].length);break}}E=ax[I].search(/\\subsubsection\s*\{\s*[\s\S]+\}/)}var L="";var n=ax[I].split("\\[");for(var H=0;H<n.length;H++){if(H%2){var h=n[H].split("\\]");switch(h[0]){case"section":var Q=document.createElement("H2");Q.className="section";sectionCntr++;for(var q in LaTeXCounter){LaTeXCounter[q]=0}var av=document.createElement("a");if(inAppendix){av.className="appendixsection"}else{av.className="section"}var a=makeNumberString("");var U=document.createElement("span");U.className="section";U.style.display="none";U.appendChild(document.createTextNode(a));av.appendChild(U);Q.appendChild(av);var G=document.createElement("span");G.className="section";G.appendChild(document.createTextNode(a+" "));Q.appendChild(G);Q.appendChild(document.createTextNode(h[1]));ab.appendChild(Q);break;case"subsection":var Q=document.createElement("H3");Q.className="subsection";LaTeXCounter.subsection++;LaTeXCounter.subsubsection=0;var av=document.createElement("a");av.className="subsection";var a=makeNumberString(LaTeXCounter.subsection);var U=document.createElement("span");U.className="subsection";U.style.display="none";U.appendChild(document.createTextNode(a));av.appendChild(U);Q.appendChild(av);var G=document.createElement("span");G.className="subsection";G.appendChild(document.createTextNode(a+". "));Q.appendChild(G);Q.appendChild(document.createTextNode(h[1]));ab.appendChild(Q);break;case"subsubsection":var Q=document.createElement("H4");Q.className="subsubsection";LaTeXCounter.subsubsection++;var av=document.createElement("a");av.className="subsubsection";var a=makeNumberString(LaTeXCounter.subsection+"."+LaTeXCounter.subsubsection);var U=document.createElement("span");U.className="subsubsection";U.style.display="none";U.appendChild(document.createTextNode(a));av.appendChild(U);Q.appendChild(av);var G=document.createElement("span");G.className="subsubsection";G.appendChild(document.createTextNode(a+". "));Q.appendChild(G);Q.appendChild(document.createTextNode(h[1]));ab.appendChild(Q);break;case"href":var Q=document.createElement("a");Q.className="LaTeXMathML";Q.href=h[1];Q.appendChild(document.createTextNode(h[2]));ab.appendChild(Q);break;case"url":var Q=document.createElement("a");Q.className="LaTeXMathML";Q.href=h[1];Q.appendChild(document.createTextNode(h[1]));ab.appendChild(Q);break;case"figure":var Q=document.createElement("table");Q.className="figure";var m=document.createElement("tbody");var s=h[1].match(/\\label\s*\{\s*(\w+)\s*\}/);h[1]=h[1].replace(/\\label\s*\{\w+\}/g,"");var D=h[1].search(/\\caption\s*\{[\s\S]+\}/);var V="";if(D>=0){var f=h[1];var ay=0;var S=-1;for(var aj=D;aj<f.length;aj++){if(f.charAt(aj)=="{"){ay++}if(f.charAt(aj)=="}"){ay--}if(ay==1&&S<0){S=aj+1}if(ay==0&&S>0){capend=aj-1;V=f.substring(S,aj);break}}}var Y=document.createElement("tr");var au=document.createElement("td");au.className="caption";var x=document.createElement("a");x.className="figure";if(s!=null){x.id=s[1]}LaTeXCounter.figure++;var ac=makeNumberString(LaTeXCounter.figure);var U=document.createElement("span");U.className="figure";U.style.display="none";U.appendChild(document.createTextNode(ac));x.appendChild(U);au.appendChild(x);var af=document.createElement("span");af.className="figure";af.appendChild(document.createTextNode("Figure "+ac+". "));au.appendChild(af);au.appendChild(document.createTextNode(""+V));Y.appendChild(au);m.appendChild(Y);var N=false;var ad=h[1].match(/\\includegraphics\s*\{([^\}]+)\}/);if(ad==null){ad=h[1].match(/\\includegraphics\s*\[[^\]]*\]\s*\{\s*([^\}]+)\s*\}/)}if(ad==null){ad=h[1].match(/\\special\s*\{\s*([^\}]+)\}/);N=true}if(ad!=null){var Z=document.createElement("tr");var aw=document.createElement("td");aw.className="image";var P=document.createElement("img");var J=ad[1];P.src=J;P.alt="Figure "+J+" did not load";P.title="Figure "+ac+". "+V;P.id="figure"+ac;aw.appendChild(P);Z.appendChild(aw);m.appendChild(Z)}Q.appendChild(m);ab.appendChild(Q);break;case"table":var Q=document.createElement("table");if(h[1].search(/\\centering/)>=0){Q.className="LaTeXtable centered";Q.align="center"}else{Q.className="LaTeXtable"}tableid++;Q.id="LaTeXtable"+tableid;var aa=h[1].match(/\\label\s*\{\s*(\w+)\s*\}/);h[1]=h[1].replace(/\\label\s*\{\w+\}/g,"");var D=h[1].search(/\\caption\s*\{[\s\S]+\}/);var g="";if(D>=0){var f=h[1];var ay=0;var S=-1;for(var aj=D;aj<f.length;aj++){if(f.charAt(aj)=="{"){ay++}if(f.charAt(aj)=="}"){ay--}if(ay==1&&S<0){S=aj+1}if(ay==0&&S>0){capend=aj-1;g=f.substring(S,aj);break}}}if(g!=""){var z=document.createElement("tbody");var p=document.createElement("caption");p.className="LaTeXtable centered";var c=document.createElement("a");c.className="LaTeXtable";if(aa!=null){c.id=aa[1]}LaTeXCounter.table++;var al=makeNumberString(LaTeXCounter.table);var U=document.createElement("span");U.className="LaTeXtable";U.style.display="none";U.appendChild(document.createTextNode(al));c.appendChild(U);p.appendChild(c);var ao=document.createElement("span");ao.className="LaTeXtable";ao.appendChild(document.createTextNode("Table "+al+". "));p.appendChild(ao);p.appendChild(document.createTextNode(""+g));Q.appendChild(p)}var am=h[1].match(/\\begin\s*\{\s*tabular\s*\}([\s\S]+)\\end\s*\{\s*tabular\s*\}/);if(am!=null){var z=document.createElement("tbody");var A=null;var d=null;var ag=0;var y=0;var aq=am[1].match(/^\s*\{([^\}]+)\}/);am=am[1].replace(/^\s*\{[^\}]+\}/,"");am=am.replace(/\\hline/g,"");aq[1]=aq[1].replace(/\|/g,"");aq[1]=aq[1].replace(/\s/g,"");am=am.split("\\\\");for(ag=0;ag<am.length;ag++){A=document.createElement("tr");am[ag]=am[ag].split("&");for(y=0;y<am[ag].length;y++){d=document.createElement("td");switch(aq[1].charAt(y)){case"l":d.style.textAlign="left";break;case"c":d.style.textAlign="center";break;case"r":d.style.textAlign="right";break;default:d.style.textAlign="left"}d.appendChild(document.createTextNode(am[ag][y]));A.appendChild(d)}z.appendChild(A)}Q.appendChild(z)}ab.appendChild(Q);break;case"logicalbreak":var Q=document.createElement("p");Q.className=h[1];Q.appendChild(document.createTextNode("\u00A0"));ab.appendChild(Q);break;case"appendix":inAppendix=true;sectionCntr=0;break;case"alistitem":var ar=document.createElement("div");ar.className="endlistitem";ab.appendChild(ar);var t=document.createElement("div");t.className="listitem";if(h[1]!=" "){var ap=document.createElement("span");ap.className="listitemmarker";var R=document.createElement("b");R.appendChild(document.createTextNode(h[1]+" "));ap.appendChild(R);t.appendChild(ap)}ab.appendChild(t);break;case"br":ab.appendChild(document.createElement("br"));break;case"bibitem":ab.appendChild(document.createElement("br"));var Q=document.createElement("a");Q.className="bibitem";var G=document.createElement("span");G.className="bibitem";bibcntr++;var k=h[1].match(/\{\s*(\w+)\s*\}/);h[1]=h[1].replace(/\s*\{\s*\w+\s*\}/g,"");h[1]=h[1].replace(/^\s*\[/,"");h[1]=h[1].replace(/\s*\]$/,"");h[1]=h[1].replace(/^\s+|\s+$/g,"");if(k==null){biblist[bibcntr]="bibitem"+bibcntr}else{biblist[bibcntr]=k[1]}Q.name=biblist[bibcntr];Q.id=biblist[bibcntr];if(h[1]!=""){G.appendChild(document.createTextNode(h[1]))}else{G.appendChild(document.createTextNode("["+bibcntr+"]"))}Q.appendChild(G);ab.appendChild(Q);break;case"cite":var Q=document.createElement("a");Q.className="cite";Q.name="cite";Q.href="#"+h[1];ab.appendChild(Q);break;case"ref":var Q=document.createElement("a");Q.className="ref";Q.name="ref";Q.href="#"+h[1];ab.appendChild(Q);break;default:var Q=document.createElement("div");Q.className=h[0];if(IsCounter.test(h[0])){LaTeXCounter[h[0]]++;var av=document.createElement("a");av.className=h[0];var ak=makeNumberString(LaTeXCounter[h[0]]);var U=document.createElement("span");U.className=h[0];U.appendChild(document.createTextNode(ak));U.style.display="none";av.appendChild(U);Q.appendChild(av);var G=document.createElement("span");G.className=h[0];G.appendChild(document.createTextNode(h[1]+" "+ak+". "));Q.appendChild(G)}if(isIE){if(h[0]==("thebibliography"||"abstract"||"keyword"||"proof")){var G=document.createElement("span");G.className=h[0];G.appendChild(document.createTextNode(h[1]));Q.appendChild(G)}}if(h[0]=="endenumerate"||h[0]=="enditemize"||h[0]=="enddescription"){var ai=document.createElement("div");ai.className="endlistitem";ab.appendChild(ai)}ab.appendChild(Q);if(h[0]=="enumerate"||h[0]=="itemize"||h[0]=="description"){var ai=document.createElement("div");ai.className="listitem";ab.appendChild(ai)}}}else{n[H]=n[H].replace(/\\\$/g,"<per>");n[H]=n[H].replace(/\$([^\$]+)\$/g," \\[$1\\[ ");n[H]=n[H].replace(/<per>/g,"\\$");n[H]=n[H].replace(/\\begin\s*\{\s*math\s*\}([\s\S]+?)\\end\s*\{\s*math\s*\}/g," \\[$1\\[ ");var r=n[H].split("\\[");for(var an=0;an<r.length;an++){if(an%2){var Q=document.createElement("span");Q.className="inlinemath";Q.appendChild(document.createTextNode("$"+r[an]+"$"));ab.appendChild(Q)}else{var at=r[an].search(/\\\w+/);var l=at;while(l>-1){if(/^\\textcolor/.test(r[an].substring(at,r[an].length))){r[an]=r[an].replace(/\\textcolor\s*\{\s*(\w+)\s*\}\s*/," \\[textcolor\\]$1\\]|")}else{if(/^\\colorbox/.test(r[an].substring(at,r[an].length))){r[an]=r[an].replace(/\\colorbox\s*\{\s*(\w+)\s*\}\s*/," \\[colorbox\\]$1\\]|")}else{r[an]=r[an].substring(0,at)+r[an].substring(at,r[an].length).replace(/\\\s*(\w+)\s*/," \\[$1\\]|")}}at+=r[an].substring(at,r[an].length).search(/\|/);at++;r[an]=r[an].replace(/\\\]\|/,"\\] ");if(r[an].charAt(at)=="{"){r[an]=r[an].substring(0,at)+r[an].substring(at+1,r[an].length);var ay=1;for(var e=at;e<r[an].length;e++){if(r[an].charAt(e)=="{"){ay++}if(r[an].charAt(e)=="}"){ay--}if(ay==0){break}}r[an]=r[an].substring(0,e)+"\\[ "+r[an].substring(e+1,r[an].length);at=e+3}else{r[an]=r[an].substring(0,at)+"\\[ "+r[an].substring(at+1,r[an].length);at=at+3}if(at<r[an].length){l=r[an].substring(at,r[an].length).search(/\\\w+/)}else{l=-1}at+=l}r[an]=r[an].replace(/\\\\\s*\\\\/g,"\\\\");r[an]=r[an].replace(/\\\\/g," \\[br\\] \\[ ");r[an]=r[an].replace(/\\label\s*\{\s*(\w+)\s*\}/g," \\[label\\]$1\\[ ");var W=r[an].split("\\[");for(var u=0;u<W.length;u++){if(u%2){var h=W[u].split("\\]");switch(h[0]){case"textcolor":var Q=document.createElement("span");Q.className="LaTeXColor";if(IsColorName.test(h[1].toLowerCase())){Q.style.color=LaTeXColor[h[1].toLowerCase()]}else{Q.style.color=h[1]}Q.appendChild(document.createTextNode(h[2]));ab.appendChild(Q);break;case"colorbox":var Q=document.createElement("span");Q.className="LaTeXColor";if(IsColorName.test(h[1].toLowerCase())){Q.style.background=LaTeXColor[h[1].toLowerCase()]}else{Q.style.background=h[1]}Q.appendChild(document.createTextNode(h[2]));ab.appendChild(Q);break;case"br":ab.appendChild(document.createElement("br"));break;case"label":var Q=document.createElement("a");Q.className="LaTeXMathMLlabel";var w=h[1].match(/\s*(\w+)\s*/);if(w!=null){Q.id=w[1]}Q.style.display="none";LaTeXCounter.label++;var o=makeNumberString(LaTeXCounter.label);var U=document.createElement("span");U.className="LaTeXMathMLlabel";U.appendChild(document.createTextNode(o));U.style.display="none";Q.appendChild(U);ab.appendChild(Q);break;default:var Q=document.createElement("span");Q.className=h[0];Q.appendChild(document.createTextNode(h[1]));ab.appendChild(Q)}}else{ab.appendChild(document.createTextNode(W[u]))}}}}}}}}O.parentNode.replaceChild(ab,O)}}}return O}function LaTeXDivsAndRefs(a){var q=a;var f=null;var e=q.getElementsByTagName("div");var b="";var j=null;for(var p=e.length-1;p>=0;p--){f=e[p].className.match(/end\w+/);if(f!=null){f=f[0];var s=f.substring(3,f.length);var g=e[p];break}}while(f!=null){var m=document.createDocumentFragment();var r=g.parentNode;var d=1;while(g.previousSibling!=null&&d>0){switch(g.previousSibling.className){case f:d++;m.insertBefore(g.previousSibling,m.firstChild);break;case s:if(g.previousSibling.nodeName=="DIV"){d--;if(b!=""){g.previousSibling.id=b;b=""}if(d==0){r=g.previousSibling}else{m.insertBefore(g.previousSibling,m.firstChild)}}break;case"LaTeXMathMLlabel":b=g.previousSibling.id;g.parentNode.removeChild(g.previousSibling);break;default:m.insertBefore(g.previousSibling,m.firstChild)}}r.appendChild(m);g.parentNode.removeChild(g);e=q.getElementsByTagName("DIV");for(p=e.length-1;p>=0;p--){f=e[p].className.match(/end\w+/);if(f!=null){d=0;f=f[0];s=f.substring(3,f.length);g=e[p];r=g.parentNode;break}}}var e=q.getElementsByTagName("div");var n=null;for(var p=0;p<e.length;p++){if(e[p].className=="itemize"||e[p].className=="enumerate"||e[p].className=="description"){if(e[p].className=="itemize"){r=document.createElement("UL")}else{r=document.createElement("OL")}r.className="LaTeXMathML";if(e[p].hasChildNodes()){e[p].removeChild(e[p].firstChild)}while(e[p].hasChildNodes()){if(e[p].firstChild.hasChildNodes()){n=document.createElement("LI");while(e[p].firstChild.hasChildNodes()){n.appendChild(e[p].firstChild.firstChild)}if(n.firstChild.className=="listitemmarker"){n.style.listStyleType="none"}r.appendChild(n)}e[p].removeChild(e[p].firstChild)}e[p].appendChild(r)}}var c=q.getElementsByTagName("a");for(var p=0;p<c.length;p++){if(c[p].className=="ref"||c[p].className=="cite"){var k=c[p].href.match(/\#(\w+)/);if(k!=null){var l=document.getElementById(k[1]);if(l!=null){var o=l.getElementsByTagName("SPAN");if(o!=null){var h=o[0].cloneNode(true);h.style.display="inline";h.className=c[p].className;c[p].appendChild(h)}}}}}return q}var AMbody;var AMnoMathML=false,AMtranslated=false;function translate(g){if(!AMtranslated){AMtranslated=true;AMinitSymbols();var j=[];var a=document.getElementsByTagName("*");var n="";for(var f=0,d=0;f<a.length;f++){n=" "+a[f].className+" ";if(n.match(/\sLaTeX\s/)!=null){j[d]=a[f];d++}}if(j.length>0){for(var b=0;b<j.length;b++){AMbody=j[b];try{AMbody=LaTeXDivsAndRefs(LaTeXpreProcess(AMbody))}catch(e){alert("Unknown Error: Defaulting to Original LaTeXMathML")}if(AMbody.tagName=="PRE"){var h=document.createDocumentFragment();var c=document.createElement("DIV");while(AMbody.hasChildNodes()){c.appendChild(AMbody.firstChild)}h.appendChild(c);AMbody.parentNode.replaceChild(h,AMbody);AMbody=c}AMprocessNode(AMbody,false,g)}}else{AMbody=document.getElementsByTagName("body")[0];try{AMbody=LaTeXDivsAndRefs(LaTeXpreProcess(AMbody))}catch(e){alert("Unknown Error: Defaulting to Original LaTeXMathML")}AMprocessNode(AMbody,false,g)}}}if(isIE){document.write('<object id="mathplayer"  classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987"></object>');document.write('<?import namespace="m" implementation="#mathplayer"?>')}function generic(){translate()}if(typeof window.addEventListener!="undefined"){window.addEventListener("load",generic,false)}else{if(typeof document.addEventListener!="undefined"){document.addEventListener("load",generic,false)}else{if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",generic)}else{if(typeof window.onload=="function"){var existing=onload;window.onload=function(){existing();generic()}}else{window.onload=generic}}}};

Raw Paste


Login or Register to edit or fork this paste. It's free.