/* * /MathJax/jax/output/SVG/autoload/mtable.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 H=MathJax.ElementJax.mml,h=MathJax.OutputJax.SVG,F=h.BBOX;H.mtable.Augment({toSVG:function(f){this.SVGgetStyles();f=this.SVG();if(0===this.data.length)return this.SVGsaveData(f),f;var d=this.getValues("columnalign","rowalign","columnspacing","rowspacing","columnwidth","equalcolumns","equalrows","columnlines","rowlines","frame","framespacing","align","useHeight","width","side","minlabelspacing");d.width.match(/%$/)&&(f.width=d.width=Math.floor(h.cwidth*parseFloat(d.width)/100)+"px");var x=this.SVGgetScale(),v=this.SVGgetMu(f),c=[],l=[],n=[],k=[],C=[],a,b,t=-1,e,A,m,y,g,q,J=h.FONTDATA.baselineskip*x*d.useHeight,z=h.FONTDATA.lineH*x,D=h.FONTDATA.lineD*x;a=0;for(e=this.data.length;at&&(t=b),C[b]=F.G(),n[b]=-h.BIGDIMEN);g=y.data[b-m];k[a][b]=g.toSVG();if(g.isEmbellished()){q=g.CoreMO();var p=q.Get("minsize",!0);if(p)if(q.SVGcanStretch("Vertical")){if(g=q.SVGdata.h+q.SVGdata.d)p=h.length2em(p,v,g),p*q.SVGdata.h/g>c[b]&&(c[b]=p*q.SVGdata.h/g),p*q.SVGdata.d/g>l[b]&&(l[b]=p*q.SVGdata.d/g)}else q.SVGcanStretch("Horizontal")&&(p=h.length2em(p,v,q.SVGdata.w),p>n[b]&&(n[b]=p))}k[a][b].h>c[a]&&(c[a]=k[a][b].h);k[a][b].d>l[a]&&(l[a]=k[a][b].d);k[a][b].w>n[b]&&(n[b]=k[a][b].w)}c[0]+l[0]&&(c[0]=Math.max(c[0],z));c[k.length-1]+l[k.length-1]&&(l[k.length-1]=Math.max(l[k.length-1],D));var w=MathJax.Hub.SplitList,p=w(d.columnspacing),z=w(d.rowspacing);A=w(d.columnalign);var u=w(d.rowalign),I=w(d.columnlines),D=w(d.rowlines);b=w(d.columnwidth);var G=[];a=0;for(e=p.length;ae&&(e=k.length+1+e),1>e?e=1:e>k.length&&(e=k.length),w=0,x=-(g+a)+c[0],a=0,--e;am)for(r=(r-m)/g,a=0,e=B.length;a