12345678910111213 |
- /*
- * /MathJax/jax/output/SVG/autoload/annotation-xml.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("SVG Jax Ready",function(){var f=MathJax.ElementJax.mml,e=MathJax.OutputJax.SVG,g=e.BBOX;g.FOREIGN=g.Subclass({type:"foreignObject",removeable:!1});f["annotation-xml"].Augment({toSVG:function(){var b=this.SVG();this.SVGhandleSpace(b);for(var d=this.Get("encoding"),c=0,a=this.data.length;c<a;c++)b.Add(this.data[c].toSVG(d),b.w,0);b.Clean();this.SVGhandleColor(b);this.SVGsaveData(b);return b}});f.xml.Augment({toSVG:function(b){var d=e.textSVG.parentNode;e.mathDiv.style.width="auto";d.insertBefore(this.div,e.textSVG);b=this.div.offsetWidth;var c=this.div.offsetHeight,a=MathJax.HTML.addElement(this.div,"span",{style:{display:"inline-block",overflow:"hidden",height:c+"px",width:"1px",marginRight:"-1px"}}),h=this.div.offsetHeight-c,c=c-h;this.div.removeChild(a);d.removeChild(this.div);e.mathDiv.style.width="";for(var d=1E3/e.em,a=g.FOREIGN({y:-c+"px",width:b+"px",height:c+h+"px",transform:"scale("+d+") matrix(1 0 0 -1 0 0)"}),k=0,f=this.data.length;k<f;k++)a.element.appendChild(this.data[k].cloneNode(!0));a.w=b*d;a.h=c*d;a.d=h*d;a.r=a.w;a.l=0;a.Clean();this.SVGsaveData(a);return a}});MathJax.Hub.Startup.signal.Post("SVG annotation-xml Ready");MathJax.Ajax.loadComplete(e.autoloadDir+"/annotation-xml.js")});
|