/*
* /MathJax/jax/output/HTML-CSS/autoload/mmultiscripts.js
*
* Copyright (c) 2009-2015 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.5.0";var a=MathJax.ElementJax.mml,b=MathJax.OutputJax["HTML-CSS"];a.mmultiscripts.Augment({toHTML:function(L,J,E){L=this.HTMLcreateSpan(L);var R=this.HTMLgetScale();var n=b.createStack(L),g;var l=b.createBox(n);if(this.data[this.base]){var m=this.data[this.base].toHTML(l);if(E!=null){this.data[this.base].HTMLstretchV(l,J,E)}else{if(J!=null){this.data[this.base].HTMLstretchH(l,J)}}b.Measured(m,l)}else{l.bbox=this.HTMLzeroBBox()}var P=b.TeX.x_height*R,C=b.TeX.scriptspace*R*0.75;var B=this.HTMLgetScripts(n,C);var o=B[0],f=B[1],y=B[2],k=B[3];var j=R;for(var M=1;M0){z+=G;x-=G}}z=Math.max(z,K.superscriptshift);x=Math.max(x,K.subscriptshift);if(f){b.placeBox(f,w+l.bbox.w+C,z)}if(k){b.placeBox(k,w+Q-k.bbox.w,z)}if(o){b.placeBox(o,w+l.bbox.w+C-Q,-x)}if(y){b.placeBox(y,w-y.bbox.w,-x)}}}this.HTMLhandleSpace(L);this.HTMLhandleColor(L);var e=L.bbox;e.dx=w;e.s=C;e.u=z;e.v=x;e.delta=Q;e.px=w+l.bbox.w;return L},HTMLgetScripts:function(p,q){var o,d,e=[];var n=1,g=this.data.length,f=0;for(var h=0;h<4;h+=2){while(no.bbox.w){b.createBlank(o,d.bbox.w-o.bbox.w);o.bbox.w=d.bbox.w;o.bbox.rw=Math.max(o.bbox.w,o.bbox.rw)}}}if(d){f=d.bbox.w}else{if(o){f=o.bbox.w}}}n++;f=0}for(l=0;l<4;l++){if(e[l]){e[l].bbox.w+=q;e[l].bbox.rw=Math.max(e[l].bbox.w,e[l].bbox.rw);e[l].bbox.name=(["sub","sup","presub","presup"])[l];this.HTMLcleanBBox(e[l].bbox)}}return e},HTMLstretchH:a.mbase.HTMLstretchH,HTMLstretchV:a.mbase.HTMLstretchV});MathJax.Hub.Startup.signal.Post("HTML-CSS mmultiscripts Ready");MathJax.Ajax.loadComplete(b.autoloadDir+"/mmultiscripts.js")});