Merge branch 'performance' into v2.0-candidate (still need to optimize linebreak measurements)

This commit is contained in:
Davide P. Cervone 2011-09-11 13:13:22 -04:00
commit d5f2ab74f3
20 changed files with 599 additions and 298 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -53,7 +53,7 @@ MathJax.InputJax.TeX=MathJax.InputJax({id:"TeX",version:"1.1.10",directory:MathJ
MathJax.InputJax.MathML=MathJax.InputJax({id:"MathML",version:"1.1.8",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.14",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",linebreaks:{automatic:false,width:"container"},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==="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.14",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",EqnChunk:50,EqnChunkFactor:1.5,linebreaks:{automatic:false,width:"container"},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==="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.10",directory:MathJax.OutputJax.directory+"/NativeMML",extensionDir:MathJax.OutputJax.extensionDir+"/NativeMML",config:{scale:100,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

View File

@ -31,7 +31,7 @@ MathJax.Hub.Config({"v1.0-compatible":false});
MathJax.InputJax.MathML=MathJax.InputJax({id:"MathML",version:"1.1.8",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.14",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",linebreaks:{automatic:false,width:"container"},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==="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.14",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",EqnChunk:50,EqnChunkFactor:1.5,linebreaks:{automatic:false,width:"container"},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==="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.10",directory:MathJax.OutputJax.directory+"/NativeMML",extensionDir:MathJax.OutputJax.extensionDir+"/NativeMML",config:{scale:100,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

View File

@ -40,7 +40,7 @@ MathJax.InputJax.TeX=MathJax.InputJax({id:"TeX",version:"1.1.10",directory:MathJ
MathJax.InputJax.MathML=MathJax.InputJax({id:"MathML",version:"1.1.8",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.14",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",linebreaks:{automatic:false,width:"container"},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==="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.14",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",EqnChunk:50,EqnChunkFactor:1.5,linebreaks:{automatic:false,width:"container"},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==="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.10",directory:MathJax.OutputJax.directory+"/NativeMML",extensionDir:MathJax.OutputJax.extensionDir+"/NativeMML",config:{scale:100,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

View File

@ -12,5 +12,5 @@
* http://www.apache.org/licenses/LICENSE-2.0
*/
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function(){var g="1.1.4";var c=MathJax.ElementJax.mml,e=MathJax.OutputJax["HTML-CSS"];var d,f,b;var a=e.config.tooltip=MathJax.Hub.Insert({delayPost:600,delayClear:600,offsetX:10,offsetY:5},e.config.tooltip||{});c.maction.Augment({HTMLtooltip:e.addElement(document.body,"div",{id:"MathJax_Tooltip"}),toHTML:function(j,h,k){j=this.HTMLhandleSize(this.HTMLcreateSpan(j));j.bbox=null;var i=this.selected();if(i){e.Measured(i.toHTML(j),j);if(k!=null){e.Remeasured(i.HTMLstretchV(j,h,k),j)}else{if(h!=null){e.Remeasured(i.HTMLstretchH(j,h),j)}}this.HTMLhandleHitBox(j)}this.HTMLhandleSpace(j);this.HTMLhandleColor(j);return j},HTMLhandleHitBox:function(i,l){var k;if(e.msieHitBoxBug){var j=e.addElement(i,"span",{isMathJax:true});k=e.createFrame(j,i.bbox.h,i.bbox.d,i.bbox.w,0,"none");i.insertBefore(j,i.firstChild);j.style.marginRight=e.Em(-i.bbox.w);if(e.msieInlineBlockAlignBug){k.style.verticalAlign=e.Em(e.getHD(i).d-i.bbox.d)}}else{k=e.createFrame(i,i.bbox.h,i.bbox.d,i.bbox.w,0,"none");i.insertBefore(k,i.firstChild);k.style.marginRight=e.Em(-i.bbox.w)}k.className="MathJax_HitBox";k.id="MathJax-HitBox-"+this.spanID+(l||"")+e.idPostfix;var h=this.Get("actiontype");if(this.HTMLaction[h]){this.HTMLaction[h].call(this,i,k,this.Get("selection"))}},HTMLstretchH:c.mbase.HTMLstretchH,HTMLstretchV:c.mbase.HTMLstretchV,HTMLaction:{toggle:function(i,j,h){this.selection=h;j.onclick=i.childNodes[1].onclick=MathJax.Callback(["HTMLclick",this]);j.style.cursor=i.childNodes[1].style.cursor="pointer"},statusline:function(i,j,h){j.onmouseover=i.childNodes[1].onmouseover=MathJax.Callback(["HTMLsetStatus",this]);j.onmouseout=i.childNodes[1].onmouseout=MathJax.Callback(["HTMLclearStatus",this]);j.onmouseover.autoReset=j.onmouseout.autoReset=true},tooltip:function(i,j,h){if(this.data[1]&&this.data[1].isToken){j.title=j.alt=i.childNodes[1].title=i.childNodes[1].alt=this.data[1].data.join("")}else{j.onmouseover=i.childNodes[1].onmouseover=MathJax.Callback(["HTMLtooltipOver",this]);j.onmouseout=i.childNodes[1].onmouseout=MathJax.Callback(["HTMLtooltipOut",this]);j.onmouseover.autoReset=j.onmouseout.autoReset=true}}},HTMLclick:function(l){this.selection++;if(this.selection>this.data.length){this.selection=1}var k=this;while(k.type!=="math"){k=k.inherit}var h=MathJax.Hub.getJaxFor(k.inputID),j=!!h.hover;h.Update();if(j){var i=document.getElementById(h.inputID+"-Span");MathJax.Extension.MathEvents.Hover.Hover(h,i)}return MathJax.Extension.MathEvents.Event.False(l)},HTMLsetStatus:function(h){window.status=((this.data[1]&&this.data[1].isToken)?this.data[1].data.join(""):this.data[1].toString())},HTMLclearStatus:function(h){window.status=""},HTMLtooltipOver:function(i){if(!i){i=window.event}if(b){clearTimeout(b);b=null}if(f){clearTimeout(f)}var h=i.pageX;var k=i.pageY;if(h==null){h=i.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;k=i.clientY+document.body.scrollTop+document.documentElement.scrollTop}var j=MathJax.Callback(["HTMLtooltipPost",this,h+a.offsetX,k+a.offsetY]);f=setTimeout(j,a.delayPost)},HTMLtooltipOut:function(h){if(f){clearTimeout(f);f=null}if(b){clearTimeout(b)}var i=MathJax.Callback(["HTMLtooltipClear",this,80]);b=setTimeout(i,a.delayClear)},HTMLtooltipPost:function(i,m){f=null;if(b){clearTimeout(b);b=null}var l=this.HTMLtooltip;l.style.display="block";l.style.opacity="";l.style.filter=e.config.styles["#MathJax_Tooltip"].filter;if(this===d){return}l.style.left=i+"px";l.style.top=m+"px";l.innerHTML='<span class="MathJax"><nobr></nobr></span>';e.getScales(l.firstChild,l.firstChild);var h=e.createStack(l.firstChild.firstChild);var k=e.createBox(h);try{e.Measured(this.data[1].toHTML(k),k)}catch(j){if(!j.restart){throw j}l.style.display="none";MathJax.Callback.After(["HTMLtooltipPost",this,i,m],j.restart)}e.placeBox(k,0,0);e.createRule(l.firstChild.firstChild,k.bbox.h,k.bbox.d,0);d=this},HTMLtooltipClear:function(i){var h=this.HTMLtooltip;if(i<=0){h.style.display="none";h.style.opacity=h.style.filter="";b=null}else{h.style.opacity=i/100;h.style.filter="alpha(opacity="+i+")";b=setTimeout(MathJax.Callback(["HTMLtooltipClear",this,i-20]),50)}}});MathJax.Hub.Browser.Select({MSIE:function(h){e.msieHitBoxBug=true}});MathJax.Hub.Startup.signal.Post("HTML-CSS maction Ready");MathJax.Ajax.loadComplete(e.autoloadDir+"/maction.js")});
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function(){var g="1.1.4";var c=MathJax.ElementJax.mml,e=MathJax.OutputJax["HTML-CSS"];var d,f,b;var a=e.config.tooltip=MathJax.Hub.Insert({delayPost:600,delayClear:600,offsetX:10,offsetY:5},e.config.tooltip||{});c.maction.Augment({HTMLtooltip:e.addElement(document.body,"div",{id:"MathJax_Tooltip"}),toHTML:function(j,h,l){j=this.HTMLhandleSize(this.HTMLcreateSpan(j));j.bbox=null;var i=this.selected();if(i){var k=i.toHTML(j);if(l!=null){e.Remeasured(i.HTMLstretchV(j,h,l),j)}else{if(h!=null){e.Remeasured(i.HTMLstretchH(j,h),j)}else{e.Measured(k,j)}}this.HTMLhandleHitBox(j)}this.HTMLhandleSpace(j);this.HTMLhandleColor(j);return j},HTMLhandleHitBox:function(i,l){var k;if(e.msieHitBoxBug){var j=e.addElement(i,"span",{isMathJax:true});k=e.createFrame(j,i.bbox.h,i.bbox.d,i.bbox.w,0,"none");i.insertBefore(j,i.firstChild);j.style.marginRight=e.Em(-i.bbox.w);if(e.msieInlineBlockAlignBug){k.style.verticalAlign=e.Em(e.getHD(i).d-i.bbox.d)}}else{k=e.createFrame(i,i.bbox.h,i.bbox.d,i.bbox.w,0,"none");i.insertBefore(k,i.firstChild);k.style.marginRight=e.Em(-i.bbox.w)}k.className="MathJax_HitBox";k.id="MathJax-HitBox-"+this.spanID+(l||"")+e.idPostfix;var h=this.Get("actiontype");if(this.HTMLaction[h]){this.HTMLaction[h].call(this,i,k,this.Get("selection"))}},HTMLstretchH:c.mbase.HTMLstretchH,HTMLstretchV:c.mbase.HTMLstretchV,HTMLaction:{toggle:function(i,j,h){this.selection=h;j.onclick=i.childNodes[1].onclick=MathJax.Callback(["HTMLclick",this]);j.style.cursor=i.childNodes[1].style.cursor="pointer"},statusline:function(i,j,h){j.onmouseover=i.childNodes[1].onmouseover=MathJax.Callback(["HTMLsetStatus",this]);j.onmouseout=i.childNodes[1].onmouseout=MathJax.Callback(["HTMLclearStatus",this]);j.onmouseover.autoReset=j.onmouseout.autoReset=true},tooltip:function(i,j,h){if(this.data[1]&&this.data[1].isToken){j.title=j.alt=i.childNodes[1].title=i.childNodes[1].alt=this.data[1].data.join("")}else{j.onmouseover=i.childNodes[1].onmouseover=MathJax.Callback(["HTMLtooltipOver",this]);j.onmouseout=i.childNodes[1].onmouseout=MathJax.Callback(["HTMLtooltipOut",this]);j.onmouseover.autoReset=j.onmouseout.autoReset=true}}},HTMLclick:function(l){this.selection++;if(this.selection>this.data.length){this.selection=1}var k=this;while(k.type!=="math"){k=k.inherit}var h=MathJax.Hub.getJaxFor(k.inputID),j=!!h.hover;h.Update();if(j){var i=document.getElementById(h.inputID+"-Span");MathJax.Extension.MathEvents.Hover.Hover(h,i)}return MathJax.Extension.MathEvents.Event.False(l)},HTMLsetStatus:function(h){window.status=((this.data[1]&&this.data[1].isToken)?this.data[1].data.join(""):this.data[1].toString())},HTMLclearStatus:function(h){window.status=""},HTMLtooltipOver:function(i){if(!i){i=window.event}if(b){clearTimeout(b);b=null}if(f){clearTimeout(f)}var h=i.pageX;var k=i.pageY;if(h==null){h=i.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;k=i.clientY+document.body.scrollTop+document.documentElement.scrollTop}var j=MathJax.Callback(["HTMLtooltipPost",this,h+a.offsetX,k+a.offsetY]);f=setTimeout(j,a.delayPost)},HTMLtooltipOut:function(h){if(f){clearTimeout(f);f=null}if(b){clearTimeout(b)}var i=MathJax.Callback(["HTMLtooltipClear",this,80]);b=setTimeout(i,a.delayClear)},HTMLtooltipPost:function(n,l){f=null;if(b){clearTimeout(b);b=null}var o=this.HTMLtooltip;o.style.display="block";o.style.opacity="";o.style.filter=e.config.styles["#MathJax_Tooltip"].filter;if(this===d){return}o.style.left=n+"px";o.style.top=l+"px";o.innerHTML='<span class="MathJax"><nobr></nobr></span>';var p=o.insertBefore(e.EmExSpan.cloneNode(true),o.firstChild);var k=p.firstChild.offsetWidth/60;e.em=c.mbase.prototype.em=p.lastChild.firstChild.offsetWidth/60;var h=Math.floor(Math.max(e.config.minScaleAdjust/100,(k/e.TeX.x_height)/e.em)*e.config.scale);e.msieMarginScale=(e.msieMarginScaleBug?h/100:1);o.firstChild.style.fontSize=h+"%";p.parentNode.removeChild(p);var m=e.createStack(o.firstChild.firstChild);var j=e.createBox(m);try{e.Measured(this.data[1].toHTML(j),j)}catch(i){if(!i.restart){throw i}o.style.display="none";MathJax.Callback.After(["HTMLtooltipPost",this,n,l],i.restart)}e.placeBox(j,0,0);e.createRule(o.firstChild.firstChild,j.bbox.h,j.bbox.d,0);d=this},HTMLtooltipClear:function(i){var h=this.HTMLtooltip;if(i<=0){h.style.display="none";h.style.opacity=h.style.filter="";b=null}else{h.style.opacity=i/100;h.style.filter="alpha(opacity="+i+")";b=setTimeout(MathJax.Callback(["HTMLtooltipClear",this,i-20]),50)}}});MathJax.Hub.Browser.Select({MSIE:function(h){e.msieHitBoxBug=true}});MathJax.Hub.Startup.signal.Post("HTML-CSS maction Ready");MathJax.Ajax.loadComplete(e.autoloadDir+"/maction.js")});

View File

@ -12,5 +12,9 @@
* http://www.apache.org/licenses/LICENSE-2.0
*/
<<<<<<< HEAD
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")});
=======
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,B){I=this.HTMLcreateSpan(I);var N=this.HTMLgetScale();var l=b.createStack(I),f;var j=b.createBox(l);if(this.data[this.base]){var k=this.data[this.base].toHTML(j);if(B!=null){this.data[this.base].HTMLstretchV(j,G,B)}else{if(G!=null){this.data[this.base].HTMLstretchH(j,G)}}b.Measured(k,j)}else{j.bbox=this.HTMLzeroBBox()}var L=b.TeX.x_height*N,A=b.TeX.scriptspace*N*0.75;var z=this.HTMLgetScripts(l,A);var m=z[0],e=z[1],w=z[2],i=z[3];var g=(this.data[1]||this).HTMLgetScale();var E=b.TeX.sup_drop*g,C=b.TeX.sub_drop*g;var x=j.bbox.h-E,o=j.bbox.d+C,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")){x=o=0}}var H=this.getValues("subscriptshift","superscriptshift");H.subscriptshift=(H.subscriptshift===""?0:b.length2em(H.subscriptshift));H.superscriptshift=(H.superscriptshift===""?0:b.length2em(H.superscriptshift));var n=0;if(w){n=w.bbox.w+M}else{if(i){n=i.bbox.w-M}}if(n<0){n=0}b.placeBox(j,n,0);if(!e&&!i){o=Math.max(o,b.TeX.sub1*N,H.subscriptshift);if(m){o=Math.max(o,m.bbox.h-(4/5)*L)}if(w){o=Math.max(o,w.bbox.h-(4/5)*L)}if(m){b.placeBox(m,n+j.bbox.w+A-M,-o)}if(w){b.placeBox(w,0,-o)}}else{if(!m&&!w){f=this.getValues("displaystyle","texprimestyle");F=b.TeX[(f.displaystyle?"sup1":(f.texprimestyle?"sup3":"sup2"))];x=Math.max(x,F*N,H.superscriptshift);if(e){x=Math.max(x,e.bbox.d+(1/4)*L)}if(i){x=Math.max(x,i.bbox.d+(1/4)*L)}if(e){b.placeBox(e,n+j.bbox.w+A,x)}if(i){b.placeBox(i,0,x)}}else{o=Math.max(o,b.TeX.sub2*N);var y=b.TeX.rule_thickness*N;var J=(m||w).bbox.h,K=(e||i).bbox.d;if(w){J=Math.max(J,w.bbox.h)}if(i){K=Math.max(K,i.bbox.d)}if((x-K)-(J-o)<3*y){o=3*y-x+K+J;E=(4/5)*L-(x-K);if(E>0){x+=E;o-=E}}x=Math.max(x,H.superscriptshift);o=Math.max(o,H.subscriptshift);if(e){b.placeBox(e,n+j.bbox.w+A,x)}if(i){b.placeBox(i,n+M-i.bbox.w,x)}if(m){b.placeBox(m,n+j.bbox.w+A-M,-o)}if(w){b.placeBox(w,n-w.bbox.w,-o)}}}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")});
>>>>>>> performance

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.14",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",linebreaks:{automatic:false,width:"container"},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==="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.14",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",EqnChunk:50,EqnChunkFactor:1.5,linebreaks:{automatic:false,width:"container"},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==="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

@ -1155,10 +1155,10 @@ MathJax.Message = {
if (this.text) {
if (this.div.parentNode == null) {this.Init()} // see ASCIIMathML comments above
if (this.current == null) {
if (this.timer) {clearTimeout(this.timer)}
if (this.timer) {clearTimeout(this.timer); delete this.timer}
if (delay == null) {delay = 600}
if (delay === 0) {this.Remove()}
else {this.timer = setTimeout(MathJax.Callback(["Remove",this]),(delay||600))}
else {this.timer = setTimeout(MathJax.Callback(["Remove",this]),delay)}
} else if (MathJax.Hub.config.messageStyle !== "none") {
if (this.textNodeBug) {this.div.innerHTML = this.log[this.current].filteredText}
else {this.text.nodeValue = this.log[this.current].filteredText}
@ -1358,18 +1358,26 @@ MathJax.Hub = {
var queue = MathJax.Callback.Queue(["Clear",this.signal]);
for (var i = 0, m = ec.elements.length; i < m; i++) {
if (ec.elements[i]) {
var scripts = []; // filled in by prepareScripts
var state = {
scripts: [], // filled in by prepareScripts
start: new Date().getTime(), // timer for processing messages
i: 0, j: 0, // current script, current jax
jax: {}, // scripts grouped by output jax
jaxIDs: [] // id's of jax used
};
queue.Push(
["Post",this.signal,["Begin "+action,ec.elements[i]]],
["Post",this.signal,["Begin Math",ec.elements[i]]],
["prepareScripts",this,action,ec.elements[i],scripts],
["Post",this.signal,["Begin Math Input",ec.elements[i]]],
["processInput",this,scripts],
["Post",this.signal,["End Math Input",ec.elements[i]]],
["Post",this.signal,["Begin Math Output",ec.elements[i]]],
["processOutput",this,scripts],
["Post",this.signal,["End Math Output",ec.elements[i]]],
["Post",this.signal,["End Math",ec.elements[i]]],
["Post",this.signal,["Begin Math",ec.elements[i],action]],
["prepareScripts",this,action,ec.elements[i],state],
["Post",this.signal,["Begin Math Input",ec.elements[i],action]],
["processInput",this,state],
["Post",this.signal,["End Math Input",ec.elements[i],action]],
["prepareOutput",this,state,"preProcess"],
["Post",this.signal,["Begin Math Output",ec.elements[i],action]],
["processOutput",this,state],
["Post",this.signal,["End Math Output",ec.elements[i],action]],
["prepareOutput",this,state,"postProcess"],
["Post",this.signal,["End Math",ec.elements[i],action]],
["Post",this.signal,["End "+action,ec.elements[i]]]
);
}
@ -1390,7 +1398,7 @@ MathJax.Hub = {
}
},
prepareScripts: function (action,element,math) {
prepareScripts: function (action,element,state) {
if (arguments.callee.disabled) return;
var scripts = this.elementScripts(element);
var STATE = MathJax.ElementJax.STATE;
@ -1404,19 +1412,17 @@ MathJax.Hub = {
if (script.MathJax.state !== STATE.PENDING) {this.scriptAction[action](script)}
}
if (!script.MathJax) {script.MathJax = {state: STATE.PENDING}}
if (script.MathJax.state !== STATE.PROCESSED) {math.push(script)}
if (script.MathJax.state !== STATE.PROCESSED) {state.scripts.push(script)}
}
}
},
checkScriptSiblings: function (script) {
if (script.MathJax && script.MathJax.checked) return;
var config = this.config;
var pre = script.previousSibling;
if (pre && pre.nodeName == "#text") {
var preJax,postJax;
var post = script.nextSibling;
if (post && post.nodeName != "#text") {post = null}
if (script.MathJax.checked) return;
var config = this.config, pre = script.previousSibling;
if (pre && pre.nodeName === "#text") {
var preJax,postJax, post = script.nextSibling;
if (post && post.nodeName !== "#text") {post = null}
if (config.preJax) {
if (typeof(config.preJax) === "string") {config.preJax = new RegExp(config.preJax+"$")}
preJax = pre.nodeValue.match(config.preJax);
@ -1436,92 +1442,169 @@ MathJax.Hub = {
}
if (pre && !pre.nodeValue.match(/\S/)) {pre = pre.previousSibling}
}
if (config.preRemoveClass && pre && pre.className == config.preRemoveClass) {
try {pre.innerHTML = ""} catch (err) {}
pre.style.display = "none";
}
if (script.MathJax) {script.MathJax.checked = 1}
if (config.preRemoveClass && pre && pre.className === config.preRemoveClass)
{script.MathJax.preview = pre}
script.MathJax.checked = 1;
},
processInput: function (scripts,start,n) {
if (arguments.callee.disabled) {return null}
if (!start) {start = new Date().getTime()}
var result, STATE = MathJax.ElementJax.STATE;
var i = 0, script, prev;
processInput: function (state) {
var jax, STATE = MathJax.ElementJax.STATE;
var script, prev, m = state.scripts.length;
try {
while (i < scripts.length) {
script = scripts[i]; if (!script) {i++; continue}
//
// Loop through the scripts
//
while (state.i < m) {
script = state.scripts[state.i]; if (!script) {state.i++; continue}
//
// Remove previous error marker, if any
//
prev = script.previousSibling;
if (prev && prev.className === "MathJax_Error") {prev.parentNode.removeChild(prev)}
var type = script.type.replace(/ *;(.|\s)*/,"");
if (!script.MathJax || script.MathJax.state === STATE.PROCESSED) {i++; continue};
//
// Check if already processed or needs processing
//
if (!script.MathJax || script.MathJax.state === STATE.PROCESSED) {state.i++; continue};
if (!script.MathJax.elementJax || script.MathJax.state === STATE.UPDATE) {
this.checkScriptSiblings(script);
result = this.inputJax[type].Process(script);
this.checkScriptSiblings(script); // remove preJax/postJax etc.
var type = script.type.replace(/ *;(.|\s)*/,""); // the input jax type
jax = this.inputJax[type].Process(script,state); // run the input jax
if (typeof jax === 'function') { // if a callback was returned
if (jax.called) continue; // go back and call Process() again
this.RestartAfter(jax); // wait for the callback
}
jax.Attach(script,this.inputJax[type].id); // register the jax on the script
script.MathJax.state = STATE.OUTPUT; // mark it as needing output
//
if (!this.outputJax[jax.mimeType]) { // check for existing output jax
script.MathJax.state = STATE.UPDATE;
throw Error("No output jax registered for "+jax.mimeType);
}
//
// Record the output jax
// and put this script in the queue for that jax
//
jax.outputJax = this.outputJax[jax.mimeType][0].id;
if (!state.jax[jax.outputJax]) {
if (state.jaxIDs.length === 0) {
// use original array until we know there are more (rather than two copies)
state.jax[jax.outputJax] = state.scripts;
} else {
if (state.jaxIDs.length === 1) // get the script so far for the existing jax
{state.jax[state.jaxIDs[0]] = state.scripts.slice(0,state.i)}
state.jax[jax.outputJax] = []; // start a new array for the new jax
}
state.jaxIDs.push(jax.outputJax); // save the ID of the jax
}
if (state.jaxIDs.length > 1) {state.jax[jax.outputJax].push(script)}
}
//
// Go on to the next script, and check if we need to update the processing message
//
state.i++; var now = new Date().getTime();
if (now - state.start > this.processUpdateTime && state.i < state.scripts.length)
{state.start = now; this.RestartAfter(MathJax.Callback.Delay(1))}
}
} catch (err) {return this.processError(err,state,"Input")}
//
// Put up final message, reset the state and return
//
if (state.scripts.length && this.config.showProcessingMessages)
{MathJax.Message.Set("Processing math: 100%",0)}
state.start = new Date().getTime(); state.i = state.j = 0;
return null;
},
//
// Pre- and post-process scripts by jax
// (to get scaling factors, hide/show output, and so on)
// Since this can cause the jax to load, we need to trap restarts
//
prepareOutput: function (state,method) {
while (state.j < state.jaxIDs.length) {
var id = state.jaxIDs[state.j], JAX = MathJax.OutputJax[id];
if (JAX[method]) {
try {
var result = JAX[method](state);
if (typeof result === 'function') {
if (result.called) continue; // go back and call Process() again
if (result.called) continue; // go back and try again
this.RestartAfter(result);
}
result.Attach(script,this.inputJax[type].id);
script.MathJax.state = STATE.OUTPUT;
} catch (err) {
if (!err.restart) {
MathJax.Message.Set("Error preparing "+id+" output ("+method+")",null,600);
MathJax.Hub.lastPrepError = err;
state.j++;
}
return MathJax.Callback.After(["prepareOutput",this,state,method],err.restart);
}
i++;
if (new Date().getTime() - start > this.processUpdateTime && i < scripts.length)
{start = 0; this.RestartAfter(MathJax.Callback.Delay(1))}
}
} catch (err) {return this.processError(err,scripts,i,n,start,"Input")}
if ((n || scripts.length) && this.config.showProcessingMessages)
{MathJax.Message.Set("Processing math: 100%",0)}
state.j++;
}
return null;
},
processOutput: function (scripts,start,n) {
if (arguments.callee.disabled) {return null}
if (!start) {start = new Date().getTime()}
var result, STATE = MathJax.ElementJax.STATE;
var i = 0, script;
processOutput: function (state) {
var result, STATE = MathJax.ElementJax.STATE, script, m = state.scripts.length;
try {
while (i < scripts.length) {
script = scripts[i]; if (!script || !script.MathJax) {i++; continue}
var jax = script.MathJax.elementJax; if (!jax) {i++; continue}
if (!this.outputJax[jax.mimeType]) {
script.MathJax.state = STATE.UPDATE;
throw Error("No output jax registered for "+jax.mimeType);
}
var outputJax = this.outputJax[jax.mimeType][0];
jax.outputJax = outputJax.id;
result = outputJax.Process(script);
if (typeof result === 'function') {
if (result.called) continue; // go back and call Process() again
this.RestartAfter(result);
}
script.MathJax.state = STATE.PROCESSED; i++;
//
// Loop through the scripts
//
while (state.i < m) {
//
// Check that there is an element jax
//
script = state.scripts[state.i]; if (!script || !script.MathJax) {state.i++; continue}
var jax = script.MathJax.elementJax; if (!jax) {state.i++; continue}
//
// Call the output Jax's Process method (which will be its Translate()
// method once loaded). Mark it as complete and remove the preview.
//
result = MathJax.OutputJax[jax.outputJax].Process(script,state);
script.MathJax.state = STATE.PROCESSED; state.i++;
if (script.MathJax.preview) {script.MathJax.preview.style.display = "none"}
//
// Signal that new math is available
//
this.signal.Post(["New Math",jax.inputID]); // FIXME: wait for this? (i.e., restart if returns uncalled callback)
if (new Date().getTime() - start > this.processUpdateTime && i < scripts.length)
{start = 0; this.RestartAfter(MathJax.Callback.Delay(1))}
//
// Update the processing message, if needed
//
var now = new Date().getTime();
if (now - state.start > this.processUpdateTime && state.i < state.scripts.length)
{state.start = now; this.RestartAfter(MathJax.Callback.Delay(1))}
}
} catch (err) {return this.processError(err,scripts,i,n,start,"Output")}
if ((n || scripts.length) && this.config.showProcessingMessages) {
} catch (err) {return this.processError(err,state,"Output")}
//
// Put up the typesetting-complete message
//
if (state.scripts.length && this.config.showProcessingMessages) {
MathJax.Message.Set("Typesetting math: 100%",0);
MathJax.Message.Clear(0);
}
state.i = state.j = 0;
return null;
},
processError: function (err,scripts,i,n,start,type) {
if (!err.restart) {
if (!this.config.errorSettings.message) {throw err}
this.formatError(scripts[i],err); i++;
}
if (!n) {n = 0}; var m = Math.floor((n+i)/(n+scripts.length)*100); n += i;
processMessage: function (state,type) {
var m = Math.floor(state.i/(state.scripts.length)*100);
var message = (type === "Output" ? "Typesetting" : "Processing");
if (this.config.showProcessingMessages) {MathJax.Message.Set(message+" math: "+m+"%",0)}
return MathJax.Callback.After(["process"+type,this,scripts.slice(i),start,n],err.restart);
},
processError: function (err,state,type) {
if (!err.restart) {
if (!this.config.errorSettings.message) {throw err}
this.formatError(state.scripts[state.i],err); state.i++;
}
this.processMessage(state,type);
return MathJax.Callback.After(["process"+type,this,state],err.restart);
},
formatError: function (script,err) {
var error = MathJax.HTML.Element("span",{className:"MathJax_Error"},this.config.errorSettings.message);
script.parentNode.insertBefore(error,script);
if (script.MathJax.preview) {script.MathJax.preview.style.display = "none"}
this.lastError = err;
},
@ -1752,7 +1835,12 @@ MathJax.Hub.Startup = {
onLoad: function (when) {
var onload = this.onload =
MathJax.Callback(function () {MathJax.Hub.Startup.signal.Post("onLoad")});
if (window.addEventListener) {window.addEventListener("load",onload,false)}
if (document.readyState && document.readyState !== "loading") {return [onload]}
if (window.addEventListener) {
window.addEventListener("load",onload,false);
if (!this.params.noDOMContentEvent)
{window.addEventListener("DOMContentLoaded",onload,false)}
}
else if (window.attachEvent) {window.attachEvent("onload",onload)}
else {window.onload = onload}
return onload;
@ -1839,12 +1927,12 @@ MathJax.Hub.Startup = {
cObject.Augment(null,cdef);
return this;
},
Process: function (element) {
preProcess: function (element) {
var load, file = this.directory+"/"+this.JAXFILE;
this.constructor.prototype.Process = function (element) {
if (!load.called) {return load}
this.constructor.prototype.preProcess = function (element) {
if (!load.called) {return load}
throw Error(file+" failed to load properly");
};
}
load = AJAX.Require(file);
return load;
},
@ -1874,7 +1962,11 @@ MathJax.Hub.Startup = {
["Post",HUB.Startup.signal,this.id+" Jax Startup"],
["Startup",this],
["Post",HUB.Startup.signal,this.id+" Jax Ready"],
[function (THIS) {THIS.Process = THIS.Translate},this.constructor.prototype],
[function (THIS) {
THIS.preProcess = THIS.preTranslate;
THIS.Process = THIS.Translate;
THIS.postProcess = THIS.postTranslate;
},this.constructor.prototype],
["loadComplete",AJAX,this.directory+"/"+file]
);
}
@ -2016,7 +2108,7 @@ MathJax.Hub.Startup = {
if (typeof(jax[id]) === 'undefined' && id !== 'newID') {delete this[id]}
}
for (id in jax) {
if (!this.hasOwnProperty(id)) continue;
if (!jax.hasOwnProperty(id)) continue;
if (typeof(this[id]) === 'undefined' || (this[id] !== jax[id] && id !== 'inputID'))
{this[id] = jax[id]}
}

View File

@ -44,9 +44,10 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
span = this.HTMLhandleSize(this.HTMLcreateSpan(span)); span.bbox = null;
var selected = this.selected();
if (selected) {
HTMLCSS.Measured(selected.toHTML(span),span);
var box = selected.toHTML(span);
if (D != null) {HTMLCSS.Remeasured(selected.HTMLstretchV(span,HW,D),span)}
else if (HW != null) {HTMLCSS.Remeasured(selected.HTMLstretchH(span,HW),span)}
else {HTMLCSS.Measured(box,span)}
this.HTMLhandleHitBox(span);
}
this.HTMLhandleSpace(span);
@ -162,7 +163,17 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
if (this === currentTip) return;
tip.style.left = x+"px"; tip.style.top = y+"px";
tip.innerHTML = '<span class="MathJax"><nobr></nobr></span>';
HTMLCSS.getScales(tip.firstChild,tip.firstChild);
//
// get em sizes (taken from HTMLCSS.preTranslate)
//
var emex = tip.insertBefore(HTMLCSS.EmExSpan.cloneNode(true),tip.firstChild);
var ex = emex.firstChild.offsetWidth/60;
HTMLCSS.em = MML.mbase.prototype.em = emex.lastChild.firstChild.offsetWidth/60;
var scale = Math.floor(Math.max(HTMLCSS.config.minScaleAdjust/100,(ex/HTMLCSS.TeX.x_height)/HTMLCSS.em) * HTMLCSS.config.scale);
HTMLCSS.msieMarginScale = (HTMLCSS.msieMarginScaleBug ? scale/100 : 1);
tip.firstChild.style.fontSize = scale+"%";
emex.parentNode.removeChild(emex);
var stack = HTMLCSS.createStack(tip.firstChild.firstChild);
var box = HTMLCSS.createBox(stack);
try {HTMLCSS.Measured(this.data[1].toHTML(box),box)} catch(err) {

View File

@ -31,11 +31,12 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
span = this.HTMLcreateSpan(span); var scale = this.HTMLgetScale();
var stack = HTMLCSS.createStack(span), values;
var base = HTMLCSS.createBox(stack);
this.HTMLmeasureChild(this.base,base);
if (this.data[this.base]) {
if (D != null) {HTMLCSS.Remeasured(this.data[this.base].HTMLstretchV(base,HW,D),base)}
else if (HW != null) {HTMLCSS.Remeasured(this.data[this.base].HTMLstretchH(base,HW),base)}
}
var child = this.data[this.base].toHTML(base);
if (D != null) {this.data[this.base].HTMLstretchV(base,HW,D)}
else if (HW != null) {this.data[this.base].HTMLstretchH(base,HW)}
HTMLCSS.Measured(child,base);
} else {base.bbox = this.HTMLzeroBBox()}
var x_height = HTMLCSS.TeX.x_height * scale,
s = HTMLCSS.TeX.scriptspace * scale * .75; // FIXME: .75 can be removed when IC is right?

View File

@ -22,7 +22,7 @@
*/
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
var VERSION = "1.1.2";
var VERSION = "1.1.3";
var MML = MathJax.ElementJax.mml,
HTMLCSS = MathJax.OutputJax["HTML-CSS"];
@ -38,7 +38,7 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
var stack = HTMLCSS.createStack(span);
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 H = [], D = [], W = [], A = [], C = [], i, j, J = -1, m, M, s, row, entries = [];
var LHD = HTMLCSS.FONTDATA.baselineskip * scale * values.useHeight,
LH = HTMLCSS.FONTDATA.lineH * scale, LD = HTMLCSS.FONTDATA.lineD * scale;
@ -55,7 +55,13 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
W[j] = -HTMLCSS.BIGDIMEN;
}
A[i][j] = HTMLCSS.createBox(C[j]);
HTMLCSS.Measured(row.data[j-s].toHTML(A[i][j]),A[i][j]);
entries.push(row.data[j-s].toHTML(A[i][j]));
}
}
HTMLCSS.MeasureSpans(entries);
for (i = 0, m = this.data.length; i < m; i++) {
row = this.data[i]; s = (row.type === "mlabeledtr" ? LABEL : 0);
for (j = s, M = row.data.length + s; j < M; j++) {
if (row.data[j-s].isMultiline) {A[i][j].style.width = "100%"}
if (A[i][j].bbox.h > H[i]) {H[i] = A[i][j].bbox.h}
if (A[i][j].bbox.d > D[i]) {D[i] = A[i][j].bbox.d}
@ -431,9 +437,9 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
toHTML: function (span,HW,D) {
span = this.HTMLcreateSpan(span);
if (this.data[0]) {
var box = HTMLCSS.Measured(this.data[0].toHTML(span),span);
if (D != null) {HTMLCSS.Remeasured(this.data[0].HTMLstretchV(span,HW,D),span)}
else if (HW != null) {HTMLCSS.Remeasured(this.data[0].HTMLstretchH(span,HW),span)}
var box = this.data[0].toHTML(span);
if (D != null) {box = this.data[0].HTMLstretchV(span,HW,D)}
else if (HW != null) {box = this.data[0].HTMLstretchH(span,HW)}
span.bbox = box.bbox;
}
this.HTMLhandleSpace(span);

View File

@ -32,13 +32,16 @@ MathJax.OutputJax["HTML-CSS"] = MathJax.OutputJax({
webfontDir: MathJax.OutputJax.fontDir + "/HTML-CSS", // font name added later
config: {
scale: 100, minScaleAdjust: 50,
availableFonts: ["STIX","TeX"],
preferredFont: "TeX",
webFont: "TeX",
imageFont: "TeX",
undefinedFamily: "STIXGeneral,'Arial Unicode MS',serif",
scale: 100, minScaleAdjust: 50, // global math scaling factor, and minimum adjusted scale factor
availableFonts: ["STIX","TeX"], // list of local fonts to check for
preferredFont: "TeX", // preferred local font (TeX or STIX)
webFont: "TeX", // web-based font to use when no local fonts found (TeX is only choice)
imageFont: "TeX", // font to use for image fallback mode (TeX is only choice)
undefinedFamily: "STIXGeneral,'Arial Unicode MS',serif", // fonts to use for unknown unicode characters
EqnChunk: 50, // number of equations to process before showing them
EqnChunkFactor: 1.5, // chunk size is multiplied by this after each chunk
linebreaks: {
automatic: false, // when false, only process linebreak="newline",
// when true, insert line breaks automatically in long expressions.

View File

@ -190,7 +190,6 @@
styles: {
".MathJax": {
"display": "inline",
"font-family": "serif",
"font-style": "normal",
"font-weight": "normal",
"line-height": "normal",
@ -243,6 +242,16 @@
visibility: "hidden", position:"fixed",
width: 0, height: 0, overflow:"hidden"
},
".MathJax_Processed": {display:"none!important"},
".MathJax_ExBox": {
display:"block", overflow:"hidden",
height:"1px", width:"60ex"
},
".MathJax .MathJax_EmBox": {
display:"block", overflow:"hidden",
height:"1px", width:"60em"
},
".MathJax .MathJax_HitBox": {
cursor: "text",
@ -265,7 +274,9 @@
}
},
settings: HUB.config.menuSettings,
hideProcessedMath: true, // use display:none until all math is processed
Font: null, // created by Config() below
Config: function () {
@ -319,16 +330,6 @@
this.Mouseout = HOVER.Mouseout;
this.Mousemove = HOVER.Mousemove;
// Set up default fonts
var family = [], fonts = this.FONTDATA.VARIANT.normal.fonts;
if (!(fonts instanceof Array)) {fonts = [fonts]}
for (var i = 0, m = fonts.length; i < m; i++) {
family[i] = this.FONTDATA.FONTS[fonts[i]].family;
if (!family[i]) {family[i] = fonts[i]}
}
this.config.styles[".MathJax .math span"] =
this.config.styles["#MathJax_getScales"] = {"font-family": family.join(',')};
// Make hidden div for when math is in a display:none block
this.hiddenDiv = this.Element("div",{
style:{visibility:"hidden", overflow:"hidden", position:"absolute", top:0,
@ -358,27 +359,23 @@
this.HDimg = HTMLCSS.createStrut(this.HDspan,0);
}
// Used in getScales
this.HDMspan = this.Element("span",{style: {position:"absolute", "font-size-adjust":"none"}});
if (this.msieInlineBlockAlignBug) {
this.HDMimg = this.addElement(this.HDMspan,"img",{
style:{
height:"0px", width:"1px",
"max-width":"none", "max-height":"none",
border:0, padding:0, margin:0
}
});
try {this.HDMimg.src = "about:blank"} catch(err) {}
} else {
this.HDMimg = HTMLCSS.createStrut(this.HDMspan,0); this.HDMimg.style.marginRight = "";
// Used in preTranslate to get scaling factors
this.EmExSpan = this.Element("span",
{style:{position:"absolute","font-size-adjust":"none"}},
[
["span",{className:"MathJax_ExBox"}],
["span",{className:"MathJax"},
[["span",{className:"MathJax_EmBox"}]]
]
]
);
if (this.msieMarginScaleBug) {
this.addElement(this.EmExSpan.lastChild,"span",null,[
["span",{style:{display:"inline-block",width:"5em"}}],
["span",{style:{display:"inline-block",width:"5em",marginLeft:"-5em"}}]
]);
}
// Used for computing factor to fix margin width in MSIE
this.marginCheck = HTMLCSS.Element("span",null,
[["span",{style: {display:"inline-block", width:"5em"}}]]);
this.marginMove = HTMLCSS.addElement(this.marginCheck,"span",
{style: {display:"inline-block", width:"5em", marginLeft:"-5em"}});
// Used in getLinebreakWidth
this.linebreakSpan = HTMLCSS.Element("span",null,
[["hr",{style: {width:"100%", size:1, padding:0, border:0, margin:0}}]]);
@ -405,48 +402,189 @@
if (!FONT.available) {HTMLCSS.Font.testFont(FONT)}
}
},
preTranslate: function (state) {
var scripts = state.jax[this.id], i, m = scripts.length,
script, prev, span, div, test, jax, ex, em, scale;
for (i = 0; i < m; i++) {
script = scripts[i]; if (!script.parentNode) continue;
//
// Remove any existing output
//
prev = script.previousSibling;
if (prev && String(prev.className).match(/^MathJax(_Display)?$/))
{prev.parentNode.removeChild(prev)}
//
// Add the span, and a div if in display mode,
// then set the role and mark it as being processed
//
jax = script.MathJax.elementJax;
jax.HTMLCSS = {display: (jax.root.Get("display") === "block")}
span = div = this.Element("span",{
className:"MathJax", id:jax.inputID+"-Frame", isMathJax:true,
oncontextmenu:EVENT.Menu, onmousedown: EVENT.Mousedown,
onmouseover:EVENT.Mouseover, onmouseout:EVENT.Mouseout, onmousemove:EVENT.Mousemove,
onclick:EVENT.Click, ondblclick:EVENT.DblClick
});
if (HUB.Browser.noContextMenu) {
span.ontouchstart = TOUCH.start;
span.ontouchend = TOUCH.end;
}
if (jax.HTMLCSS.display) {
div = this.Element("div",{className:"MathJax_Display", style:{width:"100%"}});
div.appendChild(span);
} else if (this.msieDisappearingBug) {span.style.display = "inline-block"}
// (screen readers don't know about role="math" yet, so use "textbox" instead)
div.setAttribute("role","textbox"); div.setAttribute("aria-readonly","true");
div.className += " MathJax_Processing";
script.parentNode.insertBefore(div,script);
//
// Add the test span for determining scales
//
script.parentNode.insertBefore(this.EmExSpan.cloneNode(true),script);
}
//
// Determine the scaling factors for each script
// (this only requires one reflow rather than a reflow for each equation)
//
for (i = 0; i < m; i++) {
script = scripts[i]; if (!script.parentNode) continue;
jax = script.MathJax.elementJax; test = script.previousSibling;
ex = jax.HTMLCSS.ex = test.firstChild.offsetWidth/60;
if (ex === 0 || ex === "NaN") {
// can't read width, so move to hidden div for processing
this.hiddenDiv.appendChild(test.previousSibling);
this.hiddenDiv.appendChild(test);
jax.HTMLCSS.isHidden = true;
ex = jax.HTMLCSS.ex = test.firstChild.offsetWidth/60;
}
em = jax.HTMLCSS.em = test.lastChild.firstChild.offsetWidth/60;
scale = Math.floor(Math.max(this.config.minScaleAdjust/100,(ex/this.TeX.x_height)/em) * this.config.scale);
jax.HTMLCSS.scale = scale/100; jax.HTMLCSS.fontSize = scale+"%";
jax.HTMLCSS.marginScale = 1;
}
//
// If we need to determine MSIE margin scaling,
// set the font sizes (which is what causes the problem)
// and then read the scaling factor (again only one reflow needed)
//
if (this.msieMarginScaleBug) {
for (i = 0; i < m; i++) {
script = scripts[i]; if (!script.parentNode) continue;
jax = script.MathJax.elementJax; test = this.getTestSpan(script);
test.lastChild.style.fontSize = jax.HTMLCSS.fontSize;
}
for (i = 0; i < m; i++) {
script = scripts[i]; if (!script.parentNode) continue;
test = this.getTestSpan(script);
var W = test.lastChild.lastChild.offsetWidth,
w = test.lastChild.lastChild.firstChild.offsetWidth;
math.HTMLCSS.marginScale = (2*w - W ? w/(2*w - W) : 1);
}
}
//
// Remove the test spans used for determining scales
//
for (i = 0; i < m; i++) {
script = scripts[i]; if (!script.parentNode) continue;
test = this.getTestSpan(script);
test.parentNode.removeChild(test);
}
//
// Set state variables used for displaying equations in chunks
//
state.HTMLCSSeqn = state.HTMLCSSlast = 0;
state.HTMLCSSchunk = this.config.EqnChunk;
},
getTestSpan: function (script) {
var jax = script.MathJax.elementJax;
var span = document.getElementById(jax.inputID+"-Frame");
if (jax.HTMLCSS.display) {span = span.parentNode}
return span.nextSibling;
},
Translate: function (script) {
Translate: function (script,state) {
if (!script.parentNode) return;
var prev = script.previousSibling;
if (prev && String(prev.className).match(/^MathJax(_MathML|_Display)?$/))
{prev.parentNode.removeChild(prev)}
var jax = script.MathJax.elementJax, math = jax.root, span, div, frame;
span = div = frame = this.Element("span",{
className:"MathJax", isMathJax:true, jaxID:this.id, id:jax.inputID+"-Span",
oncontextmenu:EVENT.Menu, onmousedown: EVENT.Mousedown,
onmouseover:EVENT.Mouseover, onmouseout: EVENT.Mouseout, onmousemove: EVENT.Mousemove,
onclick:EVENT.Click, ondblclick:EVENT.DblClick
});
if (MathJax.Hub.Browser.noContextMenu) {
span.ontouchstart = TOUCH.start;
span.ontouchend = TOUCH.end;
}
var blockMode = (math.Get("display") === "block");
if (blockMode) {
div = frame = this.Element("div",{className:"MathJax_Display", style:{width:"100%", position:"relative"}});
div.appendChild(span);
}
// (screen readers don't know about role="math" yet, so use "textbox" instead)
div.setAttribute("role","textbox"); div.setAttribute("aria-readonly","true");
if (this.useProcessingFrame) {
frame = this.Element((blockMode ? "div" : "span"),{className:"MathJax_Processing"});
frame.appendChild(div);
}
script.parentNode.insertBefore(frame,script); var isHidden;
try {this.getScales(span); isHidden = (this.em === 0 || String(this.em) === "NaN")} catch (err) {isHidden = true}
if (isHidden) {this.hiddenDiv.appendChild(frame); this.getScales(span)}
jax.em = this.em; jax.outerEm = this.outerEm; jax.scale = this.scale;
this.getLinebreakWidth(frame);
//
// Get the data about the math
//
var jax = script.MathJax.elementJax, math = jax.root,
span = document.getElementById(jax.inputID+"-Frame"),
div = (jax.HTMLCSS.display ? span.parentNode : span);
//
// Set the font metrics
//
this.em = MML.mbase.prototype.em = jax.HTMLCSS.em * jax.HTMLCSS.scale;
this.outerEm = jax.HTMLCSS.em; this.msieMarginScale = jax.HTMLCSS.marginScale;
span.style.fontSize = jax.HTMLCSS.fontSize;
this.getLinebreakWidth(div);
//
// Typeset the math
//
this.initImg(span);
this.initHTML(math,span);
math.setTeXclass();
try {math.toHTML(span,div)} catch (err) {
if (err.restart) {frame.parentNode.removeChild(frame)}
if (err.restart) {while (span.firstChild) {span.removeChild(span.firstChild)}}
throw err;
}
if (isHidden) {script.parentNode.insertBefore(frame,script)}
if (this.useProcessingFrame) frame.parentNode.replaceChild(div,frame);
//
// Put it in place, and remove the processing marker
//
if (jax.HTMLCSS.isHidden) {script.parentNode.insertBefore(div,script)}
div.className = div.className.split(/ /)[0];
//
// Check if we are hiding the math until more is processed
//
if (this.hideProcessedMath) {
//
// Hide the math and don't let its preview be removed
//
div.className += " MathJax_Processed";
if (script.MathJax.preview) {
jax.HTMLCSS.preview = script.MathJax.preview;
delete script.MathJax.preview;
}
//
// Check if we should show this chunk of equations
//
state.HTMLCSSeqn++;
if (state.HTMLCSSeqn >= state.HTMLCSSlast + state.HTMLCSSchunk) {
this.postTranslate(state);
state.HTMLCSSchunk = Math.floor(state.HTMLCSSchunk*this.config.EqnChunkFactor);
}
}
},
postTranslate: function (state) {
var scripts = state.jax[this.id];
if (!this.hideProcessedMath) return;
//
// Reveal this chunk of math
//
for (var i = state.HTMLCSSlast, m = state.HTMLCSSeqn; i < m; i++) {
var script = scripts[i];
if (script) {
//
// Remove the processed marker
//
script.previousSibling.className = script.previousSibling.className.split(/ /)[0];
var data = script.MathJax.elementJax.HTMLCSS;
//
// Remove the preview, if any
//
if (data.preview) {
data.preview.style.display = "none";
script.MathJax.preview = data.preview;
delete data.preview;
}
}
}
//
// Save our place so we know what is revealed
//
state.HTMLCSSlast = state.HTMLCSSeqn;
},
getJaxFromMath: function (math) {
@ -505,9 +643,12 @@
},
Remove: function (jax) {
var span = jax.SourceElement(); if (!span) return;
span = span.previousSibling; if (!span) return;
if (span.className.match(/^MathJax/)) {span.parentNode.removeChild(span)}
var span = document.getElementById(jax.inputID+"-Frame");
if (span) {
if (jax.HTMLCSS.display) {span = span.parentNode}
span.parentNode.removeChild(span);
}
delete jax.HTMLCSS;
},
getLinebreakWidth: function (div) {
@ -525,32 +666,6 @@
}
},
getScales: function (span) {
span.parentNode.insertBefore(this.HDMspan,span);
this.HDMspan.className = ""; this.HDMspan.id = ""; this.HDMspan.style.fontSize = "";
this.HDMimg.style.height = "1px"; this.HDMimg.style.width = "60ex";
var ex = this.HDMspan.offsetWidth/60;
this.HDMspan.className = "MathJax"; this.HDMspan.id = "MathJax_getScales";
this.HDMimg.style.width = "60em";
var em = this.outerEm = this.HDMspan.offsetWidth/60;
this.scale = Math.floor(Math.max(this.config.minScaleAdjust/100,(ex/this.TeX.x_height)/em) * this.config.scale);
span.style.fontSize = this.HDMspan.style.fontSize = this.scale+"%";
this.em = MML.mbase.prototype.em = this.HDMspan.offsetWidth/60;
if (this.operaFontSizeBug && em === this.em && this.scale !== 100) {
// Opera 10.61 doesn't seem to process the fontSize setting above, so adjust manually
this.em = MML.mbase.prototype.em = em * this.scale/100;
}
span.parentNode.removeChild(this.HDMspan);
this.msieMarginScale = this.getMarginScale(span);
},
getMarginScale: function (span) {return 1},
getMSIEmarginScale: function (span) {
span.appendChild(this.marginCheck);
var W = this.marginCheck.offsetWidth, w = this.marginMove.offsetWidth;
var scale = (2*w - W ? w/(2*w - W) : 1);
span.removeChild(this.marginCheck);
return scale;
},
getHD: function (span) {
var position = span.style.position;
span.style.position = "absolute";
@ -565,39 +680,90 @@
return HD;
},
getW: function (span) {
var W = span.offsetWidth, w = (span.bbox ? span.bbox.w: -1), start = span;
if ((w < 0 || this.negativeSkipBug) && W >= 0 && !span.style.width) {
var W, H, w = (span.bbox||{}).w, start = span;
if (span.bbox && span.bbox.exactW) {return w}
if ((span.bbox && w >= 0 && !this.initialSkipBug) || this.negativeBBoxes || !span.firstChild) {
W = span.offsetWidth; H = span.parentNode.offsetHeight;
} else if (span.bbox && w < 0 && this.msieNegativeBBoxBug) {
W = -span.offsetWidth, H = span.parentNode.offsetHeight;
} else {
// IE can't deal with a space at the beginning, so put something else first
if (this.negativeSkipBug) {
if (this.initialSkipBug) {
var position = span.style.position; span.style.position = "absolute";
start = this.startMarker;
if (span.firstChild) {span.insertBefore(start,span.firstChild)}
else {span.appendChild(start)}
start = this.startMarker;
start = this.startMarker; span.insertBefore(start,span.firstChild)
}
span.appendChild(this.endMarker);
W = this.endMarker.offsetLeft - start.offsetLeft;
span.removeChild(this.endMarker);
if (this.negativeSkipBug) {
span.removeChild(start);
span.style.position = position;
}
if (this.initialSkipBug) {span.removeChild(start); span.style.position = position}
}
if (H != null) {span.parentNode.HH = H/this.em}
return W/this.em;
},
Measured: function (span,parent) {
if (span.bbox.width == null && span.bbox.w && !span.bbox.isMultiline) {
var bbox = span.bbox;
if (bbox.width == null && bbox.w && !bbox.isMultiline) {
var w = this.getW(span);
span.bbox.rw += w - span.bbox.w;
span.bbox.w = w;
bbox.rw += w - bbox.w;
bbox.w = w; bbox.exactW = true;
}
if (!parent) {parent = span.parentNode}
if (!parent.bbox) {parent.bbox = span.bbox}
if (!parent.bbox) {parent.bbox = bbox}
return span;
},
Remeasured: function (span,parent) {
parent.bbox = this.Measured(span,parent).bbox;
},
MeasureSpans: function (SPANS) {
var spans = [], span, i, m, bbox, start, end, W;
//
// Insert the needed markers
//
for (i = 0, m = SPANS.length; i < m; i++) {
span = SPANS[i]; if (!span) continue;
bbox = span.bbox;
if (bbox.exactW || bbox.width || bbox.w === 0 || bbox.isMultiline) {
if (!span.parentNode.bbox) {span.parentNode.bbox = bbox}
continue;
}
if (this.negativeBBoxes || !span.firstChild || (bbox.w >= 0 && !this.initialSkipBug) ||
(bbox.w < 0 && this.msieNegativeBBoxBug)) {
spans.push([span]);
} else if (this.initialSkipBug) {
start = this.startMarker.cloneNode(true); end = this.endMarker.cloneNode(true);
span.insertBefore(start,span.firstChild); span.appendChild(end);
spans.push([span,start,end,span.style.position]); span.style.position = "absolute";
} else {
end = this.endMarker.cloneNode(true);
span.appendChild(end); spans.push([span,null,end]);
}
}
//
// Read the widths and heights
//
for (i = 0, m = spans.length; i < m; i++) {
span = spans[i][0]; bbox = span.bbox; var parent = span.parentNode;
if ((bbox.w >= 0 && !this.initialSkipBug) || this.negativeBBoxes || !span.firstChild) {
W = span.offsetWidth; parent.HH = span.parentNode.offsetHeight/this.em;
} else if (bbox.w < 0 && this.msieNegativeBBoxBug) {
W = -span.offsetWidth, parent.HH = span.parentNode.offsetHeight/this.em;
} else {
W = spans[i][2].offsetLeft - spans[i][1].offsetLeft;
}
W /= this.em;
bbox.rw += W - bbox.w;
bbox.w = W; bbox.exactW = true;
if (!parent.bbox) {parent.bbox = bbox}
}
//
// Remove markers
//
for (i = 0, m = spans.length; i < m; i++) {
span = spans[i];
if (span[1]) {span[1].parentNode.removeChild(span[1]), span[0].style.position = span[3]}
if (span[2]) {span[2].parentNode.removeChild(span[2])}
}
},
Em: function (m) {
if (Math.abs(m) < .0006) {return "0em"}
@ -695,10 +861,12 @@
if (this.msieInlineBlockAlignBug) {D = this.Em(HTMLCSS.getHD(span.parentNode).d-d)}
if (span.isBox || span.className == "mspace") {
span.bbox = {
exactW: true,
h: h*span.scale, d: d*span.scale,
w: w*span.scale, rw: w*span.scale, lw: 0
};
span.style.height = H; span.style.verticalAlign = D;
span.HH = (h+d)*span.scale;
} else {
span = this.addElement(span,"span",{style: {height:H, verticalAlign:D}, isMathJax:true});
}
@ -728,10 +896,10 @@
var rule = this.addElement(span,"span",{
style: {borderLeft: color, display: "inline-block", overflow:"hidden",
width:0, height:H, verticalAlign:D},
bbox: {h:h, d:d, w:w, rw:w, lw:0}, noAdjust: true, isMathJax: true
bbox: {h:h, d:d, w:w, rw:w, lw:0, exactW:true}, noAdjust:true, HH:h+d, isMathJax:true
});
if (w > 0 && rule.offsetWidth == 0) {rule.style.width = this.Em(w)}
if (span.isBox || span.className == "mspace") {span.bbox = rule.bbox}
if (span.isBox || span.className == "mspace") {span.bbox = rule.bbox, span.HH = h+d}
return rule;
},
createFrame: function (span,h,d,w,t,style) {
@ -740,7 +908,7 @@
var B = this.Em(t)+" "+style;
var frame = this.addElement(span,"span",{
style: {border: B, display:"inline-block", overflow:"hidden", width:W, height:H},
bbox: {h:h, d:d, w:w, rw:w, lw:0}, noAdjust: true, isMathJax: true
bbox: {h:h, d:d, w:w, rw:w, lw:0, exactW:true}, noAdjust: true, HH:h+d, isMathJax:true
});
if (D) {frame.style.verticalAlign = D}
return frame;
@ -751,12 +919,13 @@
var relativeW = String(w).match(/%$/);
var W = (!relativeW && w != null ? w : 0);
span = this.addElement(span,"span",{
noAdjust: true, isMathJax: true,
noAdjust: true, HH: 0, isMathJax: true,
style: {display:"inline-block", position:"relative",
width:(relativeW ? "100%" : this.Em(W)), height:0}
});
if (!nobbox) {
span.parentNode.bbox = span.bbox = {
exactW: true,
h: -this.BIGDIMEN, d: -this.BIGDIMEN,
w:W, lw: this.BIGDIMEN, rw: (!relativeW && w != null ? w : -this.BIGDIMEN)
};
@ -779,8 +948,12 @@
if (this.msiePlaceBoxBug) {this.addText(span,this.NBSP)}
if (this.imgSpaceBug) {this.addText(span,this.imgSpace)}
// Place the box
var HH = span.offsetHeight/this.em + 1, dx = 0;
if (span.noAdjust) {HH -= 1} else {
var HH, dx = 0;
if (span.HH != null) {HH = span.HH}
else if (bbox) {HH = Math.max(3,bbox.h+bbox.d)}
else {HH = span.offsetHeight/this.em}
if (!span.noAdjust) {
HH += 1;
if (this.msieInlineBlockAlignBug) {
this.addElement(span,"img",{
className:"MathJax_strut", border:0, src:"about:blank", isMathJax:true,
@ -796,7 +969,7 @@
span.style.left = this.Em(x+dx);
// Clip so that bbox doesn't include extra height and depth
if (bbox) {
if (this.negativeSkipBug) {
if (this.initialSkipBug) {
if (bbox.lw < 0) {dx = bbox.lw; HTMLCSS.createBlank(span,-dx,true); l = 0}
if (bbox.rw > bbox.w) {HTMLCSS.createBlank(span,bbox.rw-bbox.w+.1)}
}
@ -833,7 +1006,7 @@
var bbox = span.bbox; if (bbox.isMultiline) return;
var isRelative = bbox.width != null && !bbox.isFixed;
var r = 0, c = -bbox.w/2, l = "50%";
if (this.negativeSkipBug) {r = bbox.w-bbox.rw-.1; c += bbox.lw}
if (this.initialSkipBug) {r = bbox.w-bbox.rw-.1; c += bbox.lw}
c = this.Em(c*this.msieMarginScale);
if (isRelative) {c = ""; l = (50 - parseFloat(bbox.width)/2) + "%"}
HUB.Insert(span.style,({
@ -844,8 +1017,8 @@
setStackWidth: function (span,w) {
if (typeof(w) === "number") {
span.style.width = this.Em(Math.max(0,w));
if (span.bbox) {span.bbox.w = w};
if (span.parentNode.bbox) {span.parentNode.bbox.w = w}
var bbox = span.bbox; if (bbox) {bbox.w = w; bbox.exactW = true};
bbox = span.parentNode.bbox; if (bbox) {bbox.w = w; bbox.exactW = true};
} else {
span.style.width = span.parentNode.style.width = "100%";
if (span.bbox) {span.bbox.width = w}
@ -923,7 +1096,7 @@
w: Math.max(top.bbox.w,ext.bbox.w,bot.bbox.w,mid.bbox.w),
lw: Math.min(top.bbox.lw,ext.bbox.lw,bot.bbox.lw,mid.bbox.lw),
rw: Math.max(top.bbox.rw,ext.bbox.rw,bot.bbox.rw,mid.bbox.rw),
h: 0, d: -y
h: 0, d: -y, exactW: true
}
span.scale = scale;
span.offset = .55 * span.bbox.w;
@ -966,7 +1139,7 @@
w: x+right.bbox.rw, lw: 0, rw: x+right.bbox.rw,
H: Math.max(left.bbox.h,rep.bbox.h,right.bbox.h,mid.bbox.h),
D: Math.max(left.bbox.d,rep.bbox.d,right.bbox.d,mid.bbox.d),
h: rep.bbox.h, d: rep.bbox.d
h: rep.bbox.h, d: rep.bbox.d, exactW: true
}
span.scale = scale;
span.isMultiChar = true;
@ -1002,7 +1175,7 @@
positionDelimiter: function (span,h) {
h -= span.bbox.h; span.bbox.d -= h; span.bbox.h += h;
if (h) {
if (this.safariVerticalAlignBug || this.msieVerticalAlignBug || this.konquerorVerticalAlignBug ||
if (this.safariVerticalAlignBug || this.konquerorVerticalAlignBug ||
(this.operaVerticalAlignBug && span.isMultiChar)) {
if (span.firstChild.style.display === "" && span.style.top !== "")
{span = span.firstChild; h -= parseFloat(span.style.top)}
@ -1294,7 +1467,7 @@
HTMLmultiline: function () {MML.mbase.HTMLautoloadFile("multiline")},
HTMLcomputeBBox: function (span,full,i,m) {
if (i == null) {i = 0}; if (m == null) {m = this.data.length}
var BBOX = span.bbox = {}, stretchy = [];
var BBOX = span.bbox = {exactW: true}, stretchy = [];
while (i < m) {
var core = this.data[i]; if (!core) continue;
if (!full && core.HTMLcanStretch("Vertical"))
@ -1319,6 +1492,7 @@
BBOX.w += bbox.w;
if (child.style.paddingRight) {BBOX.w += parseFloat(child.style.paddingRight)*(child.scale||1)}
if (bbox.width) {BBOX.width = bbox.width}
if (BBOX.exactW && !bbox.exactW) {delete BBOX.exactW}
},
HTMLemptyBBox: function (BBOX) {
BBOX.h = BBOX.d = BBOX.H = BBOX.D = BBOX.rw = -HTMLCSS.BIGDIMEN;
@ -1347,9 +1521,13 @@
},
HTMLmeasureChild: function (n,box) {
if (this.data[n] != null) {HTMLCSS.Measured(this.data[n].toHTML(box),box)}
if (this.data[n]) {HTMLCSS.Measured(this.data[n].toHTML(box),box)}
else {box.bbox = this.HTMLzeroBBox()}
},
HTMLboxChild: function (n,box) {
if (this.data[n]) {return this.data[n].toHTML(box)}
return null;
},
HTMLcreateSpan: function (span) {
if (this.spanID) {
@ -1746,10 +1924,11 @@
toHTML: function (span,HW,D) {
span = this.HTMLcreateSpan(span);
if (this.data[0] != null) {
var box = HTMLCSS.Measured(this.data[0].toHTML(span),span);
var box = this.data[0].toHTML(span);
if (D != null) {HTMLCSS.Remeasured(this.data[0].HTMLstretchV(span,HW,D),span)}
else if (HW != null) {HTMLCSS.Remeasured(this.data[0].HTMLstretchH(span,HW),span)}
span.bbox = {w: box.bbox.w, h: box.bbox.h, d: box.bbox.d, lw: 0, rw: 0};
else {box = HTMLCSS.Measured(box,span)}
span.bbox = {w: box.bbox.w, h: box.bbox.h, d: box.bbox.d, lw: 0, rw: 0, exactW: true};
for (var i = 0, m = span.childNodes.length; i < m; i++)
{span.childNodes[i].style.visibility = "hidden"}
}
@ -1767,16 +1946,17 @@
if (this.data[0] != null) {
var stack = HTMLCSS.createStack(span,true);
var box = HTMLCSS.createBox(stack);
HTMLCSS.Measured(this.data[0].toHTML(box),box);
var child = this.data[0].toHTML(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)}
else {HTMLCSS.Measured(child,box)}
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,
h: box.bbox.h, d: box.bbox.d, w: box.bbox.w, exactW: true,
lw: Math.min(0,box.bbox.lw+x), rw: Math.max(box.bbox.w,box.bbox.rw+x),
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)
@ -1853,8 +2033,8 @@
span = this.HTMLcreateSpan(span);
var frac = HTMLCSS.createStack(span);
var num = HTMLCSS.createBox(frac), den = HTMLCSS.createBox(frac);
this.HTMLmeasureChild(0,num); this.HTMLmeasureChild(1,den);
var values = this.getValues("displaystyle","linethickness","numalign","denomalign","bevelled");
HTMLCSS.MeasureSpans([this.HTMLboxChild(0,num),this.HTMLboxChild(1,den)]);
var values = this.getValues("displaystyle","linethickness","numalign","denomalign","bevelled");
var scale = this.HTMLgetScale(), isDisplay = values.displaystyle;
var a = HTMLCSS.TeX.axis_height * scale;
if (values.bevelled) {
@ -1908,14 +2088,15 @@
var base = HTMLCSS.createBox(sqrt),
rule = HTMLCSS.createBox(sqrt),
surd = HTMLCSS.createBox(sqrt);
this.HTMLmeasureChild(0,base);
var scale = this.HTMLgetScale();
var t = HTMLCSS.TeX.rule_thickness * scale, p,q, H, W;
if (this.Get("displaystyle")) {p = HTMLCSS.TeX.x_height * scale} else {p = t}
q = Math.max(t + p/4,1.5*HTMLCSS.TeX.min_rule_thickness/this.em); // force to be at least 1px
H = base.bbox.h + base.bbox.d + q + t;
W = base.bbox.w;
HTMLCSS.createDelimiter(surd,0x221A,H,scale); HTMLCSS.Measured(surd);
var BASE = this.HTMLboxChild(0,base);
H = BASE.bbox.h + BASE.bbox.d + q + t;
HTMLCSS.createDelimiter(surd,0x221A,H,scale);
HTMLCSS.MeasureSpans([BASE,surd]);
W = BASE.bbox.w;
var x = 0;
if (surd.isMultiChar || (HTMLCSS.AdjustSurd && HTMLCSS.imgFonts)) {surd.bbox.w *= .95}
if (surd.bbox.h + surd.bbox.d > H) {q = ((surd.bbox.h+surd.bbox.d) - (H-t))/2}
@ -1925,7 +2106,7 @@
} else {
HTMLCSS.createDelimiter(rule,HTMLCSS.FONTDATA.RULECHAR,W,scale);
}
H = base.bbox.h + q + t;
H = BASE.bbox.h + q + t;
q = H*HTMLCSS.rfuzz; if (surd.isMultiChar) {q = HTMLCSS.rfuzz}
x = this.HTMLaddRoot(sqrt,surd,x,surd.bbox.h+surd.bbox.d-H,scale);
HTMLCSS.placeBox(surd,x,H-surd.bbox.h);
@ -2032,20 +2213,26 @@
{return MML.msubsup.prototype.toHTML.call(this,span)}
span = this.HTMLcreateSpan(span); var scale = this.HTMLgetScale();
var stack = HTMLCSS.createStack(span);
var boxes = [], stretch = [], box, i, m, W = -HTMLCSS.BIGDIMEN, WW = W;
var boxes = [], children = [], stretch = [], box, i, m;
for (i = 0, m = this.data.length; i < m; i++) {
if (this.data[i] != null) {
box = boxes[i] = HTMLCSS.createBox(stack);
HTMLCSS.Measured(this.data[i].toHTML(box),box);
children[i] = this.data[i].toHTML(box);
if (i == this.base) {
if (D != null) {HTMLCSS.Remeasured(this.data[this.base].HTMLstretchV(box,HW,D),box)}
else if (HW != null) {HTMLCSS.Remeasured(this.data[this.base].HTMLstretchH(box,HW),box)}
if (D != null) {this.data[this.base].HTMLstretchV(box,HW,D)}
else if (HW != null) {this.data[this.base].HTMLstretchH(box,HW)}
stretch[i] = (D == null && HW != null ? false :
this.data[i].HTMLcanStretch("Horizontal"));
} else {
stretch[i] = this.data[i].HTMLcanStretch("Horizontal");
}
if (box.bbox.w > WW) {WW = box.bbox.w}
}
}
HTMLCSS.MeasureSpans(children);
var W = -HTMLCSS.BIGDIMEN, WW = W;
for (i = 0, m = this.data.length; i < m; i++) {
if (this.data[i]) {
if (boxes[i].bbox.w > WW) {WW = boxes[i].bbox.w}
if (!stretch[i] && WW > W) {W = WW}
}
}
@ -2110,28 +2297,25 @@
toHTML: function (span,HW,D) {
span = this.HTMLcreateSpan(span);
var scale = this.HTMLgetScale(), mu = this.HTMLgetMu(span);
var stack = HTMLCSS.createStack(span), values;
var stack = HTMLCSS.createStack(span), values, children = [];
var base = HTMLCSS.createBox(stack);
this.HTMLmeasureChild(this.base,base);
if (this.data[this.base]) {
if (D != null) {HTMLCSS.Remeasured(this.data[this.base].HTMLstretchV(base,HW,D),base)}
else if (HW != null) {HTMLCSS.Remeasured(this.data[this.base].HTMLstretchH(base,HW),base)}
}
HTMLCSS.placeBox(base,0,0);
children.push(this.data[this.base].toHTML(base));
if (D != null) {this.data[this.base].HTMLstretchV(base,HW,D)}
else if (HW != null) {this.data[this.base].HTMLstretchH(base,HW)}
} else {base.bbox = this.HTMLzeroBBox()}
var sscale = (this.data[this.sup] || this.data[this.sub] || this).HTMLgetScale();
var x_height = HTMLCSS.TeX.x_height * scale,
s = HTMLCSS.TeX.scriptspace * scale * .75; // FIXME: .75 can be removed when IC is right?
var sup, sub;
if (this.HTMLnotEmpty(this.data[this.sup])) {
sup = HTMLCSS.createBox(stack);
HTMLCSS.Measured(this.data[this.sup].toHTML(sup),sup);
sup.bbox.w += s; sup.bbox.rw = Math.max(sup.bbox.w,sup.bbox.rw);
}
if (this.HTMLnotEmpty(this.data[this.sub])) {
sub = HTMLCSS.createBox(stack);
HTMLCSS.Measured(this.data[this.sub].toHTML(sub),sub);
sub.bbox.w += s; sub.bbox.rw = Math.max(sub.bbox.w,sub.bbox.rw);
}
if (this.HTMLnotEmpty(this.data[this.sup]))
{sup = HTMLCSS.createBox(stack); children.push(this.data[this.sup].toHTML(sup))}
if (this.HTMLnotEmpty(this.data[this.sub]))
{sub = HTMLCSS.createBox(stack); children.push(this.data[this.sub].toHTML(sub))}
HTMLCSS.MeasureSpans(children);
if (sup) {sup.bbox.w += s; sup.bbox.rw = Math.max(sup.bbox.w,sup.bbox.rw)}
if (sub) {sub.bbox.w += s; sub.bbox.rw = Math.max(sub.bbox.w,sub.bbox.rw)}
HTMLCSS.placeBox(base,0,0);
var q = HTMLCSS.TeX.sup_drop * sscale, r = HTMLCSS.TeX.sub_drop * sscale;
var u = base.bbox.h - q, v = base.bbox.d + r, delta = 0, p;
if (base.bbox.ic) {delta = base.bbox.ic}
@ -2279,35 +2463,38 @@
//
HUB.Browser.Select({
MSIE: function (browser) {
var mode = (document.documentMode || 0);
var isIE7 = browser.versionAtLeast("7.0");
var isIE8 = browser.versionAtLeast("8.0") && document.documentMode > 7;
var isIE8 = browser.versionAtLeast("8.0") && mode > 7;
var quirks = (document.compatMode === "BackCompat");
// IE doesn't do mouse events on trasparent objects,
// so give a background color, but opacity makes it transparent
HTMLCSS.config.styles[".MathJax .MathJax_HitBox"]["background-color"] = "white";
HTMLCSS.config.styles[".MathJax .MathJax_HitBox"].opacity = 0
HTMLCSS.config.styles[".MathJax .MathJax_HitBox"].filter = "alpha(opacity=0)";
if (mode < 9) {
// IE doesn't do mouse events on trasparent objects,
// so give a background color, but opacity makes it transparent
HTMLCSS.config.styles[".MathJax .MathJax_HitBox"]["background-color"] = "white";
HTMLCSS.config.styles[".MathJax .MathJax_HitBox"].opacity = 0
HTMLCSS.config.styles[".MathJax .MathJax_HitBox"].filter = "alpha(opacity=0)";
}
// FIXME: work out tests for these?
HTMLCSS.Augment({
getMarginScale: HTMLCSS.getMSIEmarginScale,
PaddingWidthBug: true,
msieAccentBug: true,
msieColorBug: true,
msieColorPositionBug: true, // needs position:relative to put color behind text
msieRelativeWidthBug: quirks,
msieMarginWidthBug: true,
msieDisappearingBug: (mode >= 8), // inline math disappears
msieMarginScaleBug: (mode < 8), // margins are not scaled properly by font-size
msiePaddingWidthBug: true,
msieBorderWidthBug: quirks,
msieInlineBlockAlignBug: (!isIE8 || quirks),
msieVerticalAlignBug: (isIE8 && !quirks),
msiePlaceBoxBug: (isIE8 && !quirks),
msieClipRectBug: !isIE8,
msieNegativeSpaceBug: quirks,
msieCloneNodeBug: (isIE8 && browser.version === "8.0"),
negativeSkipBug: true,
initialSkipBug: (mode < 8), // confused by initial left-margin values
msieNegativeBBoxBug: (mode >= 8), // negative bboxes have positive widths
msieIE6: !isIE7,
msieItalicWidthBug: true,
zeroWidthBug: true,
zeroWidthBug: (mode < 8),
FontFaceBug: true,
msieFontCSSBug: browser.isIE9,
allowWebFonts: "eot"
@ -2322,7 +2509,6 @@
(HUB.config.root+"/").substr(0,root.length) === root) {webFonts = "otf"}
}
HTMLCSS.Augment({
useProcessingFrame: true,
ffVerticalAlignBug: true,
AccentBug: true,
allowWebFonts: webFonts
@ -2346,10 +2532,10 @@
}
}
},
useProcessingFrame: true,
rfuzz: .011,
AccentBug: true,
AdjustSurd: true,
negativeBBoxes: true,
safariNegativeSpaceBug: true,
safariVerticalAlignBug: !v3p1,
safariTextNodeBug: !v3p0,
@ -2363,7 +2549,6 @@
}
if (forceImages) {
// Force image mode for iOS prior to 4.2 and Droid prior to 2.2
// (iPhone should do SVG web fonts, but crashes with MathJax)
var config = HUB.config["HTML-CSS"];
if (config) {config.availableFonts = []; config.preferredFont = null}
else {HUB.config["HTML-CSS"] = {availableFonts: [], preferredFont: null}}
@ -2372,10 +2557,10 @@
Chrome: function (browser) {
HTMLCSS.Augment({
useProcessingFrame: true,
rfuzz: .011,
AccentBug: true,
AdjustSurd: true,
negativeBBoxes: true,
allowWebFonts: (browser.versionAtLeast("4.0") ? "otf" : "svg"),
safariNegativeSpaceBug: true,
safariWebFontSerif: [""]
@ -2386,11 +2571,10 @@
browser.isMini = (navigator.appVersion.match("Opera Mini") != null);
HTMLCSS.config.styles[".MathJax .merror"]["vertical-align"] = null;
HTMLCSS.Augment({
useProcessingFrame: true,
operaHeightBug: true,
operaVerticalAlignBug: true,
operaFontSizeBug: browser.versionAtLeast("10.61"),
negativeSkipBug: true,
initialSkipBug: true,
zeroWidthBug: true,
FontFaceBug: true,
PaddingWidthBug: true,