12345678910111213 |
- /*
- * /MathJax/jax/output/HTML-CSS/autoload/menclose.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
- */MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function(){var k=MathJax.ElementJax.mml,b=MathJax.OutputJax["HTML-CSS"];k.menclose.Augment({toHTML:function(g){var c=this.getValues("notation","thickness","padding","mathcolor","color");c.color&&!this.mathcolor&&(c.mathcolor=c.color);null==c.thickness&&(c.thickness=".075em");null==c.padding&&(c.padding=".2em");g=this.HTMLcreateSpan(g);var a=this.HTMLgetMu(g),E=this.HTMLgetScale(),m=b.length2em(c.padding,a,1/b.em)*E,a=b.length2em(c.thickness,a,1/b.em),u=b.Em(a)+" solid",h=b.createStack(g),w=b.createBox(h);this.HTMLmeasureChild(0,w);var e=w.bbox.h+m+a,d=w.bbox.d+m+a,f=w.bbox.w+2*(m+a),r=b.createFrame(h,e+d,0,f,a,"none");r.id="MathJax-frame-"+this.spanID;b.addBox(h,r);h.insertBefore(r,w);var F=MathJax.Hub.SplitList(c.notation),y=0,z=0,A=0,B=0,x=0,C=0,n,p,l,q,t;c.mathcolor?g.style.color=c.mathcolor:c.mathcolor="black";for(var D=0,G=F.length;D<G;D++)switch(F[D]){case k.NOTATION.BOX:r.style.border=u;b.msieBorderWidthBug||(y=z=B=A=a);break;case k.NOTATION.ROUNDEDBOX:b.useVML?(p||(p=this.HTMLvml(h,e,d,f,a,c.mathcolor)),t=Math.floor(1E3*Math.min(f,e+d)-2*a),l=Math.floor(4E3*(f-2*a)),q=Math.floor(4E3*(e+d-2*a)),this.HTMLvmlElement(p,"shape",{style:{width:this.HTMLpx(f-2*a),height:this.HTMLpx(e+d-2*a),left:this.HTMLpx(a,.5),top:this.HTMLpx(a,.5)},path:"m "+t+",0 qx 0,"+t+" l 0,"+(q-t)+" qy "+t+","+q+" l "+(l-t)+","+q+" qx "+l+","+(q-t)+" l "+l+","+t+" qy "+(l-t)+",0 x e",coordsize:l+","+q})):(n||(n=this.HTMLsvg(h,e,d,f,a,c.mathcolor)),this.HTMLsvgElement(n.firstChild,"rect",{x:1,y:1,width:this.HTMLpx(f-a)-1,height:this.HTMLpx(e+d-a)-1,rx:this.HTMLpx(Math.min(e+d,f)/4)}));break;case k.NOTATION.CIRCLE:b.useVML?(p||(p=this.HTMLvml(h,e,d,f,a,c.mathcolor)),this.HTMLvmlElement(p,"oval",{style:{width:this.HTMLpx(f-2*a),height:this.HTMLpx(e+d-2*a),left:this.HTMLpx(a,.5),top:this.HTMLpx(a,.5)}})):(n||(n=this.HTMLsvg(h,e,d,f,a,c.mathcolor)),this.HTMLsvgElement(n.firstChild,"ellipse",{rx:this.HTMLpx(f/2-a),ry:this.HTMLpx((e+d)/2-a),cx:this.HTMLpx(f/2),cy:this.HTMLpx((e+d)/2)}));break;case k.NOTATION.LEFT:r.style.borderLeft=u;b.msieBorderWidthBug||(B=a);break;case k.NOTATION.ACTUARIAL:r.style.borderTop=u,b.msieBorderWidthBug||(y=a,r.bbox.w+=m-a);case k.NOTATION.RIGHT:r.style.borderRight=u;b.msieBorderWidthBug||(A=a);break;case k.NOTATION.VERTICALSTRIKE:l=b.createRule(h,e+d-a/2,0,a);b.addBox(h,l);b.placeBox(l,m+a+w.bbox.w/2,-d,!0);break;case k.NOTATION.TOP:r.style.borderTop=u;b.msieBorderWidthBug||(y=a);break;case k.NOTATION.BOTTOM:r.style.borderBottom=u;b.msieBorderWidthBug||(z=a);break;case k.NOTATION.HORIZONTALSTRIKE:l=b.createRule(h,a,0,f-a/2);b.addBox(h,l);b.placeBox(l,0,(e+d)/2-d,!0);break;case k.NOTATION.UPDIAGONALSTRIKE:if(b.useVML)p||(p=this.HTMLvml(h,e,d,f,a,c.mathcolor)),l=this.HTMLvmlElement(p,"line",{from:"0,"+this.HTMLpx(e+d-a),to:this.HTMLpx(f)+",0"}),this.arrow&&(this.HTMLvmlElement(l,"stroke",{endarrow:"classic"}),l.to=this.HTMLpx(f)+","+this.HTMLpx(a));else if(n||(n=this.HTMLsvg(h,e,d,f,a,c.mathcolor)),this.arrow){q=1/Math.sqrt(f*f+(e+d)*(e+d))*10*E/b.em*a/.075;l=f*q;q*=e+d;t=f-a/2;var v=a/2;0>v+q-.4*l&&(v=.4*l-q);this.HTMLsvgElement(n.firstChild,"line",{x1:1,y1:this.HTMLpx(e+d-a),x2:this.HTMLpx(t-.7*l),y2:this.HTMLpx(v+.7*q)});this.HTMLsvgElement(n.firstChild,"polygon",{points:this.HTMLpx(t)+","+this.HTMLpx(v)+" "+this.HTMLpx(t-l-.4*q)+","+this.HTMLpx(v+q-.4*l)+" "+this.HTMLpx(t-.7*l)+","+this.HTMLpx(v+.7*q)+" "+this.HTMLpx(t-l+.4*q)+","+this.HTMLpx(v+q+.4*l)+" "+this.HTMLpx(t)+","+this.HTMLpx(v),fill:c.mathcolor,stroke:"none"})}else this.HTMLsvgElement(n.firstChild,"line",{x1:1,y1:this.HTMLpx(e+d-a),x2:this.HTMLpx(f-a),y2:this.HTMLpx(a)});break;case k.NOTATION.DOWNDIAGONALSTRIKE:b.useVML?(p||(p=this.HTMLvml(h,e,d,f,a,c.mathcolor)),this.HTMLvmlElement(p,"line",{from:"0,0",to:this.HTMLpx(f)+","+this.HTMLpx(e+d-a)})):(n||(n=this.HTMLsvg(h,e,d,f,a,c.mathcolor)),this.HTMLsvgElement(n.firstChild,"line",{x1:1,y1:this.HTMLpx(a),x2:this.HTMLpx(f-a),y2:this.HTMLpx(e+d-a)}));break;case k.NOTATION.MADRUWB:r.style.borderBottom=u;r.style.borderRight=u;b.msieBorderWidthBug||(z=A=a);break;case k.NOTATION.RADICAL:b.useVML?(p||(p=this.HTMLvml(h,e,d,f,a,c.mathcolor)),this.HTMLvmlElement(p,"shape",{style:{width:this.HTMLpx(f),height:this.HTMLpx(e+d)},path:"m "+this.HTMLpt(a/2,.6*(e+d))+" l "+this.HTMLpt(m,e+d-a)+" "+this.HTMLpt(2*m,a/2)+" "+this.HTMLpt(f,a/2)+" e",coordsize:this.HTMLpt(f,e+d)}),x=m):(n||(n=this.HTMLsvg(h,e,d,f,a,c.mathcolor)),this.HTMLsvgElement(n.firstChild,"path",{d:"M 1,"+this.HTMLpx(.6*(e+d))+" L "+this.HTMLpx(m)+","+this.HTMLpx(e+d)+" L "+this.HTMLpx(2*m)+",1 L "+this.HTMLpx(f)+",1"}),b.placeBox(n.parentNode,0,m/2-d,!0),x=m,C=a);break;case k.NOTATION.LONGDIV:b.useVML?(p||(p=this.HTMLvml(h,e,d,f,a,c.mathcolor)),this.HTMLvmlElement(p,"line",{from:"0,"+this.HTMLpx(a/2),to:this.HTMLpx(f-a)+","+this.HTMLpx(a/2)}),this.HTMLvmlElement(p,"arc",{style:{width:this.HTMLpx(2*m),height:this.HTMLpx(e+d-2*a),left:this.HTMLpx(-m),top:this.HTMLpx(a)},startangle:"10",endangle:"170"}),x=m):(n||(n=this.HTMLsvg(h,e,d,f,a,c.mathcolor)),this.HTMLsvgElement(n.firstChild,"path",{d:"M "+this.HTMLpx(f)+",1 L 1,1 a"+this.HTMLpx(m)+","+this.HTMLpx((e+d)/2-a)+" 0 0,1 1,"+this.HTMLpx(e+d-2*a)}),b.placeBox(n.parentNode,0,a-d,!0),x=m,C=a)}r.style.width=b.Em(f-B-A);r.style.height=b.Em(e+d-y-z);b.placeBox(r,0,C-d,!0);b.placeBox(w,x+m+a,0);this.HTMLhandleSpace(g);this.HTMLhandleColor(g);return g},HTMLpx:function(g){return g*b.em},HTMLpt:function(b,c){return Math.floor(1E3*b)+","+Math.floor(1E3*c)},HTMLhandleColor:function(b){var c=document.getElementById("MathJax-frame-"+this.spanID);if(c){var a=this.getValues("mathbackground","background");this.style&&b.style.backgroundColor&&(a.mathbackground=b.style.backgroundColor,b.style.backgroundColor="");a.background&&!this.mathbackground&&(a.mathbackground=a.background);a.mathbackground&&a.mathbackground!==k.COLOR.TRANSPARENT&&(c.style.backgroundColor=a.mathbackground)}else this.SUPER(arguments).HTMLhandleColor.call(this,b)},HTMLsvg:function(g,c,a,k,m,u){var h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.style&&(h.style.width=b.Em(k),h.style.height=b.Em(c+a));g=b.createBox(g);g.appendChild(h);b.placeBox(g,0,-a,!0);this.HTMLsvgElement(h,"g",{fill:"none",stroke:u,"stroke-width":m*b.em});return h},HTMLsvgElement:function(b,c,a){c=document.createElementNS("http://www.w3.org/2000/svg",c);c.isMathJax=!0;if(a)for(var k in a)a.hasOwnProperty(k)&&c.setAttributeNS(null,k,a[k].toString());b.appendChild(c);return c},HTMLvml:function(g,c,a,k,m,u){c=b.createFrame(g,c+a,0,k,0,"none");b.addBox(g,c);b.placeBox(c,0,-a,!0);this.constructor.VMLcolor=u;this.constructor.VMLthickness=this.HTMLpx(m);return c},HTMLvmlElement:function(g,c,a){g=b.addElement(g,"mjxvml:"+c,{isMathJax:!0});g.style.position="absolute";g.style.left=g.style.top=0;MathJax.Hub.Insert(g,a);a.fillcolor||(g.fillcolor="none");a.strokecolor||(g.strokecolor=this.constructor.VMLcolor);a.strokeweight||(g.strokeweight=this.constructor.VMLthickness);return g}});MathJax.Hub.Browser.Select({MSIE:function(g){9>(document.documentMode||0)&&(k.menclose.Augment({HTMLpx:function(c,a){return c*b.em+(a||0)+"px"}}),b.useVML=!0,document.namespaces.mjxvml||(document.documentMode&&8===document.documentMode?document.namespaces.add("mjxvml","urn:schemas-microsoft-com:vml","#default#VML"):(document.namespaces.add("mjxvml","urn:schemas-microsoft-com:vml"),document.createStyleSheet().addRule("mjxvml\\: *","{behavior: url(#default#VML)}"))))}});MathJax.Hub.Startup.signal.Post("HTML-CSS menclose Ready");MathJax.Ajax.loadComplete(b.autoloadDir+"/menclose.js")});
|