/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ /* vim: set ts=2 et sw=2 tw=80: */ /************************************************************* * * MathJax/jax/output/HTML-CSS/autoload/mmultiscripts.js * * Implements the HTML-CSS output for elements. * * --------------------------------------------------------------------- * * Copyright (c) 2010-2013 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 v=MathJax.ElementJax.mml,c=MathJax.OutputJax["HTML-CSS"];v.mmultiscripts.Augment({toHTML:function(r,p,a){r=this.HTMLcreateSpan(r);var e=this.HTMLgetScale(),b=c.createStack(r),f,l=c.createBox(b);if(this.data[this.base]){var d=this.data[this.base].toHTML(l);null!=a?this.data[this.base].HTMLstretchV(l,p,a):null!=p&&this.data[this.base].HTMLstretchH(l,p);c.Measured(d,l)}else l.bbox=this.HTMLzeroBBox();p=c.TeX.x_height*e;a=c.TeX.scriptspace*e*.75;d=this.HTMLgetScripts(b,a);f=d[0];for(var b=d[1],h=d[2],d=d[3],m=this.HTMLgetScale(),g=1;gn&&(n=0);c.placeBox(l,n,0);if(b||d)if(f||h){var k=Math.max(k,c.TeX.sub2*e),e=c.TeX.rule_thickness*e,q=(f||h).bbox.h,u=(b||d).bbox.d;h&&(q=Math.max(q,h.bbox.h));d&&(u=Math.max(u,d.bbox.d));g-u-(q-k)<3*e&&(k=3*e-g+u+q,q=.8*p-(g-u),0h;h+=2){for(;fa.bbox.w&&(c.createBlank(a,e.bbox.w-a.bbox.w),a.bbox.w=e.bbox.w,a.bbox.rw=Math.max(a.bbox.w,a.bbox.rw)));e?d=e.bbox.w:a&&(d=a.bbox.w)}f++;d=0}for(a=0;4>a;a++)b[a]&&(b[a].bbox.w+=p,b[a].bbox.rw=Math.max(b[a].bbox.w,b[a].bbox.rw),this.HTMLcleanBBox(b[a].bbox));return b},HTMLstretchH:v.mbase.HTMLstretchH,HTMLstretchV:v.mbase.HTMLstretchV});MathJax.Hub.Startup.signal.Post("HTML-CSS mmultiscripts Ready");MathJax.Ajax.loadComplete(c.autoloadDir+"/mmultiscripts.js")});