/* * /MathJax/jax/output/HTML-CSS/autoload/mtable.js * * Copyright (c) 2009-2014 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function(){var c="2.4.0";var a=MathJax.ElementJax.mml,b=MathJax.OutputJax["HTML-CSS"];a.mtable.Augment({toHTML:function(t){t=this.HTMLcreateSpan(t);if(this.data.length===0){return t}var K=this.getValues("columnalign","rowalign","columnspacing","rowspacing","columnwidth","equalcolumns","equalrows","columnlines","rowlines","frame","framespacing","align","useHeight","width","side","minlabelspacing");var aI=K.width.match(/%$/);var ax=b.createStack(t);var aF=this.HTMLgetScale(),az=this.HTMLgetMu(t),aA=-1;var ap=[],at=[],ak=[],av=[],au=[],af,ae,ao=-1,ad,an,Z,aE,R,aB,aN=[],aS;var I=b.FONTDATA.lineH*aF*K.useHeight,O=b.FONTDATA.lineD*aF*K.useHeight;for(af=0,ad=this.data.length;afao){ao=ae}au[ae]=b.createStack(b.createBox(ax));ak[ae]=-b.BIGDIMEN}av[af][ae]=b.createBox(au[ae]);aN.push(aE.data[ae-Z].toHTML(av[af][ae]))}}b.MeasureSpans(aN);for(af=0,ad=this.data.length;afap[af]){ap[af]=aR*aK.h/aS}if(aR*aK.d/aS>at[af]){at[af]=aR*aK.d/aS}}}else{if(aB.HTMLcanStretch("Horizontal")){aR=b.length2em(aR,az,aK.w);if(aR>ak[ae]){ak[ae]=aR}}}}}if(av[af][ae].bbox.h>ap[af]){ap[af]=av[af][ae].bbox.h}if(av[af][ae].bbox.d>at[af]){at[af]=av[af][ae].bbox.d}if(av[af][ae].bbox.w>ak[ae]){ak[ae]=av[af][ae].bbox.w}}}var aD=MathJax.Hub.SplitList;var ay=aD(K.columnspacing),aP=aD(K.rowspacing),e=aD(K.columnalign),E=aD(K.rowalign),d=aD(K.columnlines),z=aD(K.rowlines),aL=aD(K.columnwidth),V=[];for(af=0,ad=ay.length;afav.length){ab=av.length}}aj=0;aT=-(aS+aG)+ap[0];for(af=0,ad=ab-1;af0.98){S=0.98/ag;ag=0.98}}else{if(K.width==="auto"){if(ag>0.98){S=L/(B+L);ac=B+L}else{ac=B/(1-ag)}}else{ac=b.length2em(K.width,az);for(af=0,ad=Math.min(ao+1,ay.length);af0.01){if(ah&&ac>B){ac=(ac-B)/ah;for(af=0,ad=ar.length;afap[af]){av[af][ae].bbox.H=av[af][ae].bbox.h;av[af][ae].bbox.h=ap[af]}if(av[af][ae].bbox.d>at[af]){av[af][ae].bbox.D=av[af][ae].bbox.d;av[af][ae].bbox.d=at[af]}aB.symmetric=aJ}}aQ=R.rowalign||this.data[af].rowalign||E[af];o=({top:ap[af]-av[af][ae].bbox.h,bottom:av[af][ae].bbox.d-at[af],center:((ap[af]-at[af])-(av[af][ae].bbox.h-av[af][ae].bbox.d))/2,baseline:0,axis:0})[aQ]||0;aQ=(R.columnalign||V[af][ae]||e[ae]);b.alignBox(av[af][ae],aQ,T+o)}if(af