/* * /MathJax/jax/output/SVG/jax.js * * Copyright (c) 2009-2013 The MathJax Consortium * * 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 */(function(x,r,v,k){var h;k.Augment({config:{styles:{".MathJax_SVG":{display:"inline","font-style":"normal","font-weight":"normal","line-height":"normal","font-size":"100%","font-size-adjust":"none","text-indent":0,"text-align":"left","text-transform":"none","letter-spacing":"normal","word-spacing":"normal","word-wrap":"normal","white-space":"nowrap","float":"none",direction:"ltr",border:0,padding:0,margin:0},".MathJax_SVG_Display":{position:"relative",display:"block",width:"100%"},".MathJax_SVG *":{transition:"none","-webkit-transition":"none","-moz-transition":"none","-ms-transition":"none","-o-transition":"none"},".mjx-svg-href":{fill:"blue",stroke:"blue"},".MathJax_SVG_Processing":{visibility:"hidden",position:"absolute",top:0,left:0,width:0,height:0,overflow:"hidden",display:"block"},".MathJax_SVG_Processed":{display:"none!important"},".MathJax_SVG_ExBox":{display:"block",overflow:"hidden",width:"1px",height:"60ex"},"#MathJax_SVG_Tooltip":{position:"absolute",left:0,top:0,width:"auto",height:"auto",display:"none"}}},hideProcessedMath:!0,Config:function(){var a=r.config.menuSettings;a.scale&&(this.config.scale=a.scale);this.SUPER(arguments).Config.apply(this,arguments);this.fontInUse=this.config.font;this.fontDir+="/"+this.config.font;this.require||(this.require=[]);this.require.push(this.fontDir+"/fontdata.js");this.require.push(MathJax.OutputJax.extensionDir+"/MathEvents.js")},Startup:function(){EVENT=MathJax.Extension.MathEvents.Event;TOUCH=MathJax.Extension.MathEvents.Touch;HOVER=MathJax.Extension.MathEvents.Hover;this.ContextMenu=EVENT.ContextMenu;this.Mousedown=EVENT.AltContextMenu;this.Mouseover=HOVER.Mouseover;this.Mouseout=HOVER.Mouseout;this.Mousemove=HOVER.Mousemove;this.hiddenDiv=v.Element("div",{style:{visibility:"hidden",overflow:"hidden",position:"absolute",top:0,height:"1px",width:"auto",padding:0,border:0,margin:0,textAlign:"left",textIndent:0,textTransform:"none",lineHeight:"normal",letterSpacing:"normal",wordSpacing:"normal"}});document.body.firstChild?document.body.insertBefore(this.hiddenDiv,document.body.firstChild):document.body.appendChild(this.hiddenDiv);this.hiddenDiv=v.addElement(this.hiddenDiv,"div",{id:"MathJax_SVG_Hidden"});var a=v.addElement(this.hiddenDiv,"div",{style:{width:"5in"}});this.pxPerInch=a.offsetWidth/5;this.hiddenDiv.removeChild(a);this.textSVG=this.Element("svg");z=this.addElement(this.addElement(this.hiddenDiv.parentNode,"svg"),"defs",{id:"MathJax_SVG_glyphs"});y={};this.ExSpan=v.Element("span",{style:{position:"absolute","font-size-adjust":"none"}},[["span",{className:"MathJax_SVG_ExBox"}]]);this.linebreakSpan=v.Element("span",null,[["hr",{style:{width:"auto",size:1,padding:0,border:0,margin:0}}]]);return x.Styles(this.config.styles,["InitializeSVG",this])},InitializeSVG:function(){document.body.appendChild(this.ExSpan);document.body.appendChild(this.linebreakSpan);this.defaultEx=this.ExSpan.firstChild.offsetHeight/60;this.defaultWidth=this.linebreakSpan.firstChild.offsetWidth;document.body.removeChild(this.linebreakSpan);document.body.removeChild(this.ExSpan)},preTranslate:function(a){var b=a.jax[this.id],c,d=b.length,e,f,g,l,m,h,n=!1,q=this.config.linebreaks.automatic,w=this.config.linebreaks.width;q?((n=null!=w.match(/^\s*(\d+(\.\d*)?%\s*)?container\s*$/))?w=w.replace(/\s*container\s*/,""):h=this.defaultWidth,""===w&&(w="100%")):h=1E5;for(c=0;c=b.SVGlast+b.SVGchunk&&(this.postTranslate(b),b.SVGchunk=Math.floor(b.SVGchunk*this.config.EqnChunkFactor),b.SVGdelay=!0))}},postTranslate:function(a){var b=a.jax[this.id];if(this.hideProcessedMath){for(var c=a.SVGlast,d=a.SVGeqn;cMath.abs(a)?"0em":a.toFixed(3).replace(/\.?0+$/,"")+"em"},Ex:function(a){a=Math.round(a/this.TeX.x_height*this.ex)/this.ex;return 6E-4>Math.abs(a)?"0ex":a.toFixed(3).replace(/\.?0+$/,"")+"ex"},Percent:function(a){return(100*a).toFixed(1).replace(/\.?0+$/,"")+"%"},length2em:function(a,b,c){"string"!==typeof a&&(a=a.toString());if(""===a)return"";if(a===h.SIZE.NORMAL)return 1E3;if(a===h.SIZE.BIG)return 2E3;if(a===h.SIZE.SMALL)return 710;if("infinity"===a)return k.BIGDIMEN;if(a.match(/mathspace$/))return 1E3*k.MATHSPACE[a];var d=a.match(/^\s*([-+]?(?:\.\d+|\d+(?:\.\d*)?))?(pt|em|ex|mu|px|pc|in|mm|cm|%)?/);a=1E3*parseFloat(d[1]||"1");d=d[2];null==c&&(c=1E3);null==b&&(b=1);return"em"===d?a:"ex"===d?a*k.TeX.x_height/1E3:"%"===d?a/100*c/1E3:"px"===d?a/k.em:"pt"===d?a/10:"pc"===d?1.2*a:"in"===d?a*this.pxPerInch/k.em:"cm"===d?a*this.pxPerInch/k.em/2.54:"mm"===d?a*this.pxPerInch/k.em/25.4:"mu"===d?a/18*b:a*c/1E3},thickness2em:function(a,b){var c=k.TeX.rule_thickness;return a===h.LINETHICKNESS.MEDIUM?c:a===h.LINETHICKNESS.THIN?.67*c:a===h.LINETHICKNESS.THICK?1.67*c:this.length2em(a,b,c)},getPadding:function(a){var b={top:0,right:0,bottom:0,left:0},c=!1,d;for(d in b)if(b.hasOwnProperty(d)){var e=a.style["padding"+d.charAt(0).toUpperCase()+d.substr(1)];e&&(b[d]=this.length2em(e),c=!0)}return c?b:!1},getBorders:function(a){var b={top:0,right:0,bottom:0,left:0},c=!1,d;for(d in b)if(b.hasOwnProperty(d)){var e="border"+d.charAt(0).toUpperCase()+d.substr(1);a.style[e+"Style"]&&(c=!0,b[d]=this.length2em(a.style[e+"Width"]),b[d+"Style"]=a.style[e+"Style"],b[d+"Color"]=a.style[e+"Color"],"initial"===b[d+"Color"]&&(b[d+"Color"]=""))}return c?b:!1},Element:function(a,b){var c="string"===typeof a?document.createElementNS("http://www.w3.org/2000/svg",a):a;c.isMathJax=!0;if(b)for(var d in b)b.hasOwnProperty(d)&&c.setAttribute(d,b[d].toString());return c},addElement:function(a,b,c){return a.appendChild(this.Element(b,c))},TextNode:v.TextNode,addText:v.addText,ucMatch:v.ucMatch,HandleVariant:function(a,b,c){var d=q.G(),e,f,g,l,m,p,n,t;a||(a=this.FONTDATA.VARIANT[h.VARIANT.NORMAL]);a.forceFamily&&(c=q.TEXT(b,c,a.font),null!=a.h&&(c.h=a.h),null!=a.d&&(c.d=a.d),d.Add(c),c="");l=a;m=0;for(p=c.length;me)m++,e=(e-55296<<10)+(c.charCodeAt(m)-56320)+65536,this.FONTDATA.RemapPlane1&&(a=this.FONTDATA.RemapPlane1(e,a),e=a.n,a=a.variant);else for(t=this.FONTDATA.RANGES,g=0,n=t.length;g=t[g].low&&e<=t[g].high){t[g].remap&&t[g].remap[e]?e=f+t[g].remap[e]:(e=e-t[g].low+f,t[g].add&&(e+=t[g].add));a["variant"+t[g].offset]&&(a=this.FONTDATA.VARIANT[a["variant"+t[g].offset]]);break}a.remap&&a.remap[e]&&(a.remap[e]instanceof Array?(a=a.remap[e],e=a[0],a=this.FONTDATA.VARIANT[a[1]]):"string"===typeof a.remap[e]?(c=a.remap[e]+c.substr(m+1),m=0,p=c.length,e=c.charCodeAt(0)):(e=a.remap[e],a.remap.variant&&(a=this.FONTDATA.VARIANT[a.remap.variant])));this.FONTDATA.REMAP[e]&&!a.noRemap&&(e=this.FONTDATA.REMAP[e],e instanceof Array&&(a=this.FONTDATA.VARIANT[e[1]],e=e[0]),"string"===typeof e&&(c=e+c.substr(m+1),m=0,p=c.length,e=e.charCodeAt(0)));g=this.lookupChar(a,e);(f=g[e])?f[5]&&f[5].space?d.w+=f[2]:(f=[b,g.id+"-"+e.toString(16).toUpperCase()].concat(f),d.Add(q.GLYPH.apply(q,f),d.w,0)):this.FONTDATA.DELIMITERS[e]?(f=this.createDelimiter(e,0,1,g),d.Add(f,d.w,"V"===this.FONTDATA.DELIMITERS[e].dir?f.d:0)):(65535>=e?f=String.fromCharCode(e):(f=e-65536,f=String.fromCharCode((f>>10)+55296)+String.fromCharCode((f&1023)+56320)),n=q.TEXT(b,f,{"font-family":a.defaultFamily||k.config.undefinedFamily,"font-style":a.italic?"italic":"","font-weight":a.bold?"bold":""}),null!=a.h&&(n.h=a.h),null!=a.d&&(n.d=a.d),f=q.G(),f.Add(n),d.Add(f,d.w,0),r.signal.Post(["SVG Jax - unknown char",e,a]))}1==c.length&&g.skew&&g.skew[e]&&(d.skew=1E3*g.skew[e]);1===d.element.childNodes.length&&(d.element=d.element.firstChild,d.removeable=!1,d.scale=b);return d},lookupChar:function(a,b){var c,d;if(!a.FONTS){var e=this.FONTDATA.FONTS,f=a.fonts||this.FONTDATA.VARIANT.normal.fonts;f instanceof Array||(f=[f]);a.fonts!=f&&(a.fonts=f);a.FONTS=[];c=0;for(d=f.length;c=b-10-k.config.blacker||l==m-1&&!g.stretch)return g.HW[l][2]&&(c*=g.HW[l][2]),g.HW[l][3]&&(a=g.HW[l][3]),this.createChar(c,[a,g.HW[l][1]],d).With({stretched:!0});if(g.stretch)this["extendDelimiter"+g.dir](e,f,g.stretch,c,d);return e},createChar:function(a,b,c){var d="",e={fonts:[b[1]],noRemap:!0};c&&c===h.VARIANT.BOLD&&(e.fonts=[b[1]+"-bold",b[1]]);"string"!==typeof b[1]&&(e=b[1]);if(b[0]instanceof Array){c=0;for(var f=b[0].length;cl)for(e=this.createChar(d,c.ext,e),f=c.mid?2:1,b=(b-l)/f,l=(b+100)/(e.h+e.d);0l){e=this.createChar(d,c.rep,e);var p=c.fuzz||0,n=c.mid?2:1;b=(b-l)/n;for(l=(b+p)/(e.r-e.l);0Math.abs(a.x)&&1>Math.abs(a.y)?a.remove=a.removeable:"g"===a.element.nodeName?a.element.firstChild?a.element.setAttribute("transform","translate("+Math.floor(a.x)+","+Math.floor(a.y)+")"):a.remove=a.removeable:"line"===a.element.nodeName||"polygon"===a.element.nodeName||"path"===a.element.nodeName||"a"===a.element.nodeName?a.element.setAttribute("transform","translate("+Math.floor(a.x)+","+Math.floor(a.y)+")"):(a.element.setAttribute("x",Math.floor(a.x/a.scale)),a.element.setAttribute("y",Math.floor(a.y/a.scale)));if(a.remove)for(this.n+=a.n;a.element.firstChild;)e&&this.element.firstChild?this.element.insertBefore(a.element.firstChild,this.element.firstChild):this.element.appendChild(a.element.firstChild);else e?this.element.insertBefore(a.element,this.element.firstChild):this.element.appendChild(a.element);delete a.element}a.hasIndent&&(this.hasIndent=a.hasIndent);a.d-a.y>this.d&&(this.d=a.d-a.y,this.d>this.D&&(this.D=this.d));a.y+a.h>this.h&&(this.h=a.y+a.h,this.h>this.H&&(this.H=this.h));a.D-a.y>this.D&&(this.D=a.D-a.y);a.y+a.H>this.H&&(this.H=a.y+a.H);a.x+a.lthis.r&&(this.r=a.x+a.r);if(d||a.x+a.w+(a.X||0)>this.w)this.w=a.x+a.w+(a.X||0);this.childScale=a.scale;this.childX=a.x;this.childY=a.y;this.n++;return a},Align:function(a,b,c,d){c={left:c,center:(this.w-a.w)/2,right:this.w-a.w-c}[b]||0;this.Add(a,c,d)},Clean:function(){this.h===-k.BIGDIMEN&&(this.h=this.d=this.l=0);return this}});q.ROW=q.Subclass({Init:function(){this.SUPER(arguments).Init.call(this);this.svg=[];this.sh=this.sd=0},Check:function(a){var b=a.toSVG();this.svg.push(b);a.SVGcanStretch("Vertical")&&(b.mml=a);b.h>this.sh&&(this.sh=b.h);b.d>this.sd&&(this.sd=b.d)},Stretch:function(){for(var a=0,b=this.svg.length;ab.w&&1===c.length&&!a.noIC&&(b.ic=b.r-b.w,b.w=b.r);this.SVGhandleColor(b);this.SVGsaveData(b);return b},SVGchildSVG:function(a){return this.data[a]?this.data[a].toSVG():q()},SVGdataStretched:function(a,b,c){this.SVGdata={HW:b,D:c};return this.data[a]?null!=c?this.data[a].SVGstretchV(b,c):null!=b?this.data[a].SVGstretchH(b):this.data[a].toSVG():q()},SVGsaveData:function(a){this.SVGdata||(this.SVGdata={});this.SVGdata.w=a.w;this.SVGdata.x=a.x;this.SVGdata.h=a.h;this.SVGdata.d=a.d;null!=a.X&&(this.SVGdata.X=a.X);this["class"]&&(a.removeable=!1,k.Element(a.element,{"class":this["class"]}));this.id&&(a.removeable=!1,k.Element(a.element,{id:this.id}));if(this.href){var b=k.Element("a",{"class":"mjx-svg-href"});b.setAttributeNS("http://www.w3.org/1999/xlink","href",this.href);b.onclick=this.SVGlink;k.addElement(b,"rect",{width:a.w,height:a.h+a.d,y:-a.d,fill:"none",stroke:"none","pointer-events":"all"});if("svg"===a.type){for(var c=a.element.firstChild;c.firstChild;)b.appendChild(c.firstChild);c.appendChild(b)}else b.appendChild(a.element),a.element=b;a.removeable=!1}k.config.addMMLclasses&&(this.SVGaddClass(a.element,"mjx-svg-"+this.type),a.removeable=!1);(b=this.style)&&a.element&&(a.element.style.cssText=b,a.element.style.fontSize&&(a.element.style.fontSize=""),a.element.style.border=a.element.style.padding="",a.removeable&&(a.removeable=""===a.element.style.cssText))},SVGaddClass:function(a,b){var c=a.getAttribute("class");a.setAttribute("class",(c?c+" ":"")+b)},SVGlink:function(){var a=this.href.animVal;if("#"===a.charAt(0)){var b=k.hashCheck(document.getElementById(a.substr(1)));b&&b.scrollIntoView&&setTimeout(function(){b.parentNode.scrollIntoView(!0)},1)}document.location=a},SVGgetStyles:function(){if(this.style){var a=v.Element("span");a.style.cssText=this.style;this.styles={border:k.getBorders(a),padding:k.getPadding(a)};a.style.fontSize&&(this.styles.fontSize=a.style.fontSize);a.style.color&&(this.styles.color=a.style.color);a.style.backgroundColor&&(this.styles.background=a.style.backgroundColor);a.style.fontStyle&&(this.styles.fontStyle=a.style.fontStyle);a.style.fontWeight&&(this.styles.fontWeight=a.style.fontWeight);a.style.fontFamily&&(this.styles.fontFamily=a.style.fontFamily);this.styles.fontWeight&&this.styles.fontWeight.match(/^\d+$/)&&(this.styles.fontWeight=600=b.scriptlevel||this.hasValue("lspace")||this.hasValue("rspace")){var c=this.SVGgetMu(a);b.lspace=Math.max(0,k.length2em(b.lspace,c));b.rspace=Math.max(0,k.length2em(b.rspace,c));for(var c=this,d=this.Parent();d&&d.isEmbellished()&&d.Core()===c;)c=d,d=d.Parent();b.lspace&&(a.x+=b.lspace);b.rspace&&(a.X=b.rspace)}}}else b=this.texSpacing(),""!==b&&(a.x+=k.length2em(b,this.SVGgetScale())/a.scale)},SVGhandleColor:function(a){var b=this.getValues("mathcolor","color");this.styles&&this.styles.color&&!b.color&&(b.color=this.styles.color);b.color&&!this.mathcolor&&(b.mathcolor=b.color);b.mathcolor&&(k.Element(a.element,{fill:b.mathcolor,stroke:b.mathcolor}),a.removeable=!1);var c=(this.styles||{}).border,d=(this.styles||{}).padding,e=(c||{}).left||0,f=(d||{}).left||0,g;b.background=this.mathbackground||this.background||(this.styles||{}).background||h.COLOR.TRANSPARENT;if(e+f){var l=q();for(g in a)a.hasOwnProperty(g)&&(l[g]=a[g]);l.x=0;l.y=0;a.element=k.Element("g");a.removeable=!0;a.Add(l,e+f,0)}d&&(a.w+=d.right,a.h+=d.top,a.d+=d.bottom);c&&(a.w+=c.right,a.h+=c.top,a.d+=c.bottom);b.background!==h.COLOR.TRANSPARENT&&("g"!==a.element.nodeName&&"svg"!==a.element.nodeName&&(d=k.Element("g"),d.appendChild(a.element),a.element=d,a.removeable=!0),a.Add(q.RECT(a.h,a.d,a.w,{fill:b.background,stroke:"none"}),0,0,!1,!0));if(c)for(g in b={left:["V",a.h+a.d,-5,-a.d],right:["V",a.h+a.d,a.w-c.right+5,-a.d],top:["H",a.w,0,a.h-c.top+5],bottom:["H",a.w,0,-a.d-5]},b)b.hasOwnProperty(g)&&c[g]&&(d=b[g],a.Add((0,q[d[0]+"LINE"])(d[1],c[g],c[g+"Style"],c[g+"Color"]),d[2],d[3]))},SVGhandleVariant:function(a,b,c){return k.HandleVariant(a,b,c)},SVGgetVariant:function(){var a=this.getValues("mathvariant","fontfamily","fontweight","fontstyle"),b=a.mathvariant;this.variantForm&&(b="-TeX-variant");a.hasVariant=this.Get("mathvariant",!0);a.hasVariant||(a.family=a.fontfamily,a.weight=a.fontweight,a.style=a.fontstyle);this.styles&&(!a.style&&this.styles.fontStyle&&(a.style=this.styles.fontStyle),!a.weight&&this.styles.fontWeight&&(a.weight=this.styles.fontWeight),!a.family&&this.styles.fontFamily&&(a.family=this.styles.fontFamily));if(a.family&&!a.hasVariant)return!a.weight&&a.mathvariant.match(/bold/)&&(a.weight="bold"),!a.style&&a.mathvariant.match(/italic/)&&(a.style="italic"),b={forceFamily:!0,font:{"font-family":a.family}},a.style&&(b.font["font-style"]=a.style),a.weight&&(b.font["font-weight"]=a.weight),b;"bold"===a.weight?b={normal:h.VARIANT.BOLD,italic:h.VARIANT.BOLDITALIC,fraktur:h.VARIANT.BOLDFRAKTUR,script:h.VARIANT.BOLDSCRIPT,"sans-serif":h.VARIANT.BOLDSANSSERIF,"sans-serif-italic":h.VARIANT.SANSSERIFBOLDITALIC}[b]||b:"normal"===a.weight&&(b={bold:h.VARIANT.normal,"bold-italic":h.VARIANT.ITALIC,"bold-fraktur":h.VARIANT.FRAKTUR,"bold-script":h.VARIANT.SCRIPT,"bold-sans-serif":h.VARIANT.SANSSERIF,"sans-serif-bold-italic":h.VARIANT.SANSSERIFITALIC}[b]||b);"italic"===a.style?b={normal:h.VARIANT.ITALIC,bold:h.VARIANT.BOLDITALIC,"sans-serif":h.VARIANT.SANSSERIFITALIC,"bold-sans-serif":h.VARIANT.SANSSERIFBOLDITALIC}[b]||b:"normal"===a.style&&(b={italic:h.VARIANT.NORMAL,"bold-italic":h.VARIANT.BOLD,"sans-serif-italic":h.VARIANT.SANSSERIF,"sans-serif-bold-italic":h.VARIANT.BOLDSANSSERIF}[b]||b);b in k.FONTDATA.VARIANT||(b="normal");return k.FONTDATA.VARIANT[b]},SVGgetScale:function(){var a=1,b=this.getValues("mathsize","scriptlevel","fontsize");(this.styles||{}).fontSize&&!b.fontsize&&(b.fontsize=this.styles.fontSize);b.fontsize&&!this.mathsize&&(b.mathsize=b.fontsize);0!==b.scriptlevel&&(210*p.w&&(n+=-p.l),c.Add(p,n,0,!0),p.skew&&(c.skew=p.skew));c.Clean();1!==this.data.join("").length&&delete c.skew;f.largeop&&(c.y=(c.h-c.d)/2/d-k.TeX.axis_height,c.r>c.w&&(c.ic=c.r-c.w,c.w=c.r));this.SVGhandleColor(c);this.SVGsaveData(c);return c},CoreParent:function(){for(var a=this;a&&a.isEmbellished()&&a.CoreMO()===this&&!a.isa(h.math);)a=a.Parent();return a},CoreText:function(a){if(!a)return"";if(a.isEmbellished())return a.CoreMO().data.join("");for(;(a.isa(h.mrow)||a.isa(h.TeXAtom)||a.isa(h.mstyle)||a.isa(h.mphantom))&&1===a.data.length&&a.data[0];)a=a.data[0];return a.isToken?a.data.join(""):""},SVGremapChars:{"*":"\u2217",'"':"\u2033","\u00b0":"\u2218","\u00b2":"2","\u00b3":"3","\u00b4":"\u2032","\u00b9":"1"},SVGremap:function(a,b){a=a.replace(/-/g,"\u2212");b&&(a=a.replace(/'/g,"\u2032").replace(/`/g,"\u2035"),1===a.length&&(a=b[a]||a));return a},SVGcanStretch:function(a){if(!this.Get("stretchy"))return!1;var b=this.data.join("");if(1b.w&&(b.x=b.w,b.w=b.r=0);b.h<-b.d&&(b.d=-b.h);b.l=0;b.Clean();this.SVGhandleColor(b);this.SVGsaveData(b);return b}});h.mphantom.Augment({toSVG:function(a,b){this.SVGgetStyles();var c=this.SVG();if(null!=this.data[0])for(this.SVGhandleSpace(c),c.Add(this.SVGdataStretched(0,a,b)),c.Clean();c.element.firstChild;)c.element.removeChild(c.element.firstChild);this.SVGhandleColor(c);this.SVGsaveData(c);c.removeable&&!c.element.firstChild&&delete c.element;return c}});h.mpadded.Augment({toSVG:function(a,b){this.SVGgetStyles();var c=this.SVG();if(null!=this.data[0]){this.SVGhandleSpace(c);var d=this.SVGdataStretched(0,a,b),e=this.SVGgetMu(c),f=this.getValues("height","depth","width","lspace","voffset"),g=0,l=0;f.lspace&&(g=this.SVGlength2em(d,f.lspace,e));f.voffset&&(l=this.SVGlength2em(d,f.voffset,e));var k=d.h,h=d.d,n=d.w;c.Add(d,g,l);c.Clean();c.h=k;c.d=h;c.w=n;c.removeable=!1;""!==f.height&&(c.h=this.SVGlength2em(c,f.height,e,"h",0));""!==f.depth&&(c.d=this.SVGlength2em(c,f.depth,e,"d",0));""!==f.width&&(c.w=this.SVGlength2em(c,f.width,e,"w",0));c.h>c.H&&(c.H=c.h);c.d>c.D&&(c.D=c.d)}this.SVGhandleColor(c);this.SVGsaveData(c);return c},SVGlength2em:function(a,b,c,d,e){null==e&&(e=-k.BIGDIMEN);var f=String(b).match(/width|height|depth/),f=f?a[f[0].charAt(0)]:d?a[d]:0;c=k.length2em(b,c,f);return d&&String(b).match(/^\s*[-+]/)?Math.max(e,a[d]+c):c}});h.mrow.Augment({SVG:q.ROW,toSVG:function(){this.SVGgetStyles();var a=this.SVG();this.SVGhandleSpace(a);for(var b=0,c=this.data.length;bk.linebreakWidth||this.hasNewline():!1},SVGmultiline:function(a){h.mbase.SVGautoloadFile("multiline")},SVGstretchH:function(a){a=this.data[this.core].SVGstretchH(a);this.SVGhandleColor(a);this.SVGsaveData(a);return a},SVGstretchV:function(a,b){var c=this.data[this.core].SVGstretchV(a,b);this.SVGhandleColor(c);this.SVGsaveData(c);return c}});h.mstyle.Augment({toSVG:function(){this.SVGgetStyles();var a=this.SVG();if(null!=this.data[0]){this.SVGhandleSpace(a);var b=a.Add(this.data[0].toSVG());a.Clean();b.ic&&(a.ic=b.ic);this.SVGhandleColor(a)}this.SVGsaveData(a);return a},SVGstretchH:function(a){return null!=this.data[0]?this.data[0].SVGstretchH(a):q.NULL()},SVGstretchV:function(a,b){return null!=this.data[0]?this.data[0].SVGstretchV(a,b):q.NULL()}});h.mfrac.Augment({toSVG:function(){this.SVGgetStyles();var a=this.SVG();this.SVGhandleSpace(a);var b=this.SVGchildSVG(0),c=this.SVGchildSVG(1),d=this.getValues("displaystyle","linethickness","numalign","denomalign","bevelled"),e=a.scale=this.SVGgetScale(),f=d.displaystyle,g=k.TeX.axis_height*e;if(d.bevelled){var d=f?400:150,l=k.createDelimiter(47,Math.max(b.h+b.d,c.h+c.d)+2*d);a.Add(b,0,(b.d-b.h)/2+g+d);a.Add(l,b.w-d/2,(l.d-l.h)/2+g);a.Add(c,b.w+l.w-d,(c.d-c.h)/2+g-d)}else{var l=Math.max(b.w,c.w),h=k.thickness2em(d.linethickness,e),p,n,t=k.TeX.min_rule_thickness/k.em*1E3;f?(p=k.TeX.num1,n=k.TeX.denom1):(p=0===h?k.TeX.num3:k.TeX.num2,n=k.TeX.denom2);p*=e;n*=e;0===h?(e=Math.max((f?7:3)*k.TeX.rule_thickness,2*t),f=p-b.d-(c.h-n),fh&&(g=(d.h+d.d-(h-f))/2);c=q.RECT(f,0,b.w);h=b.h+g+f;m=this.SVGaddRoot(a,d,m,d.h+d.d-h,e);a.Add(d,m,h-d.h);a.Add(c,m+d.w,h-c.h);a.Add(b,m+d.w,0);a.Clean();a.h+=f;a.H+=f;this.SVGhandleColor(a);this.SVGsaveData(a);return a},SVGaddRoot:function(a,b,c,d,e){return c}});h.mroot.Augment({toSVG:h.msqrt.prototype.toSVG,SVGaddRoot:function(a,b,c,d,e){var f=(b.isMultiChar?.55:.65)*b.w;if(this.data[1]){var g=this.data[1].toSVG();g.x=0;b=this.SVGrootHeight(b.h+b.d,e,g)-d;d=Math.min(g.w,g.r);c=Math.max(d,f);a.Add(g,c-d,b)}else f=c;return c-f},SVGrootHeight:function(a,b,c){return.45*(a-900*b)+600*b+Math.max(0,c.d-75)}});h.mfenced.Augment({SVG:q.ROW,toSVG:function(){this.SVGgetStyles();var a=this.SVG();this.SVGhandleSpace(a);this.data.open&&a.Check(this.data.open);null!=this.data[0]&&a.Check(this.data[0]);for(var b=1,c=this.data.length;bn&&(n=f[l].w),!g[l]&&n>p&&(p=n));null==b&&null!=a?p=a:p==-k.BIGDIMEN&&(p=n);l=n=0;for(m=this.data.length;ln&&(n=f[l].w));var p=k.TeX.rule_thickness,t=f[this.base]||{w:0,h:0,d:0,H:0,D:0,l:0,r:0,scale:e},w,u,r,v,x=0;t.ic&&(x=1.3*t.ic+.05);l=0;for(m=this.data.length;l=g.w&&(g.x=-g.l,f[l]=q.G().With({removeable:!1}),f[l].Add(g),f[l].Clean(),f[l].w=-g.l,g=f[l]),w={left:0,center:(n-g.w)/2,right:n-g.w}[c.align],u=0,l==this.over?(r?(r=p*e,v=0,t.skew&&(w+=t.skew)):(r=k.TeX.big_op_spacing1*e,u=k.TeX.big_op_spacing3*e,r=Math.max(r,u-Math.max(0,g.d))),r=Math.max(r,1500/k.em),w+=x/2,u=t.h+g.d+r,g.h+=v,g.h>g.H&&(g.H=g.h)):l==this.under&&(r?(r=3*p*e,v=0):(r=k.TeX.big_op_spacing2*e,u=k.TeX.big_op_spacing4*e,r=Math.max(r,u-g.h)),r=Math.max(r,1500/k.em),w-=x/2,u=-(t.d+g.h+r),g.d+=v,g.d>g.D&&(g.D=g.d)),d.Add(g,w,u));d.Clean();this.SVGhandleColor(d);this.SVGsaveData(d);return d}});h.msubsup.Augment({toSVG:function(a,b){this.SVGgetStyles();var c=this.SVG();this.SVGhandleSpace(c);var d=c.scale=this.SVGgetScale(),e=this.SVGgetMu(c),f=c.Add(this.SVGdataStretched(this.base,a,b)),g=(this.data[this.sup]||this.data[this.sub]||this).SVGgetScale(),h=k.TeX.x_height*d,m=k.TeX.scriptspace*d,p,n;this.SVGnotEmpty(this.data[this.sup])&&(p=this.data[this.sup].toSVG(),p.w+=m,p.r=Math.max(p.w,p.r));this.SVGnotEmpty(this.data[this.sub])&&(n=this.data[this.sub].toSVG(),n.w+=m,n.r=Math.max(n.w,n.r));var q=k.TeX.sup_drop*g,m=f.h+(f.y||0)-q,r=f.d-(f.y||0)+k.TeX.sub_drop*g,g=0;f.ic&&(f.w-=f.ic,g=1.3*f.ic+.05);!this.data[this.base]||"mi"!==this.data[this.base].type&&"mo"!==this.data[this.base].type||1!==this.data[this.base].data.join("").length||1!==f.scale||f.stretched||this.data[this.base].Get("largeop")||(m=r=0);var u=this.getValues("subscriptshift","superscriptshift");u.subscriptshift=""===u.subscriptshift?0:k.length2em(u.subscriptshift,e);u.superscriptshift=""===u.superscriptshift?0:k.length2em(u.superscriptshift,e);p?n?(r=Math.max(r,k.TeX.sub2*d),d*=k.TeX.rule_thickness,m-p.d-(n.h-r)<3*d&&(r=3*d-m+p.d+n.h,q=.8*h-(m-p.d),0d.h||d.D>d.d)e=v.Element("span",{style:{display:"inline-block","white-space":"nowrap",padding:"1px 0px"},isMathJax:!0},[["span",{style:{display:"inline-block",position:"relative",isMathJax:!0,width:k.Ex(d.w),height:k.Ex(d.h+d.d),"vertical-align":k.Ex(-d.d)}}]]),e.firstChild.appendChild(d.element),d.element=e,c.verticalAlign=c.margin="",c.position="absolute",c.bottom=k.Ex(d.d-d.D),c.left=0;a.appendChild(d.element);d.element=null;this.isMultiline||"block"!==this.Get("display")||(c=this.getValues("indentalignfirst","indentshiftfirst","indentalign","indentshift"),c.indentalignfirst!==h.INDENTALIGN.INDENTALIGN&&(c.indentalign=c.indentalignfirst),c.indentalign===h.INDENTALIGN.AUTO&&(c.indentalign=this.displayAlign),b.style.textAlign=c.indentalign,c.indentshiftfirst!==h.INDENTSHIFT.INDENTSHIFT&&(c.indentshift=c.indentshiftfirst),"auto"===c.indentshift&&(c.indentshift=this.displayIndent),c.indentshift&&c.indentalign!==h.INDENTALIGN.CENTER&&!d.hasIndent&&(a.style[{left:"marginLeft",right:"marginRight"}[c.indentalign]]=k.Ex(k.length2em(c.indentshift))))}return a}});h.TeXAtom.Augment({toSVG:function(){this.SVGgetStyles();var a=this.SVG();this.SVGhandleSpace(a);if(null!=this.data[0]){var b=this.data[0].toSVG(),c=0;this.texClass===h.TEXCLASS.VCENTER&&(c=k.TeX.axis_height-(b.h+b.d)/2+b.d);a.Add(b,0,c);a.ic=b.ic}this.SVGhandleColor(a);this.SVGsaveData(a);return a}});r.Register.StartupHook("onLoad",function(){setTimeout(MathJax.Callback(["loadComplete",k,"jax.js"]),0)})});r.Browser.Select({Opera:function(a){k.Augment({operaZoomRefresh:!0})}});r.Register.StartupHook("End Cookie",function(){"None"!==r.config.menuSettings.zoom&&x.Require("[MathJax]/extensions/MathZoom.js")});document.createElementNS||(document.namespaces.svg||document.namespaces.add("svg","http://www.w3.org/2000/svg"),k.Augment({Element:function(a,b){var c="string"===typeof a?document.createElement("svg:"+a):a;c.isMathJax=!0;if(b)for(var d in b)b.hasOwnProperty(d)&&c.setAttribute(d,b[d].toString());return c}}))})(MathJax.Ajax,MathJax.Hub,MathJax.HTML,MathJax.OutputJax.SVG);