0),h=false;if(s==null){s=-1}if(!t){s++;l.W+=l.w;l.w=0}n=l.scanW=l.W;l.nest++;if(!this.dataI){this.dataI=[];if(this.data.open){this.dataI.push("open")}if(p){this.dataI.push(0)}for(var r=1;r1){this.data[this.dataI[p]].CHTMLmoveSlice(h.slice(1),n.slice(1),l,g,r,"marginLeft")}else{var q=g.last;g.last=false;var m=this.dataI[p];while(p0),h=false;if(!n){j.W+=j.w;j.w=0}k=j.scanW=j.W;if(m==null){this.CHTML.baseW=this.data[this.base].CHTML.w;this.CHTML.dw=this.CHTML.w-this.CHTML.baseW}if(this.data[this.base].CHTMLbetterBreak(j,g)){h=true;o=[this.base].concat(j.index);l=j.W;p=j.w;if(j.penalty===f.newline){h=n=true}}if(!n){this.CHTMLaddWidth(this.base,j,k)}j.scanW+=this.CHTML.dw;j.W=j.scanW;j.index=[];if(h){j.W=l;j.w=p;j.index=o}return h},CHTMLmoveLine:function(i,m,l,h,q){if(this.data[this.base]){var j=c.addElement(l,"mjx-base");if(i.length>1){this.data[this.base].CHTMLmoveSlice(i.slice(1),m.slice(1),j,h,q,"marginLeft")}else{if(m.length<=1){this.data[this.base].CHTMLmoveNode(j,h,q)}else{this.data[this.base].CHTMLmoveSlice([],m.slice(1),j,h,q,"marginRight")}}}if(m.length===0){var k=this.CHTMLnodeElement(),o=c.getNode(k,"mjx-stack"),n=c.getNode(k,"mjx-sup"),g=c.getNode(k,"mjx-sub");if(o){l.appendChild(o)}else{if(n){l.appendChild(n)}else{if(g){l.appendChild(g)}}}var p=h.bbox.w,r;if(n){r=this.data[this.sup].CHTML;h.bbox.combine(r,p,r.Y)}if(g){r=this.data[this.sub].CHTML;h.bbox.combine(r,p,r.Y)}}}});b.mmultiscripts.Augment({CHTMLbetterBreak:function(k,h){if(!this.data[this.base]){return false}var o=k.index.slice(0);k.index.shift();var m,p,l,n=(k.index.length>0),j=false;if(!n){k.W+=k.w;k.w=0}k.scanW=k.W;var q=this.CHTML,i=this.data[this.base].CHTML;var g=q.w-i.w-q.X;k.scanW+=q.X;l=k.scanW;if(this.data[this.base].CHTMLbetterBreak(k,h)){j=true;o=[this.base].concat(k.index);m=k.W;p=k.w;if(k.penalty===f.newline){j=n=true}}if(!n){this.CHTMLaddWidth(this.base,k,l)}k.scanW+=g;k.W=k.scanW;k.index=[];if(j){k.W=m;k.w=p;k.index=o}return j},CHTMLmoveLine:function(l,o,n,i,u){var m,h=this.CHTMLbbox,t;if(l.length<1){m=this.CHTMLnodeElement();var q=c.getNode(m,"mjx-prestack"),r=c.getNode(m,"mjx-presup"),k=c.getNode(m,"mjx-presub");if(q){n.appendChild(q)}else{if(r){n.appendChild(r)}else{if(k){n.appendChild(k)}}}t=i.bbox.w;if(r){i.bbox.combine(h.presup,t+h.presup.X,h.presup.Y)}if(k){i.bbox.combine(h.presub,t+h.presub.X,h.presub.Y)}}if(this.data[this.base]){var j=c.addElement(n,"mjx-base");if(l.length>1){this.data[this.base].CHTMLmoveSlice(l.slice(1),o.slice(1),j,i,u,"marginLeft")}else{if(o.length<=1){this.data[this.base].CHTMLmoveNode(j,i,u)}else{this.data[this.base].CHTMLmoveSlice([],o.slice(1),j,i,u,"marginRight")}}}if(o.length===0){m=this.CHTMLnodeElement();var s=c.getNode(m,"mjx-stack"),p=c.getNode(m,"mjx-sup"),g=c.getNode(m,"mjx-sub");if(s){n.appendChild(s)}else{if(p){n.appendChild(p)}else{if(g){n.appendChild(g)}}}t=i.bbox.w;if(p){i.bbox.combine(h.sup,t,h.sup.Y)}if(g){i.bbox.combine(h.sub,t,h.sub.Y)}}}});b.mo.Augment({CHTMLbetterBreak:function(i,g){if(i.values&&i.values.id===this.CHTMLnodeID){return false}var o=this.getValues("linebreak","linebreakstyle","lineleading","linebreakmultchar","indentalign","indentshift","indentalignfirst","indentshiftfirst","indentalignlast","indentshiftlast","texClass","fence");if(o.linebreakstyle===b.LINEBREAKSTYLE.INFIXLINEBREAKSTYLE){o.linebreakstyle=this.Get("infixlinebreakstyle")}if(o.texClass===b.TEXCLASS.OPEN){i.nest++}if(o.texClass===b.TEXCLASS.CLOSE&&i.nest){i.nest--}var j=i.scanW;delete i.embellished;var n=this.CHTML.w+(this.CHTML.L||0)+(this.CHTML.R||0);if(o.linebreakstyle===b.LINEBREAKSTYLE.AFTER){j+=n;n=0}if(j-i.shift===0&&o.linebreak!==b.LINEBREAK.NEWLINE){return false}var k=c.linebreakWidth-j;if(g.n===0&&(o.indentshiftfirst!==g.VALUES.indentshiftfirst||o.indentalignfirst!==g.VALUES.indentalignfirst)){var l=this.CHTMLgetAlign(g,o),h=this.CHTMLgetShift(g,o,l);k+=(i.shift-h)}var m=Math.floor(k/c.linebreakWidth*1000);if(m<0){m=f.toobig-3*m}if(o.fence){m+=f.fence}if((o.linebreakstyle===b.LINEBREAKSTYLE.AFTER&&o.texClass===b.TEXCLASS.OPEN)||o.texClass===b.TEXCLASS.CLOSE){m+=f.close}m+=i.nest*f.nestfactor;var p=f[o.linebreak||b.LINEBREAK.AUTO];if(!MathJax.Object.isArray(p)){if(k>=0){m=p*i.nest}}else{m=Math.max(1,m+p[0]*i.nest)}if(m>=i.penalty){return false}i.penalty=m;i.values=o;i.W=j;i.w=n;o.lineleading=this.CHTMLlength2em(o.lineleading,g.VALUES.lineleading);o.id=this.CHTMLnodeID;return true}});b.mspace.Augment({CHTMLbetterBreak:function(h,g){if(h.values&&h.values.id===this.CHTMLnodeID){return false}var n=this.getValues("linebreak");var k=n.linebreak;if(!k||this.hasDimAttr()){k=b.LINEBREAK.AUTO}var i=h.scanW,m=this.CHTML.w+(this.CHTML.L||0)+(this.CHTML.R||0);if(i-h.shift===0){return false}var j=c.linebreakWidth-i;var l=Math.floor(j/c.linebreakWidth*1000);if(l<0){l=f.toobig-3*l}l+=h.nest*f.nestfactor;var o=f[k];if(k===b.LINEBREAK.AUTO&&m>=f.spacelimit&&!this.mathbackground&&!this.background){o=[(m+f.spaceoffset)*f.spacefactor]}if(!MathJax.Object.isArray(o)){if(j>=0){l=o*h.nest}}else{l=Math.max(1,l+o[0]*h.nest)}if(l>=h.penalty){return false}h.penalty=l;h.values=n;h.W=i;h.w=m;n.lineleading=g.VALUES.lineleading;n.linebreakstyle="before";n.id=this.CHTMLnodeID;return true}});MathJax.Hub.Register.StartupHook("TeX mathchoice Ready",function(){b.TeXmathchoice.Augment({CHTMLbetterBreak:function(h,g){return this.Core().CHTMLbetterBreak(h,g)},CHTMLmoveLine:function(k,g,i,j,h){return this.Core().CHTMLmoveSlice(k,g,i,j,h)}})});b.maction.Augment({CHTMLbetterBreak:function(h,g){return this.Core().CHTMLbetterBreak(h,g)},CHTMLmoveLine:function(k,g,i,j,h){return this.Core().CHTMLmoveSlice(k,g,i,j,h)}});b.semantics.Augment({CHTMLbetterBreak:function(h,g){return(this.data[0]?this.data[0].CHTMLbetterBreak(h,g):false)},CHTMLmoveLine:function(k,g,i,j,h){return(this.data[0]?this.data[0].CHTMLmoveSlice(k,g,i,j,h):null)}});MathJax.Hub.Startup.signal.Post("CommonHTML multiline Ready");MathJax.Ajax.loadComplete(c.autoloadDir+"/multiline.js")});