/* * /MathJax-v2/jax/output/HTML-CSS/autoload/mmultiscripts.js * * Copyright (c) 2009-2018 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.7.9";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(r,u){var p,d,e=[];var o=1,h=this.data.length,g=0;for(var l=0;l<4;l+=2){while(o0){if(f){this.HTMLmoveColor(q[l],t,1);e[l].w+=t}else{b.createBlank(d,t)}}else{if(t<0){if(f){this.HTMLmoveColor(q[l+1],-t,-1);e[l+1].w+=-t}else{b.createBlank(p,-t)}}}this.HTMLcombineBBoxes(q[l],d.bbox);this.HTMLcombineBBoxes(q[l+1],p.bbox);if(t>0){d.bbox.w=p.bbox.w;d.bbox.rw=Math.max(d.bbox.w,d.bbox.rw)}else{if(t<0){p.bbox.w=d.bbox.w;p.bbox.rw=Math.max(p.bbox.w,p.bbox.rw)}}}else{if(d){this.HTMLcombineBBoxes(q[l],d.bbox)}if(p){this.HTMLcombineBBoxes(q[l+1],p.bbox)}}if(d){g=d.bbox.w}else{if(p){g=p.bbox.w}}}o++;g=0}for(n=0;n<4;n++){if(e[n]){e[n].bbox.w+=u;e[n].bbox.rw=Math.max(e[n].bbox.w,e[n].bbox.rw);e[n].bbox.name=(["sub","sup","presub","presup"])[n];this.HTMLcleanBBox(e[n].bbox)}}return e},HTMLmoveColor:function(h,f,e){var d=f/(h.scale||1);h.style.paddingLeft=b.Em(d);var g=h.previousSibling;if(g&&(g.id||"").match(/^MathJax-Color-/)){g.style.marginLeft=b.Em(d+parseFloat(g.style.marginLeft));g.style.marginRight=b.Em(e*(d-parseFloat(g.style.marginRight)))}},HTMLstretchH:a.mbase.HTMLstretchH,HTMLstretchV:a.mbase.HTMLstretchV});MathJax.Hub.Startup.signal.Post("HTML-CSS mmultiscripts Ready");MathJax.Ajax.loadComplete(b.autoloadDir+"/mmultiscripts.js")});