Merge branch 'v2.0-candidate' into SVG

This commit is contained in:
Davide P. Cervone 2011-11-20 17:35:31 -05:00
commit 91543560a9
22 changed files with 56 additions and 36 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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 * http://www.apache.org/licenses/LICENSE-2.0
*/ */
MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function(){var b="1.1.3";var a=MathJax.ElementJax.mml;a.mbase.Augment({toMathML:function(k){var g=(this.inferred&&this.parent.inferRow);if(k==null){k=""}var e=this.type,d=this.MathMLattributes();if(e==="mspace"){return k+"<"+e+d+" />"}var j=[];var h=(this.isToken?"":k+(g?"":" "));for(var f=0,c=this.data.length;f<c;f++){if(this.data[f]){j.push(this.data[f].toMathML(h))}else{if(!this.isToken){j.push(h+"<mrow />")}}}if(this.isToken){return k+"<"+e+d+">"+j.join("")+"</"+e+">"}if(g){return j.join("\n")}if(j.length===0||(j.length===1&&j[0]==="")){return k+"<"+e+d+" />"}return k+"<"+e+d+">\n"+j.join("\n")+"\n"+k+"</"+e+">"},MathMLattributes:function(){var j=[],g=this.defaults;var c=(this.mmlAttributes||this.copyAttributes),l=this.skipAttributes;if(this.type==="math"){j.push('xmlns="http://www.w3.org/1998/Math/MathML"')}if(!this.mmlAttributes){if(this.type==="mstyle"){g=a.math.prototype.defaults}for(var d in g){if(!l[d]&&g.hasOwnProperty(d)){var e=(d==="open"||d==="close");if(this[d]!=null&&(e||this[d]!==g[d])){var k=this[d];delete this[d];if(e||this.Get(d)!==k){j.push(d+'="'+this.formatAttr(k)+'"')}this[d]=k}}}}for(var h=0,f=c.length;h<f;h++){if(this[c[h]]!=null){j.push(c[h]+'="'+this.quoteHTML(this[c[h]])+'"')}}if(j.length){return" "+j.join(" ")}else{return""}},copyAttributes:["fontfamily","fontsize","fontweight","fontstyle","color","background","id","class","href","style"],skipAttributes:{texClass:1,useHeight:1,texprimestyle:1},formatAttr:function(c){if(typeof(c)==="string"&&c.replace(/ /g,"").match(/^(([-+])?(\d+(\.\d*)?|\.\d+))mu$/)){return((1/18)*RegExp.$1).toFixed(3).replace(/\.?0+$/,"")+"em"}if(c==="-tex-caligraphic"){return"script"}if(c==="-tex-oldstyle"){return"normal"}return this.quoteHTML(c)},quoteHTML:function(e){e=String(e).split("");for(var f=0,d=e.length;f<d;f++){var h=e[f].charCodeAt(0);if(h<32||h>126){e[f]="&#x"+h.toString(16).toUpperCase()+";"}else{var g={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e[f]];if(g){e[f]=g}}}return e.join("")}});a.msubsup.Augment({toMathML:function(h){var e=this.type;if(this.data[this.sup]==null){e="msub"}if(this.data[this.sub]==null){e="msup"}var d=this.MathMLattributes();delete this.data[0].inferred;var g=[];for(var f=0,c=this.data.length;f<c;f++){if(this.data[f]){g.push(this.data[f].toMathML(h+" "))}}return h+"<"+e+d+">\n"+g.join("\n")+"\n"+h+"</"+e+">"}});a.munderover.Augment({toMathML:function(h){var e=this.type;if(this.data[this.under]==null){e="mover"}if(this.data[this.over]==null){e="munder"}var d=this.MathMLattributes();delete this.data[0].inferred;var g=[];for(var f=0,c=this.data.length;f<c;f++){if(this.data[f]){g.push(this.data[f].toMathML(h+" "))}}return h+"<"+e+d+">\n"+g.join("\n")+"\n"+h+"</"+e+">"}});a.TeXAtom.Augment({toMathML:function(c){return c+"<mrow>\n"+this.data[0].toMathML(c+" ")+"\n"+c+"</mrow>"}});a.chars.Augment({toMathML:function(c){return(c||"")+this.quoteHTML(this.toString())}});a.entity.Augment({toMathML:function(c){return(c||"")+"&"+this.data[0]+";<!-- "+this.toString()+" -->"}});a.xml.Augment({toMathML:function(c){return(c||"")+this.toString()}});MathJax.Hub.Register.StartupHook("TeX mathchoice Ready",function(){a.TeXmathchoice.Augment({toMathML:function(c){return this.Core().toMathML(c)}})});MathJax.Hub.Startup.signal.Post("toMathML Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/toMathML.js"); MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function(){var b="1.1.3";var a=MathJax.ElementJax.mml;a.mbase.Augment({toMathML:function(k){var g=(this.inferred&&this.parent.inferRow);if(k==null){k=""}var e=this.type,d=this.MathMLattributes();if(e==="mspace"){return k+"<"+e+d+" />"}var j=[];var h=(this.isToken?"":k+(g?"":" "));for(var f=0,c=this.data.length;f<c;f++){if(this.data[f]){j.push(this.data[f].toMathML(h))}else{if(!this.isToken){j.push(h+"<mrow />")}}}if(this.isToken){return k+"<"+e+d+">"+j.join("")+"</"+e+">"}if(g){return j.join("\n")}if(j.length===0||(j.length===1&&j[0]==="")){return k+"<"+e+d+" />"}return k+"<"+e+d+">\n"+j.join("\n")+"\n"+k+"</"+e+">"},MathMLattributes:function(){var j=[],g=this.defaults;var c=(this.mmlAttributes||this.copyAttributes),l=this.skipAttributes;if(this.type==="math"){j.push('xmlns="http://www.w3.org/1998/Math/MathML"')}if(!this.mmlAttributes){if(this.type==="mstyle"){g=a.math.prototype.defaults}for(var d in g){if(!l[d]&&g.hasOwnProperty(d)){var e=(d==="open"||d==="close");if(this[d]!=null&&(e||this[d]!==g[d])){var k=this[d];delete this[d];if(e||this.Get(d)!==k){j.push(d+'="'+this.formatAttr(k)+'"')}this[d]=k}}}}for(var h=0,f=c.length;h<f;h++){if(this[c[h]]!=null){j.push(c[h]+'="'+this.quoteHTML(this[c[h]])+'"')}}if(j.length){return" "+j.join(" ")}else{return""}},copyAttributes:["fontfamily","fontsize","fontweight","fontstyle","color","background","id","class","href","style"],skipAttributes:{texClass:1,useHeight:1,texprimestyle:1},formatAttr:function(c){if(typeof(c)==="string"&&c.replace(/ /g,"").match(/^(([-+])?(\d+(\.\d*)?|\.\d+))mu$/)){return((1/18)*RegExp.$1).toFixed(3).replace(/\.?0+$/,"")+"em"}else{if(c==="-tex-caligraphic"){return"script"}else{if(c==="-tex-oldstyle"){return"normal"}else{if(c==="-tex-mathit"){return"italic"}}}}return this.quoteHTML(c)},quoteHTML:function(e){e=String(e).split("");for(var f=0,d=e.length;f<d;f++){var h=e[f].charCodeAt(0);if(h<32||h>126){e[f]="&#x"+h.toString(16).toUpperCase()+";"}else{var g={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[e[f]];if(g){e[f]=g}}}return e.join("")}});a.msubsup.Augment({toMathML:function(h){var e=this.type;if(this.data[this.sup]==null){e="msub"}if(this.data[this.sub]==null){e="msup"}var d=this.MathMLattributes();delete this.data[0].inferred;var g=[];for(var f=0,c=this.data.length;f<c;f++){if(this.data[f]){g.push(this.data[f].toMathML(h+" "))}}return h+"<"+e+d+">\n"+g.join("\n")+"\n"+h+"</"+e+">"}});a.munderover.Augment({toMathML:function(h){var e=this.type;if(this.data[this.under]==null){e="mover"}if(this.data[this.over]==null){e="munder"}var d=this.MathMLattributes();delete this.data[0].inferred;var g=[];for(var f=0,c=this.data.length;f<c;f++){if(this.data[f]){g.push(this.data[f].toMathML(h+" "))}}return h+"<"+e+d+">\n"+g.join("\n")+"\n"+h+"</"+e+">"}});a.TeXAtom.Augment({toMathML:function(c){return c+"<mrow>\n"+this.data[0].toMathML(c+" ")+"\n"+c+"</mrow>"}});a.chars.Augment({toMathML:function(c){return(c||"")+this.quoteHTML(this.toString())}});a.entity.Augment({toMathML:function(c){return(c||"")+"&"+this.data[0]+";<!-- "+this.toString()+" -->"}});a.xml.Augment({toMathML:function(c){return(c||"")+this.toString()}});MathJax.Hub.Register.StartupHook("TeX mathchoice Ready",function(){a.TeXmathchoice.Augment({toMathML:function(c){return this.Core().toMathML(c)}})});MathJax.Hub.Startup.signal.Post("toMathML Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/toMathML.js");

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2294,9 +2294,15 @@ MathJax.Hub.Startup = {
browser.noContextMenu = browser.isMobile; browser.noContextMenu = browser.isMobile;
}, },
Firefox: function (browser) { Firefox: function (browser) {
if (browser.version === "0.0" && navigator.product === "Gecko" && navigator.productSub) { if ((browser.version === "0.0" || navigator.userAgent.match(/Firefox/) == null) &&
navigator.product === "Gecko" && navigator.productSub) {
var date = navigator.productSub.substr(0,8); var date = navigator.productSub.substr(0,8);
if (date >= "20090630") {browser.version = "3.5"} if (date >= "20110927") {browser.version = "7.0"}
else if (date >= "20110816") {browser.version = "6.0"}
else if (date >= "20110621") {browser.version = "5.0"}
else if (date >= "20110320") {browser.version = "4.0"}
else if (date >= "20100121") {browser.version = "3.6"}
else if (date >= "20090630") {browser.version = "3.5"}
else if (date >= "20080617") {browser.version = "3.0"} else if (date >= "20080617") {browser.version = "3.0"}
else if (date >= "20061024") {browser.version = "2.0"} else if (date >= "20061024") {browser.version = "2.0"}
} }

View File

@ -82,8 +82,9 @@ MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () {
return ((1/18)*RegExp.$1).toFixed(3).replace(/\.?0+$/,"")+"em"; return ((1/18)*RegExp.$1).toFixed(3).replace(/\.?0+$/,"")+"em";
} }
// FIXME: set classes for these? // FIXME: set classes for these?
if (value === "-tex-caligraphic") {return "script"} else if (value === "-tex-caligraphic") {return "script"}
if (value === "-tex-oldstyle") {return "normal"} else if (value === "-tex-oldstyle") {return "normal"}
else if (value === "-tex-mathit") {return "italic"}
return this.quoteHTML(value); return this.quoteHTML(value);
}, },

View File

@ -649,7 +649,7 @@
mit: ['SetFont',MML.VARIANT.ITALIC], mit: ['SetFont',MML.VARIANT.ITALIC],
oldstyle: ['SetFont',MML.VARIANT.OLDSTYLE], oldstyle: ['SetFont',MML.VARIANT.OLDSTYLE],
cal: ['SetFont',MML.VARIANT.CALIGRAPHIC], cal: ['SetFont',MML.VARIANT.CALIGRAPHIC],
it: ['SetFont',MML.VARIANT.ITALIC], // may need special handling it: ['SetFont',"-tex-mathit"], // needs special handling
bf: ['SetFont',MML.VARIANT.BOLD], bf: ['SetFont',MML.VARIANT.BOLD],
bbFont: ['SetFont',MML.VARIANT.DOUBLESTRUCK], bbFont: ['SetFont',MML.VARIANT.DOUBLESTRUCK],
scr: ['SetFont',MML.VARIANT.SCRIPT], scr: ['SetFont',MML.VARIANT.SCRIPT],

View File

@ -91,6 +91,7 @@
remap: {0xE262: 0xE265, 0xE263: 0xE269, 0xE264: 0xE26D, 0xE265: 0xE271, remap: {0xE262: 0xE265, 0xE263: 0xE269, 0xE264: 0xE26D, 0xE265: 0xE271,
0xE266: 0xE275, 0xE267: 0xE279, 0xE268: 0xE27D, 0xE269: 0xE281, 0xE266: 0xE275, 0xE267: 0xE279, 0xE268: 0xE27D, 0xE269: 0xE281,
0xE26A: 0xE285}}, 0xE26A: 0xE285}},
"-tex-mathit": {fonts: [ITALIC,"STIXNonUnicode-italic",GENERAL,NONUNI,SIZE1], italic:true, noIC:true},
"-largeOp": {fonts:[SIZE1,"STIXIntegralsD",NONUNI,GENERAL]}, "-largeOp": {fonts:[SIZE1,"STIXIntegralsD",NONUNI,GENERAL]},
"-smallOp": {} "-smallOp": {}
}, },

