Make units of mu's be relative to the scriptlevel (resolves issue #147)

This commit is contained in:
Davide P. Cervone 2011-09-10 22:15:18 -04:00
parent 45a9d25406
commit 5b6b57af86
24 changed files with 111 additions and 100 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -31,7 +31,7 @@ MathJax.Hub.Config({"v1.0-compatible":false});
MathJax.InputJax.MathML=MathJax.InputJax({id:"MathML",version:"1.1.4",directory:MathJax.InputJax.directory+"/MathML",extensionDir:MathJax.InputJax.extensionDir+"/MathML",entityDir:MathJax.InputJax.directory+"/MathML/entities",config:{useMathMLspacing:false}});MathJax.InputJax.MathML.Register("math/mml");MathJax.InputJax.MathML.loadComplete("config.js");
MathJax.OutputJax["HTML-CSS"]=MathJax.OutputJax({id:"HTML-CSS",version:"1.1.10",directory:MathJax.OutputJax.directory+"/HTML-CSS",extensionDir:MathJax.OutputJax.extensionDir+"/HTML-CSS",autoloadDir:MathJax.OutputJax.directory+"/HTML-CSS/autoload",fontDir:MathJax.OutputJax.directory+"/HTML-CSS/fonts",webfontDir:MathJax.OutputJax.fontDir+"/HTML-CSS",config:{scale:100,minScaleAdjust:50,availableFonts:["STIX","TeX"],preferredFont:"TeX",webFont:"TeX",imageFont:"TeX",undefinedFamily:"STIXGeneral,'Arial Unicode MS',serif",showMathMenu:true,styles:{".MathJax_Display":{"text-align":"center",margin:"1em 0em"},".MathJax .merror":{"background-color":"#FFFF88",color:"#CC0000",border:"1px solid #CC0000",padding:"1px 3px","font-family":"serif","font-style":"normal","font-size":"90%"},".MathJax_Preview":{color:"#888888"},"#MathJax_Tooltip":{"background-color":"InfoBackground",color:"InfoText",border:"1px solid black","box-shadow":"2px 2px 5px #AAAAAA","-webkit-box-shadow":"2px 2px 5px #AAAAAA","-moz-box-shadow":"2px 2px 5px #AAAAAA","-khtml-box-shadow":"2px 2px 5px #AAAAAA",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')",padding:"3px 4px"}}}});if(MathJax.Hub.Browser.isMSIE&&document.documentMode>=9){delete MathJax.OutputJax["HTML-CSS"].config.styles["#MathJax_Tooltip"].filter}if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax["HTML-CSS"].Register("jax/mml")}MathJax.Hub.Register.StartupHook("End Config",[function(b,c){var a=b.Insert({minBrowserVersion:{Firefox:3,Opera:9.52,MSIE:6,Chrome:0.3,Safari:2,Konqueror:4},inlineMathDelimiters:["$","$"],displayMathDelimiters:["$$","$$"],multilineDisplay:true,minBrowserTranslate:function(f){var e=b.getJaxFor(f),k=["[Math]"],j;var h=document.createElement("span",{className:"MathJax_Preview"});if(e.inputJax.id==="TeX"){if(e.root.Get("displaystyle")){j=a.displayMathDelimiters;k=[j[0]+e.originalText+j[1]];if(a.multilineDisplay){k=k[0].split(/\n/)}}else{j=a.inlineMathDelimiters;k=[j[0]+e.originalText.replace(/^\s+/,"").replace(/\s+$/,"")+j[1]]}}for(var g=0,d=k.length;g<d;g++){h.appendChild(document.createTextNode(k[g]));if(g<d-1){h.appendChild(document.createElement("br"))}}f.parentNode.insertBefore(h,f)}},(b.config["HTML-CSS"]||{}));if(b.Browser.version!=="0.0"&&!b.Browser.versionAtLeast(a.minBrowserVersion[b.Browser]||0)){c.Translate=a.minBrowserTranslate;b.Config({showProcessingMessages:false});MathJax.Message.Set("Your browser does not support MathJax",null,4000);b.Startup.signal.Post("MathJax not supported")}},MathJax.Hub,MathJax.OutputJax["HTML-CSS"]]);MathJax.OutputJax["HTML-CSS"].loadComplete("config.js");
MathJax.OutputJax["HTML-CSS"]=MathJax.OutputJax({id:"HTML-CSS",version:"1.1.11",directory:MathJax.OutputJax.directory+"/HTML-CSS",extensionDir:MathJax.OutputJax.extensionDir+"/HTML-CSS",autoloadDir:MathJax.OutputJax.directory+"/HTML-CSS/autoload",fontDir:MathJax.OutputJax.directory+"/HTML-CSS/fonts",webfontDir:MathJax.OutputJax.fontDir+"/HTML-CSS",config:{scale:100,minScaleAdjust:50,availableFonts:["STIX","TeX"],preferredFont:"TeX",webFont:"TeX",imageFont:"TeX",undefinedFamily:"STIXGeneral,'Arial Unicode MS',serif",showMathMenu:true,styles:{".MathJax_Display":{"text-align":"center",margin:"1em 0em"},".MathJax .merror":{"background-color":"#FFFF88",color:"#CC0000",border:"1px solid #CC0000",padding:"1px 3px","font-family":"serif","font-style":"normal","font-size":"90%"},".MathJax_Preview":{color:"#888888"},"#MathJax_Tooltip":{"background-color":"InfoBackground",color:"InfoText",border:"1px solid black","box-shadow":"2px 2px 5px #AAAAAA","-webkit-box-shadow":"2px 2px 5px #AAAAAA","-moz-box-shadow":"2px 2px 5px #AAAAAA","-khtml-box-shadow":"2px 2px 5px #AAAAAA",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')",padding:"3px 4px"}}}});if(MathJax.Hub.Browser.isMSIE&&document.documentMode>=9){delete MathJax.OutputJax["HTML-CSS"].config.styles["#MathJax_Tooltip"].filter}if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax["HTML-CSS"].Register("jax/mml")}MathJax.Hub.Register.StartupHook("End Config",[function(b,c){var a=b.Insert({minBrowserVersion:{Firefox:3,Opera:9.52,MSIE:6,Chrome:0.3,Safari:2,Konqueror:4},inlineMathDelimiters:["$","$"],displayMathDelimiters:["$$","$$"],multilineDisplay:true,minBrowserTranslate:function(f){var e=b.getJaxFor(f),k=["[Math]"],j;var h=document.createElement("span",{className:"MathJax_Preview"});if(e.inputJax.id==="TeX"){if(e.root.Get("displaystyle")){j=a.displayMathDelimiters;k=[j[0]+e.originalText+j[1]];if(a.multilineDisplay){k=k[0].split(/\n/)}}else{j=a.inlineMathDelimiters;k=[j[0]+e.originalText.replace(/^\s+/,"").replace(/\s+$/,"")+j[1]]}}for(var g=0,d=k.length;g<d;g++){h.appendChild(document.createTextNode(k[g]));if(g<d-1){h.appendChild(document.createElement("br"))}}f.parentNode.insertBefore(h,f)}},(b.config["HTML-CSS"]||{}));if(b.Browser.version!=="0.0"&&!b.Browser.versionAtLeast(a.minBrowserVersion[b.Browser]||0)){c.Translate=a.minBrowserTranslate;b.Config({showProcessingMessages:false});MathJax.Message.Set("Your browser does not support MathJax",null,4000);b.Startup.signal.Post("MathJax not supported")}},MathJax.Hub,MathJax.OutputJax["HTML-CSS"]]);MathJax.OutputJax["HTML-CSS"].loadComplete("config.js");
MathJax.OutputJax.NativeMML=MathJax.OutputJax({id:"NativeMML",version:"1.1.4",directory:MathJax.OutputJax.directory+"/NativeMML",extensionDir:MathJax.OutputJax.extensionDir+"/NativeMML",config:{scale:100,showMathMenu:true,showMathMenuMSIE:true,styles:{"DIV.MathJax_MathML":{"text-align":"center",margin:".75em 0px"}}}});if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax.NativeMML.Register("jax/mml")}MathJax.OutputJax.NativeMML.loadComplete("config.js");

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -12,5 +12,5 @@
* http://www.apache.org/licenses/LICENSE-2.0
*/
MathJax.InputJax.TeX=MathJax.InputJax({id:"TeX",version:"1.1.1",directory:MathJax.InputJax.directory+"/TeX",extensionDir:MathJax.InputJax.extensionDir+"/TeX",config:{TagSide:"right",TagIndent:"0.8em",MultLineWidth:"85%"}});MathJax.InputJax.TeX.Register("math/tex");MathJax.InputJax.TeX.loadComplete("config.js");
MathJax.InputJax.TeX=MathJax.InputJax({id:"TeX",version:"1.1.2",directory:MathJax.InputJax.directory+"/TeX",extensionDir:MathJax.InputJax.extensionDir+"/TeX",config:{TagSide:"right",TagIndent:"0.8em",MultLineWidth:"85%"}});MathJax.InputJax.TeX.Register("math/tex");MathJax.InputJax.TeX.loadComplete("config.js");

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -12,5 +12,5 @@
* http://www.apache.org/licenses/LICENSE-2.0
*/
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function(){var c="1.1";var a=MathJax.ElementJax.mml,b=MathJax.OutputJax["HTML-CSS"];a.mglyph.Augment({toHTML:function(i,h){var k=i,f=this.getValues("src","width","height","valign","alt"),j;i=this.HTMLcreateSpan(i);if(f.src===""){var g=this.Get("index");if(g){h=this.HTMLgetVariant();var e=h.defaultFont;if(e){e.noStyleChar=true;e.testString=String.fromCharCode(g)+"ABCabc";if(b.Font.testFont(e)){this.HTMLhandleVariant(i,h,String.fromCharCode(g))}else{if(f.alt===""){f.alt="Bad font: "+e.family}j=a.merror(f.alt).With({mathsize:"75%"});this.Append(j);j.toHTML(i);this.data.pop();i.bbox=j.HTMLspanElement().bbox}}}}else{if(!this.img){this.img=a.mglyph.GLYPH[f.src]}if(!this.img){this.img=a.mglyph.GLYPH[f.src]={img:new Image(),status:"pending"};var d=this.img.img;d.onload=MathJax.Callback(["HTMLimgLoaded",this]);d.onerror=MathJax.Callback(["HTMLimgError",this]);d.src=f.src;MathJax.Hub.RestartAfter(d.onload)}if(this.img.status!=="OK"){j=a.merror("Bad mglyph: "+f.src).With({mathsize:"75%"});this.Append(j);j.toHTML(i);this.data.pop();i.bbox=j.HTMLspanElement().bbox}else{d=b.addElement(i,"img",{src:f.src,alt:f.alt,title:f.alt});if(f.width){if(String(f.width).match(/^\s*-?\d+\s*$/)){f.width+="px"}d.style.width=b.Em(b.length2em(f.width,this.img.img.width/b.em))}if(f.height){if(String(f.height).match(/^\s*-?\d+\s*$/)){f.height+="px"}d.style.height=b.Em(b.length2em(f.height,this.img.img.height/b.em))}i.bbox.w=i.bbox.rw=d.offsetWidth/b.em;i.bbox.h=d.offsetHeight/b.em;if(f.valign){if(String(f.valign).match(/^\s*-?\d+\s*$/)){f.valign+="px"}i.bbox.d=-b.length2em(f.valign,this.img.img.height/b.em);d.style.verticalAlign=b.Em(-i.bbox.d);i.bbox.h-=i.bbox.d}}}if(!k.bbox){k.bbox={w:i.bbox.w,h:i.bbox.h,d:i.bbox.d,rw:i.bbox.rw,lw:i.bbox.lw}}else{if(i.bbox){k.bbox.w+=i.bbox.w;if(k.bbox.w>k.bbox.rw){k.bbox.rw=k.bbox.w}if(i.bbox.h>k.bbox.h){k.bbox.h=i.bbox.h}if(i.bbox.d>k.bbox.d){k.bbox.d=i.bbox.d}}}this.HTMLhandleSpace(i);this.HTMLhandleColor(i);return i},HTMLimgLoaded:function(e,d){if(typeof(e)==="string"){d=e}this.img.status=(d||"OK")},HTMLimgError:function(){this.img.img.onload("error")}},{GLYPH:{}});MathJax.Hub.Startup.signal.Post("HTML-CSS mglyph Ready");MathJax.Ajax.loadComplete(b.autoloadDir+"/mglyph.js")});
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function(){var c="1.1.1";var a=MathJax.ElementJax.mml,b=MathJax.OutputJax["HTML-CSS"];a.mglyph.Augment({toHTML:function(j,f){var i=j,k=this.getValues("src","width","height","valign","alt"),e;j=this.HTMLcreateSpan(j);if(k.src===""){var h=this.Get("index");if(h){f=this.HTMLgetVariant();var d=f.defaultFont;if(d){d.noStyleChar=true;d.testString=String.fromCharCode(h)+"ABCabc";if(b.Font.testFont(d)){this.HTMLhandleVariant(j,f,String.fromCharCode(h))}else{if(k.alt===""){k.alt="Bad font: "+d.family}e=a.merror(k.alt).With({mathsize:"75%"});this.Append(e);e.toHTML(j);this.data.pop();j.bbox=e.HTMLspanElement().bbox}}}}else{if(!this.img){this.img=a.mglyph.GLYPH[k.src]}if(!this.img){this.img=a.mglyph.GLYPH[k.src]={img:new Image(),status:"pending"};var g=this.img.img;g.onload=MathJax.Callback(["HTMLimgLoaded",this]);g.onerror=MathJax.Callback(["HTMLimgError",this]);g.src=k.src;MathJax.Hub.RestartAfter(g.onload)}if(this.img.status!=="OK"){e=a.merror("Bad mglyph: "+k.src).With({mathsize:"75%"});this.Append(e);e.toHTML(j);this.data.pop();j.bbox=e.HTMLspanElement().bbox}else{var l=this.HTMLgetMu(j);g=b.addElement(j,"img",{src:k.src,alt:k.alt,title:k.alt});if(k.width){if(String(k.width).match(/^\s*-?\d+\s*$/)){k.width+="px"}g.style.width=b.Em(b.length2em(k.width,l,this.img.img.width/b.em))}if(k.height){if(String(k.height).match(/^\s*-?\d+\s*$/)){k.height+="px"}g.style.height=b.Em(b.length2em(k.height,l,this.img.img.height/b.em))}j.bbox.w=j.bbox.rw=g.offsetWidth/b.em;j.bbox.h=g.offsetHeight/b.em;if(k.valign){if(String(k.valign).match(/^\s*-?\d+\s*$/)){k.valign+="px"}j.bbox.d=-b.length2em(k.valign,l,this.img.img.height/b.em);g.style.verticalAlign=b.Em(-j.bbox.d);j.bbox.h-=j.bbox.d}}}if(!i.bbox){i.bbox={w:j.bbox.w,h:j.bbox.h,d:j.bbox.d,rw:j.bbox.rw,lw:j.bbox.lw}}else{if(j.bbox){i.bbox.w+=j.bbox.w;if(i.bbox.w>i.bbox.rw){i.bbox.rw=i.bbox.w}if(j.bbox.h>i.bbox.h){i.bbox.h=j.bbox.h}if(j.bbox.d>i.bbox.d){i.bbox.d=j.bbox.d}}}this.HTMLhandleSpace(j);this.HTMLhandleColor(j);return j},HTMLimgLoaded:function(e,d){if(typeof(e)==="string"){d=e}this.img.status=(d||"OK")},HTMLimgError:function(){this.img.img.onload("error")}},{GLYPH:{}});MathJax.Hub.Startup.signal.Post("HTML-CSS mglyph Ready");MathJax.Ajax.loadComplete(b.autoloadDir+"/mglyph.js")});

View File

@ -12,5 +12,5 @@
* http://www.apache.org/licenses/LICENSE-2.0
*/
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function(){var c="1.1";var a=MathJax.ElementJax.mml,b=MathJax.OutputJax["HTML-CSS"];a.mmultiscripts.Augment({toHTML:function(H,F,A){H=this.HTMLcreateSpan(H);var M=this.HTMLgetScale();var k=b.createStack(H),f;var j=b.createBox(k);this.HTMLmeasureChild(this.base,j);if(this.data[this.base]){if(A!=null){b.Remeasured(this.data[this.base].HTMLstretchV(j,F,A),j)}else{if(F!=null){b.Remeasured(this.data[this.base].HTMLstretchH(j,F),j)}}}var K=b.TeX.x_height*M,z=b.TeX.scriptspace*M*0.75;var y=this.HTMLgetScripts(k,z);var l=y[0],e=y[1],o=y[2],i=y[3];var g=(this.data[1]||this).HTMLgetScale();var C=b.TeX.sup_drop*g,B=b.TeX.sub_drop*g;var w=j.bbox.h-C,n=j.bbox.d+B,L=0,E;if(j.bbox.ic){L=j.bbox.ic}if(this.data[this.base]&&(this.data[this.base].type==="mi"||this.data[this.base].type==="mo")){if(this.data[this.base].data.join("").length===1&&j.bbox.scale===1&&!this.data[this.base].Get("largeop")){w=n=0}}var G=this.getValues("subscriptshift","superscriptshift");G.subscriptshift=(G.subscriptshift===""?0:b.length2em(G.subscriptshift));G.superscriptshift=(G.superscriptshift===""?0:b.length2em(G.superscriptshift));var m=0;if(o){m=o.bbox.w+L}else{if(i){m=i.bbox.w-L}}if(m<0){m=0}b.placeBox(j,m,0);if(!e&&!i){n=Math.max(n,b.TeX.sub1*M,G.subscriptshift);if(l){n=Math.max(n,l.bbox.h-(4/5)*K)}if(o){n=Math.max(n,o.bbox.h-(4/5)*K)}if(l){b.placeBox(l,m+j.bbox.w+z-L,-n)}if(o){b.placeBox(o,0,-n)}}else{if(!l&&!o){f=this.getValues("displaystyle","texprimestyle");E=b.TeX[(f.displaystyle?"sup1":(f.texprimestyle?"sup3":"sup2"))];w=Math.max(w,E*M,G.superscriptshift);if(e){w=Math.max(w,e.bbox.d+(1/4)*K)}if(i){w=Math.max(w,i.bbox.d+(1/4)*K)}if(e){b.placeBox(e,m+j.bbox.w+z,w)}if(i){b.placeBox(i,0,w)}}else{n=Math.max(n,b.TeX.sub2*M);var x=b.TeX.rule_thickness*M;var I=(l||o).bbox.h,J=(e||i).bbox.d;if(o){I=Math.max(I,o.bbox.h)}if(i){J=Math.max(J,i.bbox.d)}if((w-J)-(I-n)<3*x){n=3*x-w+J+I;C=(4/5)*K-(w-J);if(C>0){w+=C;n-=C}}w=Math.max(w,G.superscriptshift);n=Math.max(n,G.subscriptshift);if(e){b.placeBox(e,m+j.bbox.w+z,w)}if(i){b.placeBox(i,m+L-i.bbox.w,w)}if(l){b.placeBox(l,m+j.bbox.w+z-L,-n)}if(o){b.placeBox(o,m-o.bbox.w,-n)}}}this.HTMLhandleSpace(H);this.HTMLhandleColor(H);return H},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(n<g&&this.data[n].type!=="mprescripts"){for(var l=h;l<h+2;l++){if(this.data[n]&&this.data[n].type!=="none"){if(!e[l]){e[l]=b.createBox(p);e[l].bbox=this.HTMLemptyBBox({});if(f){b.createBlank(e[l],f);e[l].bbox.w=e[l].bbox.rw=f}}this.data[n].toHTML(e[l]);this.HTMLcombineBBoxes(this.data[n],e[l].bbox)}n++}d=e[h];o=e[h+1];if(d&&o){if(d.bbox.w<o.bbox.w){b.createBlank(d,o.bbox.w-d.bbox.w);d.bbox.w=o.bbox.w;d.bbox.rw=Math.max(d.bbox.w,d.bbox.rw)}else{if(d.bbox.w>o.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);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")});
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function(){var c="1.1.1";var a=MathJax.ElementJax.mml,b=MathJax.OutputJax["HTML-CSS"];a.mmultiscripts.Augment({toHTML:function(I,G,A){I=this.HTMLcreateSpan(I);var N=this.HTMLgetScale();var k=b.createStack(I),f;var j=b.createBox(k);this.HTMLmeasureChild(this.base,j);if(this.data[this.base]){if(A!=null){b.Remeasured(this.data[this.base].HTMLstretchV(j,G,A),j)}else{if(G!=null){b.Remeasured(this.data[this.base].HTMLstretchH(j,G),j)}}}var L=b.TeX.x_height*N,z=b.TeX.scriptspace*N*0.75;var y=this.HTMLgetScripts(k,z);var l=y[0],e=y[1],o=y[2],i=y[3];var g=(this.data[1]||this).HTMLgetScale();var C=b.TeX.sup_drop*g,B=b.TeX.sub_drop*g;var w=j.bbox.h-C,n=j.bbox.d+B,M=0,F;if(j.bbox.ic){M=j.bbox.ic}if(this.data[this.base]&&(this.data[this.base].type==="mi"||this.data[this.base].type==="mo")){if(this.data[this.base].data.join("").length===1&&j.bbox.scale===1&&!this.data[this.base].Get("largeop")){w=n=0}}var H=this.getValues("subscriptshift","superscriptshift"),E=this.HTMLgetMu(I);H.subscriptshift=(H.subscriptshift===""?0:b.length2em(H.subscriptshift,E));H.superscriptshift=(H.superscriptshift===""?0:b.length2em(H.superscriptshift,E));var m=0;if(o){m=o.bbox.w+M}else{if(i){m=i.bbox.w-M}}if(m<0){m=0}b.placeBox(j,m,0);if(!e&&!i){n=Math.max(n,b.TeX.sub1*N,H.subscriptshift);if(l){n=Math.max(n,l.bbox.h-(4/5)*L)}if(o){n=Math.max(n,o.bbox.h-(4/5)*L)}if(l){b.placeBox(l,m+j.bbox.w+z-M,-n)}if(o){b.placeBox(o,0,-n)}}else{if(!l&&!o){f=this.getValues("displaystyle","texprimestyle");F=b.TeX[(f.displaystyle?"sup1":(f.texprimestyle?"sup3":"sup2"))];w=Math.max(w,F*N,H.superscriptshift);if(e){w=Math.max(w,e.bbox.d+(1/4)*L)}if(i){w=Math.max(w,i.bbox.d+(1/4)*L)}if(e){b.placeBox(e,m+j.bbox.w+z,w)}if(i){b.placeBox(i,0,w)}}else{n=Math.max(n,b.TeX.sub2*N);var x=b.TeX.rule_thickness*N;var J=(l||o).bbox.h,K=(e||i).bbox.d;if(o){J=Math.max(J,o.bbox.h)}if(i){K=Math.max(K,i.bbox.d)}if((w-K)-(J-n)<3*x){n=3*x-w+K+J;C=(4/5)*L-(w-K);if(C>0){w+=C;n-=C}}w=Math.max(w,H.superscriptshift);n=Math.max(n,H.subscriptshift);if(e){b.placeBox(e,m+j.bbox.w+z,w)}if(i){b.placeBox(i,m+M-i.bbox.w,w)}if(l){b.placeBox(l,m+j.bbox.w+z-M,-n)}if(o){b.placeBox(o,m-o.bbox.w,-n)}}}this.HTMLhandleSpace(I);this.HTMLhandleColor(I);return I},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(n<g&&this.data[n].type!=="mprescripts"){for(var l=h;l<h+2;l++){if(this.data[n]&&this.data[n].type!=="none"){if(!e[l]){e[l]=b.createBox(p);e[l].bbox=this.HTMLemptyBBox({});if(f){b.createBlank(e[l],f);e[l].bbox.w=e[l].bbox.rw=f}}this.data[n].toHTML(e[l]);this.HTMLcombineBBoxes(this.data[n],e[l].bbox)}n++}d=e[h];o=e[h+1];if(d&&o){if(d.bbox.w<o.bbox.w){b.createBlank(d,o.bbox.w-d.bbox.w);d.bbox.w=o.bbox.w;d.bbox.rw=Math.max(d.bbox.w,d.bbox.rw)}else{if(d.bbox.w>o.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);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")});

File diff suppressed because one or more lines are too long

View File

@ -12,5 +12,5 @@
* http://www.apache.org/licenses/LICENSE-2.0
*/
MathJax.OutputJax["HTML-CSS"]=MathJax.OutputJax({id:"HTML-CSS",version:"1.1.10",directory:MathJax.OutputJax.directory+"/HTML-CSS",extensionDir:MathJax.OutputJax.extensionDir+"/HTML-CSS",autoloadDir:MathJax.OutputJax.directory+"/HTML-CSS/autoload",fontDir:MathJax.OutputJax.directory+"/HTML-CSS/fonts",webfontDir:MathJax.OutputJax.fontDir+"/HTML-CSS",config:{scale:100,minScaleAdjust:50,availableFonts:["STIX","TeX"],preferredFont:"TeX",webFont:"TeX",imageFont:"TeX",undefinedFamily:"STIXGeneral,'Arial Unicode MS',serif",showMathMenu:true,styles:{".MathJax_Display":{"text-align":"center",margin:"1em 0em"},".MathJax .merror":{"background-color":"#FFFF88",color:"#CC0000",border:"1px solid #CC0000",padding:"1px 3px","font-family":"serif","font-style":"normal","font-size":"90%"},".MathJax_Preview":{color:"#888888"},"#MathJax_Tooltip":{"background-color":"InfoBackground",color:"InfoText",border:"1px solid black","box-shadow":"2px 2px 5px #AAAAAA","-webkit-box-shadow":"2px 2px 5px #AAAAAA","-moz-box-shadow":"2px 2px 5px #AAAAAA","-khtml-box-shadow":"2px 2px 5px #AAAAAA",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')",padding:"3px 4px"}}}});if(MathJax.Hub.Browser.isMSIE&&document.documentMode>=9){delete MathJax.OutputJax["HTML-CSS"].config.styles["#MathJax_Tooltip"].filter}if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax["HTML-CSS"].Register("jax/mml")}MathJax.Hub.Register.StartupHook("End Config",[function(b,c){var a=b.Insert({minBrowserVersion:{Firefox:3,Opera:9.52,MSIE:6,Chrome:0.3,Safari:2,Konqueror:4},inlineMathDelimiters:["$","$"],displayMathDelimiters:["$$","$$"],multilineDisplay:true,minBrowserTranslate:function(f){var e=b.getJaxFor(f),k=["[Math]"],j;var h=document.createElement("span",{className:"MathJax_Preview"});if(e.inputJax.id==="TeX"){if(e.root.Get("displaystyle")){j=a.displayMathDelimiters;k=[j[0]+e.originalText+j[1]];if(a.multilineDisplay){k=k[0].split(/\n/)}}else{j=a.inlineMathDelimiters;k=[j[0]+e.originalText.replace(/^\s+/,"").replace(/\s+$/,"")+j[1]]}}for(var g=0,d=k.length;g<d;g++){h.appendChild(document.createTextNode(k[g]));if(g<d-1){h.appendChild(document.createElement("br"))}}f.parentNode.insertBefore(h,f)}},(b.config["HTML-CSS"]||{}));if(b.Browser.version!=="0.0"&&!b.Browser.versionAtLeast(a.minBrowserVersion[b.Browser]||0)){c.Translate=a.minBrowserTranslate;b.Config({showProcessingMessages:false});MathJax.Message.Set("Your browser does not support MathJax",null,4000);b.Startup.signal.Post("MathJax not supported")}},MathJax.Hub,MathJax.OutputJax["HTML-CSS"]]);MathJax.OutputJax["HTML-CSS"].loadComplete("config.js");
MathJax.OutputJax["HTML-CSS"]=MathJax.OutputJax({id:"HTML-CSS",version:"1.1.11",directory:MathJax.OutputJax.directory+"/HTML-CSS",extensionDir:MathJax.OutputJax.extensionDir+"/HTML-CSS",autoloadDir:MathJax.OutputJax.directory+"/HTML-CSS/autoload",fontDir:MathJax.OutputJax.directory+"/HTML-CSS/fonts",webfontDir:MathJax.OutputJax.fontDir+"/HTML-CSS",config:{scale:100,minScaleAdjust:50,availableFonts:["STIX","TeX"],preferredFont:"TeX",webFont:"TeX",imageFont:"TeX",undefinedFamily:"STIXGeneral,'Arial Unicode MS',serif",showMathMenu:true,styles:{".MathJax_Display":{"text-align":"center",margin:"1em 0em"},".MathJax .merror":{"background-color":"#FFFF88",color:"#CC0000",border:"1px solid #CC0000",padding:"1px 3px","font-family":"serif","font-style":"normal","font-size":"90%"},".MathJax_Preview":{color:"#888888"},"#MathJax_Tooltip":{"background-color":"InfoBackground",color:"InfoText",border:"1px solid black","box-shadow":"2px 2px 5px #AAAAAA","-webkit-box-shadow":"2px 2px 5px #AAAAAA","-moz-box-shadow":"2px 2px 5px #AAAAAA","-khtml-box-shadow":"2px 2px 5px #AAAAAA",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')",padding:"3px 4px"}}}});if(MathJax.Hub.Browser.isMSIE&&document.documentMode>=9){delete MathJax.OutputJax["HTML-CSS"].config.styles["#MathJax_Tooltip"].filter}if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax["HTML-CSS"].Register("jax/mml")}MathJax.Hub.Register.StartupHook("End Config",[function(b,c){var a=b.Insert({minBrowserVersion:{Firefox:3,Opera:9.52,MSIE:6,Chrome:0.3,Safari:2,Konqueror:4},inlineMathDelimiters:["$","$"],displayMathDelimiters:["$$","$$"],multilineDisplay:true,minBrowserTranslate:function(f){var e=b.getJaxFor(f),k=["[Math]"],j;var h=document.createElement("span",{className:"MathJax_Preview"});if(e.inputJax.id==="TeX"){if(e.root.Get("displaystyle")){j=a.displayMathDelimiters;k=[j[0]+e.originalText+j[1]];if(a.multilineDisplay){k=k[0].split(/\n/)}}else{j=a.inlineMathDelimiters;k=[j[0]+e.originalText.replace(/^\s+/,"").replace(/\s+$/,"")+j[1]]}}for(var g=0,d=k.length;g<d;g++){h.appendChild(document.createTextNode(k[g]));if(g<d-1){h.appendChild(document.createElement("br"))}}f.parentNode.insertBefore(h,f)}},(b.config["HTML-CSS"]||{}));if(b.Browser.version!=="0.0"&&!b.Browser.versionAtLeast(a.minBrowserVersion[b.Browser]||0)){c.Translate=a.minBrowserTranslate;b.Config({showProcessingMessages:false});MathJax.Message.Set("Your browser does not support MathJax",null,4000);b.Startup.signal.Post("MathJax not supported")}},MathJax.Hub,MathJax.OutputJax["HTML-CSS"]]);MathJax.OutputJax["HTML-CSS"].loadComplete("config.js");

File diff suppressed because one or more lines are too long

View File

@ -24,7 +24,7 @@
MathJax.InputJax.TeX = MathJax.InputJax({
id: "TeX",
version: "1.1.1",
version: "1.1.2",
directory: MathJax.InputJax.directory + "/TeX",
extensionDir: MathJax.InputJax.extensionDir + "/TeX",

View File

@ -1115,7 +1115,7 @@
},
Spacer: function (name,space) {
this.Push(MML.mspace().With({width: space, mathsize: MML.SIZE.NORMAL, scriptlevel:1}));
this.Push(MML.mspace().With({width: space, mathsize: MML.SIZE.NORMAL, scriptlevel:0}));
},
LeftRight: function (name) {
@ -1285,15 +1285,13 @@
if (name === "\\moveleft") {var tmp = h; h = nh; nh = tmp}
this.Push(STACKITEM.position().With({
name: name, move: 'horizontal',
left: MML.mspace().With({width: h, mathsize: MML.SIZE.NORMAL, scriptlevel:1}),
right: MML.mspace().With({width: nh, mathsize: MML.SIZE.NORMAL, scriptlevel:1})
left: MML.mspace().With({width: h, mathsize: MML.SIZE.NORMAL}),
right: MML.mspace().With({width: nh, mathsize: MML.SIZE.NORMAL})
}));
},
Hskip: function (name) {
this.Push(MML.mspace().With({
width: this.GetDimen(name), mathsize: MML.SIZE.NORMAL, scriptlevel:0
}));
this.Push(MML.mspace().With({width: this.GetDimen(name), mathsize: MML.SIZE.NORMAL}));
},
Rule: function (name,style) {

View File

@ -22,7 +22,7 @@
*/
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
var VERSION = "1.1.1";
var VERSION = "1.1.2";
var MML = MathJax.ElementJax.mml,
HTMLCSS = MathJax.OutputJax["HTML-CSS"];
@ -36,8 +36,9 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
if (values.color && !this.mathcolor) {values.mathcolor = values.color}
if (values.thickness == null) {values.thickness = ".075em"}
if (values.padding == null) {values.padding = ".2em"}
var p = HTMLCSS.length2em(values.padding);
var t = HTMLCSS.length2em(values.thickness);
var mu = this.HTMLgetMu(span);
var p = HTMLCSS.length2em(values.padding,mu);
var t = HTMLCSS.length2em(values.thickness,mu);
var SOLID = HTMLCSS.Em(t)+" solid";
span = this.HTMLcreateSpan(span);

View File

@ -22,7 +22,7 @@
*/
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
var VERSION = "1.1";
var VERSION = "1.1.1";
var MML = MathJax.ElementJax.mml,
HTMLCSS = MathJax.OutputJax["HTML-CSS"];
@ -61,20 +61,21 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
this.Append(err); err.toHTML(span); this.data.pop();
span.bbox = err.HTMLspanElement().bbox;
} else {
var mu = this.HTMLgetMu(span);
img = HTMLCSS.addElement(span,"img",{src:values.src, alt:values.alt, title:values.alt});
if (values.width) {
if (String(values.width).match(/^\s*-?\d+\s*$/)) {values.width += "px"}
img.style.width = HTMLCSS.Em(HTMLCSS.length2em(values.width,this.img.img.width/HTMLCSS.em));
img.style.width = HTMLCSS.Em(HTMLCSS.length2em(values.width,mu,this.img.img.width/HTMLCSS.em));
}
if (values.height) {
if (String(values.height).match(/^\s*-?\d+\s*$/)) {values.height += "px"}
img.style.height = HTMLCSS.Em(HTMLCSS.length2em(values.height,this.img.img.height/HTMLCSS.em));
img.style.height = HTMLCSS.Em(HTMLCSS.length2em(values.height,mu,this.img.img.height/HTMLCSS.em));
}
span.bbox.w = span.bbox.rw = img.offsetWidth/HTMLCSS.em;
span.bbox.h = img.offsetHeight/HTMLCSS.em;
if (values.valign) {
if (String(values.valign).match(/^\s*-?\d+\s*$/)) {values.valign += "px"}
span.bbox.d = -HTMLCSS.length2em(values.valign,this.img.img.height/HTMLCSS.em);
span.bbox.d = -HTMLCSS.length2em(values.valign,mu,this.img.img.height/HTMLCSS.em);
img.style.verticalAlign = HTMLCSS.Em(-span.bbox.d);
span.bbox.h -= span.bbox.d;
}

View File

@ -22,7 +22,7 @@
*/
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
var VERSION = "1.1";
var VERSION = "1.1.1";
var MML = MathJax.ElementJax.mml,
HTMLCSS = MathJax.OutputJax["HTML-CSS"];
@ -51,9 +51,9 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
if (this.data[this.base].data.join("").length === 1 && base.bbox.scale === 1 &&
!this.data[this.base].Get("largeop")) {u = v = 0}
}
var min = this.getValues("subscriptshift","superscriptshift");
min.subscriptshift = (min.subscriptshift === "" ? 0 : HTMLCSS.length2em(min.subscriptshift));
min.superscriptshift = (min.superscriptshift === "" ? 0 : HTMLCSS.length2em(min.superscriptshift));
var min = this.getValues("subscriptshift","superscriptshift"), mu = this.HTMLgetMu(span);
min.subscriptshift = (min.subscriptshift === "" ? 0 : HTMLCSS.length2em(min.subscriptshift,mu));
min.superscriptshift = (min.superscriptshift === "" ? 0 : HTMLCSS.length2em(min.superscriptshift,mu));
var dx = 0;
if (presub) {dx = presub.bbox.w+delta} else if (presup) {dx = presup.bbox.w-delta}

View File

@ -22,7 +22,7 @@
*/
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
var VERSION = "1.1.1";
var VERSION = "1.1.2";
var MML = MathJax.ElementJax.mml,
HTMLCSS = MathJax.OutputJax["HTML-CSS"];
@ -36,7 +36,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
"align","useHeight","width","side","minlabelspacing");
var hasRelativeWidth = values.width.match(/%$/);
var stack = HTMLCSS.createStack(span);
var scale = this.HTMLgetScale(); var LABEL = -1;
var scale = this.HTMLgetScale(), mu = this.HTMLgetMu(span), LABEL = -1;
var H = [], D = [], W = [], A = [], C = [], i, j, J = -1, m, M, s, row;
var LHD = HTMLCSS.FONTDATA.baselineskip * scale * values.useHeight,
@ -76,8 +76,8 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
RLINES = values.rowlines.split(/ /),
CWIDTH = values.columnwidth.split(/ /),
RCALIGN = [];
for (i = 0, m = CSPACE.length; i < m; i++) {CSPACE[i] = HTMLCSS.length2em(CSPACE[i])}
for (i = 0, m = RSPACE.length; i < m; i++) {RSPACE[i] = HTMLCSS.length2em(RSPACE[i])}
for (i = 0, m = CSPACE.length; i < m; i++) {CSPACE[i] = HTMLCSS.length2em(CSPACE[i],mu)}
for (i = 0, m = RSPACE.length; i < m; i++) {RSPACE[i] = HTMLCSS.length2em(RSPACE[i],mu)}
while (CSPACE.length < J) {CSPACE.push(CSPACE[CSPACE.length-1])}
while (CALIGN.length <= J) {CALIGN.push(CALIGN[CALIGN.length-1])}
while (CLINES.length < J) {CLINES.push(CLINES[CLINES.length-1])}
@ -124,8 +124,8 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
var fx = 0, fy = 0, fW, fH = HD;
if (values.frame !== "none" ||
(values.columnlines+values.rowlines).match(/solid|dashed/)) {
fx = HTMLCSS.length2em(values.framespacing.split(/[, ]+/)[0]);
fy = HTMLCSS.length2em(values.framespacing.split(/[, ]+/)[1]);
fx = HTMLCSS.length2em(values.framespacing.split(/[, ]+/)[0],mu);
fy = HTMLCSS.length2em(values.framespacing.split(/[, ]+/)[1],mu);
fH = HD + 2*fy; // fW waits until stack.bbox.w is determined
}
//
@ -180,7 +180,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
for (i = 0, m = Math.min(J+1,CSPACE.length); i < m; i++) {WW += CSPACE[i]}
} else {
// Get total width minus column spacing
WW = HTMLCSS.length2em(values.width);
WW = HTMLCSS.length2em(values.width,mu);
for (i = 0, m = Math.min(J+1,CSPACE.length); i < m; i++) {WW -= CSPACE[i]}
// Determine individual column widths
WW /= J+1;
@ -196,8 +196,8 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
if (CWIDTH[i] === "auto") {Wt += W[i]}
else if (CWIDTH[i] === "fit") {F[f] = i; f++; Wt += W[i]}
else if (CWIDTH[i].match(/%$/))
{P[p] = i; p++; Wp += W[i]; WP += HTMLCSS.length2em(CWIDTH[i],1)}
else {W[i] = HTMLCSS.length2em(CWIDTH[i]); Wt += W[i]}
{P[p] = i; p++; Wp += W[i]; WP += HTMLCSS.length2em(CWIDTH[i],mu,1)}
else {W[i] = HTMLCSS.length2em(CWIDTH[i],mu); Wt += W[i]}
}
if (hasRelativeWidth) {
// Get separation width and check percentages
@ -208,12 +208,12 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
if (values.width === "auto") {
if (WP > .98) {Wf = Wp/(Wt+Wp); WW = Wt + Wp} else {WW = Wt / (1-WP)}
} else {
WW = HTMLCSS.length2em(values.width);
WW = HTMLCSS.length2em(values.width,mu);
for (i = 0, m = Math.min(J+1,CSPACE.length); i < m; i++) {WW -= CSPACE[i]}
}
// Determine the relative column widths
for (i = 0, m = P.length; i < m; i++) {
W[P[i]] = HTMLCSS.length2em(CWIDTH[P[i]],WW*Wf); Wt += W[P[i]];
W[P[i]] = HTMLCSS.length2em(CWIDTH[P[i]],mu,WW*Wf); Wt += W[P[i]];
}
// Stretch fit columns, if any, otherwise stretch (or shrink) everything
if (Math.abs(WW - Wt) > .01) {
@ -393,14 +393,14 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
HTMLCSS.addBox(eqn,stack); HTMLCSS.alignBox(stack,indent.indentalign,0);
if (indent.indentshift && indent.indentalign !== MML.INDENTALIGN.CENTER) {
stack.style[{left:"Left",right:"Right"}[indent.indentalign]] =
HTMLCSS.Em(HTMLCSS.length2em(indent.indentshift));
HTMLCSS.Em(HTMLCSS.length2em(indent.indentshift,mu));
}
C[LABEL].parentNode.parentNode.removeChild(C[LABEL].parentNode);
HTMLCSS.addBox(eqn,C[LABEL]); HTMLCSS.alignBox(C[LABEL],CALIGN[LABEL],0);
if (HTMLCSS.msieRelativeWidthBug) {stack.style.top = C[LABEL].style.top = ""}
if (hasRelativeWidth) {stack.style.width = values.width; span.bbox.width = "100%"}
C[LABEL].style.marginRight = C[LABEL].style.marginLeft =
HTMLCSS.Em(HTMLCSS.length2em(values.minlabelspacing));
HTMLCSS.Em(HTMLCSS.length2em(values.minlabelspacing,mu));
}
//
// Finish the table

View File

@ -24,7 +24,7 @@
MathJax.OutputJax["HTML-CSS"] = MathJax.OutputJax({
id: "HTML-CSS",
version: "1.1.10",
version: "1.1.11",
directory: MathJax.OutputJax.directory + "/HTML-CSS",
extensionDir: MathJax.OutputJax.extensionDir + "/HTML-CSS",
autoloadDir: MathJax.OutputJax.directory + "/HTML-CSS/autoload",

View File

@ -565,10 +565,7 @@
Percent: function (m) {
return (100*m).toFixed(1).replace(/\.?0+$/,"") + "%";
},
length2percent: function (length) {
return this.Percent(this.length2em(length));
},
length2em: function (length,size) {
length2em: function (length,mu,size) {
if (typeof(length) !== "string") {length = length.toString()}
if (length === "") {return ""}
if (length === MML.SIZE.NORMAL) {return 1}
@ -579,7 +576,7 @@
if (length.match(/mathspace$/)) {return HTMLCSS.MATHSPACE[length]*factor}
var match = length.match(/^\s*([-+]?(?:\.\d+|\d+(?:\.\d*)?))?(pt|em|ex|mu|px|pc|in|mm|cm|%)?/);
var m = parseFloat(match[1]||"1"), unit = match[2];
if (size == null) {size = 1}
if (size == null) {size = 1}; if (mu == null) {mu = 1}
if (unit === "em") {return m * factor}
if (unit === "ex") {return m * HTMLCSS.TeX.x_height * factor}
if (unit === "%") {return m / 100 * size}
@ -589,15 +586,15 @@
if (unit === "in") {return m * this.pxPerInch / HTMLCSS.em}
if (unit === "cm") {return m * this.pxPerInch / HTMLCSS.em / 2.54} // 2.54 cm to an inch
if (unit === "mm") {return m * this.pxPerInch / HTMLCSS.em / 25.4} // 10 mm to a cm
if (unit === "mu") {return m / 18 * factor} // FIXME: needs to include scale
if (unit === "mu") {return m / 18 * factor * mu} // 18mu to an em for the scriptlevel
return m*factor*size; // relative to given size (or 1em as default)
},
thickness2em: function (length) {
thickness2em: function (length,mu) {
var thick = HTMLCSS.TeX.rule_thickness;
if (length === MML.LINETHICKNESS.MEDIUM) {return thick}
if (length === MML.LINETHICKNESS.THIN) {return .67*thick}
if (length === MML.LINETHICKNESS.THICK) {return 1.67*thick}
return this.length2em(length,thick);
return this.length2em(length,mu,thick);
},
createStrut: function (span,h,before) {
@ -1371,9 +1368,10 @@
if (this.useMMLspacing) {
if (this.type !== "mo") return;
var values = this.getValues("scriptlevel","lspace","rspace");
if (values.scriptlevel <= 0 || this.hasValue("lspace") || this.hasValue("rspace")) {
values.lspace = Math.max(0,HTMLCSS.length2em(values.lspace));
values.rspace = Math.max(0,HTMLCSS.length2em(values.rspace));
if (values.scriptlevel <= 0 || this.hasValue("lspace") || this.hasValue("rspace")) {
var mu = this.HTMLgetMu(span);
values.lspace = Math.max(0,HTMLCSS.length2em(values.lspace,mu));
values.rspace = Math.max(0,HTMLCSS.length2em(values.rspace,mu));
var core = this, parent = this.Parent();
while (parent && parent.isEmbellished() && parent.Core() === core)
{core = parent; parent = parent.Parent(); span = core.HTMLspanElement()}
@ -1383,7 +1381,7 @@
} else {
var space = this.texSpacing();
if (space !== "") {
space = HTMLCSS.length2em(space)/(span.scale||1);
space = HTMLCSS.length2em(space,this.HTMLgetScale())/(span.scale||1);
if (span.style.paddingLeft) {space += parseFloat(span.style.paddingLeft)}
span.style.paddingLeft = HTMLCSS.Em(space);
}
@ -1406,6 +1404,15 @@
scale *= HTMLCSS.length2em(values.mathsize);
return scale;
},
HTMLgetMu: function (span) {
var mu = 1, values = this.getValues("scriptlevel","scriptsizemultiplier");
if (span.scale && span.scale !== 1) {mu = 1/span.scale}
if (values.scriptlevel !== 0) {
if (values.scriptlevel > 2) {values.scriptlevel = 2}
mu = Math.sqrt(Math.pow(values.scriptsizemultiplier,values.scriptlevel));
}
return mu;
},
HTMLgetVariant: function () {
var values = this.getValues("mathvariant","fontfamily","fontweight","fontstyle");
@ -1563,11 +1570,11 @@
HTMLstretchV: function (box,h,d) {
this.HTMLremoveColor();
var values = this.getValues("symmetric","maxsize","minsize");
var span = this.HTMLspanElement(), H;
var span = this.HTMLspanElement(), mu = this.HTMLgetMu(span), H;
var axis = HTMLCSS.TeX.axis_height, scale = span.scale;
if (values.symmetric) {H = 2*Math.max(h-axis,d+axis)} else {H = h + d}
values.maxsize = HTMLCSS.length2em(values.maxsize,span.bbox.h+span.bbox.d);
values.minsize = HTMLCSS.length2em(values.minsize,span.bbox.h+span.bbox.d);
values.maxsize = HTMLCSS.length2em(values.maxsize,mu,span.bbox.h+span.bbox.d);
values.minsize = HTMLCSS.length2em(values.minsize,mu,span.bbox.h+span.bbox.d);
H = Math.max(values.minsize,Math.min(values.maxsize,H));
span = this.HTMLcreateSpan(box); // clear contents and attributes
HTMLCSS.createDelimiter(span,this.data.join("").charCodeAt(0),H,scale);
@ -1582,9 +1589,9 @@
this.HTMLremoveColor();
var values = this.getValues("maxsize","minsize","mathvariant","fontweight");
if (values.fontweight === "bold" && !this.mathvariant) {values.mathvariant = MML.VARIANT.BOLD}
var span = this.HTMLspanElement(), scale = span.scale;
values.maxsize = HTMLCSS.length2em(values.maxsize,span.bbox.w);
values.minsize = HTMLCSS.length2em(values.minsize,span.bbox.w);
var span = this.HTMLspanElement(), mu = this.HTMLgetMu(span), scale = span.scale;
values.maxsize = HTMLCSS.length2em(values.maxsize,mu,span.bbox.w);
values.minsize = HTMLCSS.length2em(values.minsize,mu,span.bbox.w);
W = Math.max(values.minsize,Math.min(values.maxsize,W));
span = this.HTMLcreateSpan(box); // clear contents and attributes
HTMLCSS.createDelimiter(span,this.data.join("").charCodeAt(0),W,scale,values.mathvariant);
@ -1623,10 +1630,12 @@
toHTML: function (span) {
span = this.HTMLhandleSize(this.HTMLcreateSpan(span));
var values = this.getValues("height","depth","width");
var mu = this.HTMLgetMu(span);
values.mathbackground = this.mathbackground;
if (this.background && !this.mathbackground) {values.mathbackground = this.background}
var h = HTMLCSS.length2em(values.height), d = HTMLCSS.length2em(values.depth),
w = HTMLCSS.length2em(values.width);
var h = HTMLCSS.length2em(values.height,mu) / span.scale,
d = HTMLCSS.length2em(values.depth,mu) / span.scale,
w = HTMLCSS.length2em(values.width,mu) / span.scale;
HTMLCSS.createSpace(span,h,d,w,values.mathbackground);
return span;
}
@ -1660,9 +1669,10 @@
HTMLCSS.Measured(this.data[0].toHTML(box),box);
if (D != null) {HTMLCSS.Remeasured(this.data[0].HTMLstretchV(box,HW,D),box)}
else if (HW != null) {HTMLCSS.Remeasured(this.data[0].HTMLstretchH(box,HW),box)}
var values = this.getValues("height","depth","width","lspace","voffset"), x = 0, y = 0;
if (values.lspace) {x = this.HTMLlength2em(box,values.lspace)}
if (values.voffset) {y = this.HTMLlength2em(box,values.voffset)}
var values = this.getValues("height","depth","width","lspace","voffset"),
x = 0, y = 0, mu = this.HTMLgetMu(span);
if (values.lspace) {x = this.HTMLlength2em(box,values.lspace,mu)}
if (values.voffset) {y = this.HTMLlength2em(box,values.voffset,mu)}
HTMLCSS.placeBox(box,x,y);
span.bbox = {
h: box.bbox.h, d: box.bbox.d, w: box.bbox.w,
@ -1670,9 +1680,9 @@
H: Math.max((box.bbox.H == null ? -HTMLCSS.BIGDIMEN : box.bbox.H),box.bbox.h+y),
D: Math.max((box.bbox.D == null ? -HTMLCSS.BIGDIMEN : box.bbox.D),box.bbox.d-y)
};
if (values.height !== "") {span.bbox.h = this.HTMLlength2em(box,values.height,"h",0)}
if (values.depth !== "") {span.bbox.d = this.HTMLlength2em(box,values.depth,"d",0)}
if (values.width !== "") {span.bbox.w = this.HTMLlength2em(box,values.width,"w",0)}
if (values.height !== "") {span.bbox.h = this.HTMLlength2em(box,values.height,mu,"h",0)}
if (values.depth !== "") {span.bbox.d = this.HTMLlength2em(box,values.depth,mu,"d",0)}
if (values.width !== "") {span.bbox.w = this.HTMLlength2em(box,values.width,mu,"w",0)}
if (span.bbox.H <= span.bbox.h) {delete span.bbox.H}
if (span.bbox.D <= span.bbox.d) {delete span.bbox.D}
var dimen = /^\s*(\d+(\.\d*)?|\.\d+)\s*(pt|em|ex|mu|px|pc|in|mm|cm)\s*$/
@ -1684,11 +1694,11 @@
this.HTMLhandleColor(span);
return span;
},
HTMLlength2em: function (span,length,d,m) {
HTMLlength2em: function (span,length,mu,d,m) {
if (m == null) {m = -HTMLCSS.BIGDIMEN}
var match = String(length).match(/width|height|depth/);
var size = (match ? span.bbox[match[0].charAt(0)] : (d ? span.bbox[d] : null));
var v = HTMLCSS.length2em(length,size);
var v = HTMLCSS.length2em(length,mu,size);
if (d && String(length).match(/^\s*[-+]/))
{return Math.max(m,span.bbox[d]+v)} else {return v}
},
@ -1755,7 +1765,7 @@
HTMLCSS.placeBox(den,num.bbox.w+bevel.bbox.w-delta,(den.bbox.d-den.bbox.h)/2+a-delta);
} else {
var W = Math.max(num.bbox.w,den.bbox.w);
var t = HTMLCSS.thickness2em(values.linethickness), p,q, u,v;
var t = HTMLCSS.thickness2em(values.linethickness,scale), p,q, u,v;
var mt = HTMLCSS.TeX.min_rule_thickness/this.em;
if (isDisplay) {u = HTMLCSS.TeX.num1; v = HTMLCSS.TeX.denom1}
else {u = (t === 0 ? HTMLCSS.TeX.num3 : HTMLCSS.TeX.num2); v = HTMLCSS.TeX.denom2}
@ -1995,7 +2005,8 @@
MML.msubsup.Augment({
toHTML: function (span,HW,D) {
span = this.HTMLcreateSpan(span); var scale = this.HTMLgetScale();
span = this.HTMLcreateSpan(span);
var scale = this.HTMLgetScale(), mu = this.HTMLgetMu(span);
var stack = HTMLCSS.createStack(span), values;
var base = HTMLCSS.createBox(stack);
this.HTMLmeasureChild(this.base,base);
@ -2027,8 +2038,8 @@
!this.data[this.base].Get("largeop")) {u = v = 0}
}
var min = this.getValues("subscriptshift","superscriptshift");
min.subscriptshift = (min.subscriptshift === "" ? 0 : HTMLCSS.length2em(min.subscriptshift));
min.superscriptshift = (min.superscriptshift === "" ? 0 : HTMLCSS.length2em(min.superscriptshift));
min.subscriptshift = (min.subscriptshift === "" ? 0 : HTMLCSS.length2em(min.subscriptshift,mu));
min.superscriptshift = (min.superscriptshift === "" ? 0 : HTMLCSS.length2em(min.superscriptshift,mu));
if (!sup) {
if (sub) {
v = Math.max(v,HTMLCSS.TeX.sub1*scale,sub.bbox.h-(4/5)*x_height,min.subscriptshift);