When MathML with MJX classes come from TeX extensions, load the required extension so that the fonts will be properly set up

This commit is contained in:
Davide P. Cervone 2012-01-11 17:53:05 -05:00
parent fe40630d43
commit 88e3ce4680
12 changed files with 39 additions and 25 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

File diff suppressed because one or more lines are too long

View File

@ -339,10 +339,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
}
});
// if (MathJax.Hub.Browser.isMSIE) {
// MathJax.InputJax.TeX.Definitions.mathchar0mi.digamma = ['03DD',{variantForm: true}];
// MathJax.InputJax.TeX.Definitions.mathchar0mi.varkappa = ['03F0',{variantForm: true}];
// }
aMathJax.Hub.Startup.signal.Post("TeX AMSsymbols Ready");
});
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
@ -385,9 +383,6 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
});
}
MathJax.Hub.Startup.signal.Post("TeX AMSsymbols Ready");
});
MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/AMSsymbols.js");

View File

@ -90,9 +90,28 @@
CLASS = CLASS.split(/ /); var NCLASS = [];
for (var i = 0, m = CLASS.length; i < m; i++) {
if (CLASS[i].substr(0,4) === "MJX-") {
if (CLASS[i] === "MJX-arrow") {mml.arrow = true}
else if (CLASS[i] === "MJX-variant") {mml.variantForm = "true"}
else if (CLASS[i].substr(0,11) !== "MJX-TeXAtom") {mml.mathvariant = CLASS[i].substr(3)}
if (CLASS[i] === "MJX-arrow") {
mml.arrow = true;
} else if (CLASS[i] === "MJX-variant") {
mml.variantForm = true;
//
// Variant forms come from AMSsymbols, and it sets up the
// character mappings, so load that if needed.
//
if (!MathJax.Extension["TeX/AMSsymbols"])
{MathJax.Hub.RestartAfter(MathJax.Ajax.Require("[MathJax]/extensions/TeX/AMSsymbols.js"))}
} else if (CLASS[i].substr(0,11) !== "MJX-TeXAtom") {
mml.mathvariant = CLASS[i].substr(3);
//
// Caligraphic and oldstyle bold are set up in the boldsymbol
// extension, so load it if it isn't already loaded.
//
if (mml.mathvariant === "-tex-caligraphic-bold" ||
mml.mathvariant === "-tex-oldstyle-bold") {
if (!MathJax.Extension["TeX/boldsymbol"])
{MathJax.Hub.RestartAfter(MathJax.Ajax.Require("[MathJax]/extensions/TeX/boldsymbol.js"))}
}
}
} else {NCLASS.push(CLASS[i])}
}
if (NCLASS.length) {mml["class"] = NCLASS.join(" ")} else {delete mml["class"]}