View File

@ -97,6 +97,10 @@
"monospace": {fonts:["MathJax_Typewriter",MAIN,SIZE1,AMS]}, "monospace": {fonts:["MathJax_Typewriter",MAIN,SIZE1,AMS]},
"-tex-caligraphic": {fonts:["MathJax_Caligraphic",MAIN], offsetA: 0x41, variantA: "italic"}, "-tex-caligraphic": {fonts:["MathJax_Caligraphic",MAIN], offsetA: 0x41, variantA: "italic"},
"-tex-oldstyle": {fonts:["MathJax_Caligraphic",MAIN]}, "-tex-oldstyle": {fonts:["MathJax_Caligraphic",MAIN]},
"-tex-mathit": {fonts:["MathJax_Main-italic",ITALIC,MAIN,SIZE1,AMS], italic:true, noIC: true,
remap: {0x391:0x41, 0x392:0x42, 0x395:0x45, 0x396:0x5A, 0x397:0x48,
0x399:0x49, 0x39A:0x4B, 0x39C:0x4D, 0x39D:0x4E, 0x39F:0x4F,
0x3A1:0x50, 0x3A4:0x54, 0x3A7:0x58}},
"-largeOp": {fonts:[SIZE2,SIZE1,MAIN]}, "-largeOp": {fonts:[SIZE2,SIZE1,MAIN]},
"-smallOp": {fonts:[SIZE1,MAIN]} "-smallOp": {fonts:[SIZE1,MAIN]}
}, },
@ -250,11 +254,11 @@
}, },
0x02C6: // wide hat 0x02C6: // wide hat
{ {
dir: H, HW: [[.267+.05,MAIN],[.567+.05,SIZE1],[1.005+.05,SIZE2],[1.447+.1,SIZE3],[1.909+.1,SIZE4]] dir: H, HW: [[.267+.25,MAIN],[.567+.25,SIZE1],[1.005+.33,SIZE2],[1.447+.33,SIZE3],[1.909,SIZE4]]
}, },
0x02DC: // wide tilde 0x02DC: // wide tilde
{ {
dir: H, HW: [[.333,MAIN],[.555+.05,SIZE1],[1+.05,SIZE2],[1.443+.1,SIZE3],[1.887+.1,SIZE4]] dir: H, HW: [[.333+.25,MAIN],[.555+.25,SIZE1],[1+.33,SIZE2],[1.443+.33,SIZE3],[1.887,SIZE4]]
}, },
0x2016: // vertical arrow extension 0x2016: // vertical arrow extension
{ {
@ -1466,6 +1470,12 @@
HTMLCSS.FONTDATA.FONTS['MathJax_Size4'][0xE154][1] += 200; // adjust depth for brace extender HTMLCSS.FONTDATA.FONTS['MathJax_Size4'][0xE154][1] += 200; // adjust depth for brace extender
HTMLCSS.FONTDATA.FONTS['MathJax_Main'][0x2212][1] += 100; // adjust depth of minus (used as arrow extender) HTMLCSS.FONTDATA.FONTS['MathJax_Main'][0x2212][1] += 100; // adjust depth of minus (used as arrow extender)
HTMLCSS.FONTDATA.FONTS['MathJax_Main'][0x003D][1] += 100; // adjust depth of = (used as arrow extender) HTMLCSS.FONTDATA.FONTS['MathJax_Main'][0x003D][1] += 100; // adjust depth of = (used as arrow extender)
HTMLCSS.FONTDATA.FONTS['MathJax_Main'][0x2245][2] -= 222; // fix error in character's right bearing
HTMLCSS.FONTDATA.FONTS['MathJax_Main'][0x2245][5] = {rfix:-222}; // fix error in character's right bearing
MathJax.Hub.Register.LoadHook(HTMLCSS.fontDir+"/Main/Bold/MathOperators.js",function () {
HTMLCSS.FONTDATA.FONTS['MathJax_Main-bold'][0x2245][2] -= 106; // fix error in character's right bearing
HTMLCSS.FONTDATA.FONTS['MathJax_Main-bold'][0x2245][5] = {rfix:-106}; // fix error in character's right bearing
});
if (!HTMLCSS.imgFonts) { if (!HTMLCSS.imgFonts) {
MathJax.Hub.Browser.Select({ MathJax.Hub.Browser.Select({

View File

@ -1295,6 +1295,7 @@
if (n <= 0xFFFF) {C.c = String.fromCharCode(n)} if (n <= 0xFFFF) {C.c = String.fromCharCode(n)}
else {C.c = this.PLANE1 + String.fromCharCode(n-0x1D400+0xDC00)} else {C.c = this.PLANE1 + String.fromCharCode(n-0x1D400+0xDC00)}
} }
if (C.rfix) {this.addText(span,C.c); HTMLCSS.createShift(span,C.rfix/1000); return ""}
if (c[2] || !this.msieAccentBug || text.length) {return text + C.c} if (c[2] || !this.msieAccentBug || text.length) {return text + C.c}
// Handle IE accent clipping bug // Handle IE accent clipping bug
HTMLCSS.createShift(span,c[3]/1000); HTMLCSS.createShift(span,c[3]/1000);
@ -1806,7 +1807,7 @@
if (!span.bbox) {span.bbox = {w:0, h:0, d:0, rw:0, lw:0}} if (!span.bbox) {span.bbox = {w:0, h:0, d:0, rw:0, lw:0}}
var text = this.data.join(""), bbox = span.bbox; var text = this.data.join(""), bbox = span.bbox;
if (bbox.skew && text.length !== 1) {delete bbox.skew} if (bbox.skew && text.length !== 1) {delete bbox.skew}
if (bbox.rw > bbox.w && text.length === 1) { if (bbox.rw > bbox.w && text.length === 1 && !variant.noIC) {
bbox.ic = bbox.rw - bbox.w; bbox.ic = bbox.rw - bbox.w;
HTMLCSS.createBlank(span,bbox.ic); HTMLCSS.createBlank(span,bbox.ic);
bbox.w = bbox.rw; bbox.w = bbox.rw;

View File

@ -374,6 +374,7 @@
{value = ((1/18)*RegExp.$1).toFixed(3).replace(/\.?0+$/,"")+"em"} // FIXME: should take scriptlevel into account {value = ((1/18)*RegExp.$1).toFixed(3).replace(/\.?0+$/,"")+"em"} // FIXME: should take scriptlevel into account
else if (value === "-tex-caligraphic") {value = "script"} // FIXME: add a class? else if (value === "-tex-caligraphic") {value = "script"} // FIXME: add a class?
else if (value === "-tex-oldstyle") {value = "normal"} // FIXME: add a class? else if (value === "-tex-oldstyle") {value = "normal"} // FIXME: add a class?
else if (value === "-tex-mathit") {value = "italic"} // FIXME: add a class?
return value; return value;
}, },
// //