mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update bundled MathJax to 2.6.1
This commit is contained in:
parent
1909f68979
commit
ebc247a020
@ -45,9 +45,9 @@ if (window.MathJax) {window.MathJax = {AuthorConfig: window.MathJax}}
|
|||||||
|
|
||||||
// MathJax.isPacked = true; // This line is uncommented by the packer.
|
// MathJax.isPacked = true; // This line is uncommented by the packer.
|
||||||
|
|
||||||
MathJax.version = "2.6.0";
|
MathJax.version = "2.6.1";
|
||||||
MathJax.fileversion = "2.6.0";
|
MathJax.fileversion = "2.6.1";
|
||||||
MathJax.cdnVersion = "2.6.0"; // specifies a revision to break caching
|
MathJax.cdnVersion = "2.6.1"; // specifies a revision to break caching
|
||||||
MathJax.cdnFileVersions = {}; // can be used to specify revisions for individual files
|
MathJax.cdnFileVersions = {}; // can be used to specify revisions for individual files
|
||||||
|
|
||||||
/**********************************************************/
|
/**********************************************************/
|
||||||
@ -1889,13 +1889,16 @@ MathJax.Hub = {
|
|||||||
Shift: false, // require Shift?
|
Shift: false, // require Shift?
|
||||||
discoverable: false, // make math menu discoverable on hover?
|
discoverable: false, // make math menu discoverable on hover?
|
||||||
zscale: "200%", // the scaling factor for MathZoom
|
zscale: "200%", // the scaling factor for MathZoom
|
||||||
renderer: "", // set when Jax are loaded
|
renderer: null, // set when Jax are loaded
|
||||||
font: "Auto", // what font HTML-CSS should use
|
font: "Auto", // what font HTML-CSS should use
|
||||||
context: "MathJax", // or "Browser" for pass-through to browser menu
|
context: "MathJax", // or "Browser" for pass-through to browser menu
|
||||||
locale: "en", // the language to use for messages
|
locale: null, // the language to use for messages
|
||||||
mpContext: false, // true means pass menu events to MathPlayer in IE
|
mpContext: false, // true means pass menu events to MathPlayer in IE
|
||||||
mpMouse: false, // true means pass mouse events to MathPlayer in IE
|
mpMouse: false, // true means pass mouse events to MathPlayer in IE
|
||||||
texHints: true, // include class names for TeXAtom elements
|
texHints: true, // include class names for TeXAtom elements
|
||||||
|
FastPreview: null, // use PreviewHTML output as preview?
|
||||||
|
assistiveMML: null, // include hidden MathML for screen readers?
|
||||||
|
inTabOrder: true, // set to false if math elements should be included in the tabindex
|
||||||
semantics: false // add semantics tag with original form in MathML output
|
semantics: false // add semantics tag with original form in MathML output
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -2126,6 +2129,7 @@ MathJax.Hub = {
|
|||||||
if (script.MathJax.state !== STATE.PENDING) {this.scriptAction[action](script)}
|
if (script.MathJax.state !== STATE.PENDING) {this.scriptAction[action](script)}
|
||||||
}
|
}
|
||||||
if (!script.MathJax) {script.MathJax = {state: STATE.PENDING}}
|
if (!script.MathJax) {script.MathJax = {state: STATE.PENDING}}
|
||||||
|
if (script.MathJax.error) delete script.MathJax.error;
|
||||||
if (script.MathJax.state !== STATE.PROCESSED) {state.scripts.push(script)}
|
if (script.MathJax.state !== STATE.PROCESSED) {state.scripts.push(script)}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2349,7 +2353,8 @@ MathJax.Hub = {
|
|||||||
if (err.line||err.lineNumber) message += "\n"+LOCALIZE("ErrorLine","line: %1",err.line||err.lineNumber);
|
if (err.line||err.lineNumber) message += "\n"+LOCALIZE("ErrorLine","line: %1",err.line||err.lineNumber);
|
||||||
message += "\n\n"+LOCALIZE("ErrorTips","Debugging tips: use %1, inspect %2 in the browser console","'unpacked/MathJax.js'","'MathJax.Hub.lastError'");
|
message += "\n\n"+LOCALIZE("ErrorTips","Debugging tips: use %1, inspect %2 in the browser console","'unpacked/MathJax.js'","'MathJax.Hub.lastError'");
|
||||||
script.MathJax.error = MathJax.OutputJax.Error.Jax(message,script);
|
script.MathJax.error = MathJax.OutputJax.Error.Jax(message,script);
|
||||||
|
if (script.MathJax.elementJax)
|
||||||
|
script.MathJax.error.inputID = script.MathJax.elementJax.inputID;
|
||||||
//
|
//
|
||||||
// Create the [Math Processing Error] span
|
// Create the [Math Processing Error] span
|
||||||
//
|
//
|
||||||
@ -2358,28 +2363,23 @@ MathJax.Hub = {
|
|||||||
var error = MathJax.HTML.Element("span", {
|
var error = MathJax.HTML.Element("span", {
|
||||||
className:"MathJax_Error", jaxID:"Error", isMathJax:true,
|
className:"MathJax_Error", jaxID:"Error", isMathJax:true,
|
||||||
id: script.MathJax.error.inputID+"-Frame"
|
id: script.MathJax.error.inputID+"-Frame"
|
||||||
},errorText);
|
},[["span",null,errorText]]);
|
||||||
//
|
//
|
||||||
// Attach the menu events
|
// Attach the menu events
|
||||||
//
|
//
|
||||||
if (MathJax.Extension.MathEvents) {
|
MathJax.Ajax.Require("[MathJax]/extensions/MathEvents.js",function () {
|
||||||
var EVENT = MathJax.Extension.MathEvents.Event;
|
var EVENT = MathJax.Extension.MathEvents.Event,
|
||||||
|
HUB = MathJax.Hub;
|
||||||
error.oncontextmenu = EVENT.Menu;
|
error.oncontextmenu = EVENT.Menu;
|
||||||
error.onmousedown = EVENT.Mousedown;
|
error.onmousedown = EVENT.Mousedown;
|
||||||
error.onkeydown = EVENT.Keydown;
|
error.onkeydown = EVENT.Keydown;
|
||||||
error.tabIndex = 0;
|
error.tabIndex = HUB.getTabOrder(HUB.getJaxFor(script));
|
||||||
} else {
|
|
||||||
MathJax.Ajax.Require("[MathJax]/extensions/MathEvents.js",function () {
|
|
||||||
var EVENT = MathJax.Extension.MathEvents.Event;
|
|
||||||
error.oncontextmenu = EVENT.Menu;
|
|
||||||
error.onmousedown = EVENT.Mousedown;
|
|
||||||
error.keydown = EVENT.Keydown;
|
|
||||||
error.tabIndex = 0;
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
//
|
//
|
||||||
// Insert the error into the page and remove any preview
|
// Insert the error into the page and remove any preview
|
||||||
//
|
//
|
||||||
|
var node = document.getElementById(error.id);
|
||||||
|
if (node) node.parentNode.removeChild(node);
|
||||||
script.parentNode.insertBefore(error,script);
|
script.parentNode.insertBefore(error,script);
|
||||||
if (script.MathJax.preview) {script.MathJax.preview.innerHTML = ""}
|
if (script.MathJax.preview) {script.MathJax.preview.innerHTML = ""}
|
||||||
//
|
//
|
||||||
@ -2462,6 +2462,10 @@ MathJax.Hub = {
|
|||||||
return dst;
|
return dst;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getTabOrder: function(script) {
|
||||||
|
return this.config.menuSettings.inTabOrder ? 0 : -1;
|
||||||
|
},
|
||||||
|
|
||||||
// Old browsers (e.g. Internet Explorer <= 8) do not support trim().
|
// Old browsers (e.g. Internet Explorer <= 8) do not support trim().
|
||||||
SplitList: ("trim" in String.prototype ?
|
SplitList: ("trim" in String.prototype ?
|
||||||
function (list) {return list.trim().split(/\s+/)} :
|
function (list) {return list.trim().split(/\s+/)} :
|
||||||
|
@ -29,9 +29,9 @@
|
|||||||
var SETTINGS = HUB.config.menuSettings;
|
var SETTINGS = HUB.config.menuSettings;
|
||||||
|
|
||||||
var AssistiveMML = MathJax.Extension["AssistiveMML"] = {
|
var AssistiveMML = MathJax.Extension["AssistiveMML"] = {
|
||||||
version: "2.6.0",
|
version: "2.6.1",
|
||||||
|
|
||||||
config: {
|
config: HUB.CombineConfig("AssistiveMML",{
|
||||||
disabled: false,
|
disabled: false,
|
||||||
styles: {
|
styles: {
|
||||||
".MJX_Assistive_MathML": {
|
".MJX_Assistive_MathML": {
|
||||||
@ -44,13 +44,22 @@
|
|||||||
height: "1px!important",
|
height: "1px!important",
|
||||||
width: "1px!important",
|
width: "1px!important",
|
||||||
overflow: "hidden!important",
|
overflow: "hidden!important",
|
||||||
display:"block!important"
|
display:"block!important",
|
||||||
|
//
|
||||||
|
// Don't allow the assistive MathML become part of the selection
|
||||||
|
//
|
||||||
|
"-webkit-touch-callout": "none",
|
||||||
|
"-webkit-user-select": "none",
|
||||||
|
"-khtml-user-select": "none",
|
||||||
|
"-moz-user-select": "none",
|
||||||
|
"-ms-user-select": "none",
|
||||||
|
"user-select": "none"
|
||||||
},
|
},
|
||||||
".MJX_Assistive_MathML.MJX_Assistive_MathML_Block": {
|
".MJX_Assistive_MathML.MJX_Assistive_MathML_Block": {
|
||||||
width: "100%!important"
|
width: "100%!important"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}),
|
||||||
|
|
||||||
Config: function () {
|
Config: function () {
|
||||||
if (!this.config.disabled && SETTINGS.assistiveMML == null)
|
if (!this.config.disabled && SETTINGS.assistiveMML == null)
|
||||||
@ -115,7 +124,7 @@
|
|||||||
}
|
}
|
||||||
frame.setAttribute("data-mathml",mml);
|
frame.setAttribute("data-mathml",mml);
|
||||||
span = HTML.addElement(frame,"span",{
|
span = HTML.addElement(frame,"span",{
|
||||||
isMathJax: true,
|
isMathJax: true, unselectable: "on",
|
||||||
className: "MJX_Assistive_MathML"
|
className: "MJX_Assistive_MathML"
|
||||||
+ (jax.root.Get("display") === "block" ? " MJX_Assistive_MathML_Block" : "")
|
+ (jax.root.Get("display") === "block" ? " MJX_Assistive_MathML_Block" : "")
|
||||||
});
|
});
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
(function (HUB,HTML,AJAX,CALLBACK,OUTPUT) {
|
(function (HUB,HTML,AJAX,CALLBACK,OUTPUT) {
|
||||||
var VERSION = "2.6.0";
|
var VERSION = "2.6.1";
|
||||||
|
|
||||||
var SIGNAL = MathJax.Callback.Signal("menu"); // signal for menu events
|
var SIGNAL = MathJax.Callback.Signal("menu"); // signal for menu events
|
||||||
|
|
||||||
@ -544,18 +544,12 @@
|
|||||||
MENU.FocusNode(menu);
|
MENU.FocusNode(menu);
|
||||||
},
|
},
|
||||||
Activate: function(event, menu) {
|
Activate: function(event, menu) {
|
||||||
var jaxs = MENU.AllNodes();
|
MENU.UnsetTabIndex();
|
||||||
for (var j = 0, jax; jax = jaxs[j]; j++) {
|
|
||||||
jax.tabIndex = -1;
|
|
||||||
}
|
|
||||||
MENU.posted = true;
|
MENU.posted = true;
|
||||||
},
|
},
|
||||||
Unfocus: function() {
|
Unfocus: function() {
|
||||||
MENU.ActiveNode().tabIndex = -1;
|
MENU.ActiveNode().tabIndex = -1;
|
||||||
var jaxs = MENU.AllNodes();
|
MENU.SetTabIndex();
|
||||||
for (var j = 0, jax; jax = jaxs[j]; j++) {
|
|
||||||
jax.tabIndex = 0;
|
|
||||||
}
|
|
||||||
MENU.FocusNode(MENU.CurrentNode());
|
MENU.FocusNode(MENU.CurrentNode());
|
||||||
MENU.posted = false;
|
MENU.posted = false;
|
||||||
},
|
},
|
||||||
@ -577,6 +571,26 @@
|
|||||||
Left: function(event, menu) {
|
Left: function(event, menu) {
|
||||||
MENU.MoveHorizontal(event, menu, function(x) {return x - 1;});
|
MENU.MoveHorizontal(event, menu, function(x) {return x - 1;});
|
||||||
},
|
},
|
||||||
|
UnsetTabIndex: function () {
|
||||||
|
var jaxs = MENU.AllNodes();
|
||||||
|
for (var j = 0, jax; jax = jaxs[j]; j++) {
|
||||||
|
if (jax.tabIndex > 0) {
|
||||||
|
jax.oldTabIndex = jax.tabIndex;
|
||||||
|
}
|
||||||
|
jax.tabIndex = -1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
SetTabIndex: function () {
|
||||||
|
var jaxs = MENU.AllNodes();
|
||||||
|
for (var j = 0, jax; jax = jaxs[j]; j++) {
|
||||||
|
if (jax.oldTabIndex !== undefined) {
|
||||||
|
jax.tabIndex = jax.oldTabIndex
|
||||||
|
delete jax.oldTabIndex;
|
||||||
|
} else {
|
||||||
|
jax.tabIndex = HUB.getTabOrder(jax);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
//TODO: Move to utility class.
|
//TODO: Move to utility class.
|
||||||
// Computes a mod n.
|
// Computes a mod n.
|
||||||
@ -1328,6 +1342,9 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Toggle assistive MML settings
|
||||||
|
*/
|
||||||
MENU.AssistiveMML = function (item,restart) {
|
MENU.AssistiveMML = function (item,restart) {
|
||||||
var AMML = MathJax.Extension.AssistiveMML;
|
var AMML = MathJax.Extension.AssistiveMML;
|
||||||
if (!AMML) {
|
if (!AMML) {
|
||||||
@ -1526,15 +1543,16 @@
|
|||||||
),
|
),
|
||||||
ITEM.RULE(),
|
ITEM.RULE(),
|
||||||
ITEM.SUBMENU(["Renderer","Math Renderer"], {hidden:!CONFIG.showRenderer},
|
ITEM.SUBMENU(["Renderer","Math Renderer"], {hidden:!CONFIG.showRenderer},
|
||||||
ITEM.RADIO("HTML-CSS", "renderer", {action: MENU.Renderer}),
|
ITEM.RADIO(["HTML-CSS","HTML-CSS"], "renderer", {action: MENU.Renderer}),
|
||||||
ITEM.RADIO("Common HTML","renderer", {action: MENU.Renderer, value:"CommonHTML"}),
|
ITEM.RADIO(["CommonHTML","Common HTML"], "renderer", {action: MENU.Renderer, value:"CommonHTML"}),
|
||||||
ITEM.RADIO("Fast HTML", "renderer", {action: MENU.Renderer, value:"PreviewHTML"}),
|
ITEM.RADIO(["PreviewHTML","Preview HTML"],"renderer", {action: MENU.Renderer, value:"PreviewHTML"}),
|
||||||
ITEM.RADIO("MathML", "renderer", {action: MENU.Renderer, value:"NativeMML"}),
|
ITEM.RADIO(["MathML","MathML"], "renderer", {action: MENU.Renderer, value:"NativeMML"}),
|
||||||
ITEM.RADIO("SVG", "renderer", {action: MENU.Renderer}),
|
ITEM.RADIO(["SVG","SVG"], "renderer", {action: MENU.Renderer}),
|
||||||
ITEM.RADIO("PlainSource","renderer", {action: MENU.Renderer, value:"PlainSource"}),
|
ITEM.RADIO(["PlainSource","Plain Source"],"renderer", {action: MENU.Renderer, value:"PlainSource"}),
|
||||||
ITEM.RULE(),
|
ITEM.RULE(),
|
||||||
ITEM.CHECKBOX("Fast Preview", "FastPreview"),
|
ITEM.CHECKBOX(["FastPreview","Fast Preview"], "FastPreview"),
|
||||||
ITEM.CHECKBOX("Assistive MathML", "assistiveMML", {action:MENU.AssistiveMML})
|
ITEM.CHECKBOX(["AssistiveMML","Assistive MathML"], "assistiveMML", {action:MENU.AssistiveMML}),
|
||||||
|
ITEM.CHECKBOX(["InTabOrder","Include in Tab Order"], "inTabOrder")
|
||||||
),
|
),
|
||||||
ITEM.SUBMENU("MathPlayer", {hidden:!HUB.Browser.isMSIE || !CONFIG.showMathPlayer,
|
ITEM.SUBMENU("MathPlayer", {hidden:!HUB.Browser.isMSIE || !CONFIG.showMathPlayer,
|
||||||
disabled:!HUB.Browser.hasMathPlayer},
|
disabled:!HUB.Browser.hasMathPlayer},
|
||||||
@ -1561,7 +1579,7 @@
|
|||||||
ITEM.RADIO(["NeoEulerWeb","Neo Euler (web)"], "font", {action: MENU.Font})
|
ITEM.RADIO(["NeoEulerWeb","Neo Euler (web)"], "font", {action: MENU.Font})
|
||||||
),
|
),
|
||||||
ITEM.SUBMENU(["ContextMenu","Contextual Menu"], {hidden:!CONFIG.showContext},
|
ITEM.SUBMENU(["ContextMenu","Contextual Menu"], {hidden:!CONFIG.showContext},
|
||||||
ITEM.RADIO("MathJax", "context"),
|
ITEM.RADIO(["MathJax","MathJax"], "context"),
|
||||||
ITEM.RADIO(["Browser","Browser"], "context")
|
ITEM.RADIO(["Browser","Browser"], "context")
|
||||||
),
|
),
|
||||||
ITEM.COMMAND(["Scale","Scale All Math ..."],MENU.Scale),
|
ITEM.COMMAND(["Scale","Scale All Math ..."],MENU.Scale),
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
MathJax.Extension["TeX/AMSmath"] = {
|
MathJax.Extension["TeX/AMSmath"] = {
|
||||||
version: "2.6.0",
|
version: "2.6.1",
|
||||||
|
|
||||||
number: 0, // current equation number
|
number: 0, // current equation number
|
||||||
startNumber: 0, // current starting equation number (for when equation is restarted)
|
startNumber: 0, // current starting equation number (for when equation is restarted)
|
||||||
@ -94,8 +94,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||||||
projlim: ['NamedOp','proj lim'],
|
projlim: ['NamedOp','proj lim'],
|
||||||
varliminf: ['Macro','\\mathop{\\underline{\\mmlToken{mi}{lim}}}'],
|
varliminf: ['Macro','\\mathop{\\underline{\\mmlToken{mi}{lim}}}'],
|
||||||
varlimsup: ['Macro','\\mathop{\\overline{\\mmlToken{mi}{lim}}}'],
|
varlimsup: ['Macro','\\mathop{\\overline{\\mmlToken{mi}{lim}}}'],
|
||||||
varinjlim: ['Macro','\\mathop{\\underrightarrow{\\mmlToken{mi}{lim}\\Rule{-1pt}{0pt}{1pt}}\\Rule{0pt}{0pt}{.45em}}'],
|
varinjlim: ['Macro','\\mathop{\\underrightarrow{\\mmlToken{mi}{lim}}}'],
|
||||||
varprojlim: ['Macro','\\mathop{\\underleftarrow{\\mmlToken{mi}{lim}\\Rule{-1pt}{0pt}{1pt}}\\Rule{0pt}{0pt}{.45em}}'],
|
varprojlim: ['Macro','\\mathop{\\underleftarrow{\\mmlToken{mi}{lim}}}'],
|
||||||
|
|
||||||
DeclareMathOperator: 'HandleDeclareOp',
|
DeclareMathOperator: 'HandleDeclareOp',
|
||||||
operatorname: 'HandleOperatorName',
|
operatorname: 'HandleOperatorName',
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () {
|
MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () {
|
||||||
var VERSION = "2.6.0";
|
var VERSION = "2.6.1";
|
||||||
|
|
||||||
var MML = MathJax.ElementJax.mml,
|
var MML = MathJax.ElementJax.mml,
|
||||||
SETTINGS = MathJax.Hub.config.menuSettings;
|
SETTINGS = MathJax.Hub.config.menuSettings;
|
||||||
@ -78,7 +78,10 @@ MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () {
|
|||||||
var CLASS = []; if (this["class"]) {CLASS.push(this["class"])}
|
var CLASS = []; if (this["class"]) {CLASS.push(this["class"])}
|
||||||
if (this.isa(MML.TeXAtom) && SETTINGS.texHints) {
|
if (this.isa(MML.TeXAtom) && SETTINGS.texHints) {
|
||||||
var TEXCLASS = ["ORD","OP","BIN","REL","OPEN","CLOSE","PUNCT","INNER","VCENTER"][this.texClass];
|
var TEXCLASS = ["ORD","OP","BIN","REL","OPEN","CLOSE","PUNCT","INNER","VCENTER"][this.texClass];
|
||||||
if (TEXCLASS) {CLASS.push("MJX-TeXAtom-"+TEXCLASS)}
|
if (TEXCLASS) {
|
||||||
|
CLASS.push("MJX-TeXAtom-"+TEXCLASS)
|
||||||
|
if (TEXCLASS === "OP" && !this.movablelimits) CLASS.push("MJX-fixedlimits");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (this.mathvariant && this.toMathMLvariants[this.mathvariant])
|
if (this.mathvariant && this.toMathMLvariants[this.mathvariant])
|
||||||
{CLASS.push("MJX"+this.mathvariant)}
|
{CLASS.push("MJX"+this.mathvariant)}
|
||||||
@ -186,8 +189,15 @@ MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () {
|
|||||||
MML.munderover.Augment({
|
MML.munderover.Augment({
|
||||||
toMathML: function (space) {
|
toMathML: function (space) {
|
||||||
var tag = this.type;
|
var tag = this.type;
|
||||||
|
var base = this.data[this.base];
|
||||||
|
if (base && base.isa(MML.TeXAtom) && base.movablelimits && !base.Get("displaystyle")) {
|
||||||
|
type = "msubsup";
|
||||||
|
if (this.data[this.under] == null) {tag = "msup"}
|
||||||
|
if (this.data[this.over] == null) {tag = "msub"}
|
||||||
|
} else {
|
||||||
if (this.data[this.under] == null) {tag = "mover"}
|
if (this.data[this.under] == null) {tag = "mover"}
|
||||||
if (this.data[this.over] == null) {tag = "munder"}
|
if (this.data[this.over] == null) {tag = "munder"}
|
||||||
|
}
|
||||||
var attr = this.toMathMLattributes();
|
var attr = this.toMathMLattributes();
|
||||||
delete this.data[0].inferred;
|
delete this.data[0].inferred;
|
||||||
var data = [];
|
var data = [];
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
MathJax.InputJax.MathML = MathJax.InputJax({
|
MathJax.InputJax.MathML = MathJax.InputJax({
|
||||||
id: "MathML",
|
id: "MathML",
|
||||||
version: "2.6.0",
|
version: "2.6.1",
|
||||||
directory: MathJax.InputJax.directory + "/MathML",
|
directory: MathJax.InputJax.directory + "/MathML",
|
||||||
extensionDir: MathJax.InputJax.extensionDir + "/MathML",
|
extensionDir: MathJax.InputJax.extensionDir + "/MathML",
|
||||||
entityDir: MathJax.InputJax.directory + "/MathML/entities",
|
entityDir: MathJax.InputJax.directory + "/MathML/entities",
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
var mml, type = node.nodeName.toLowerCase().replace(/^[a-z]+:/,"");
|
var mml, type = node.nodeName.toLowerCase().replace(/^[a-z]+:/,"");
|
||||||
var match = (CLASS.match(/(^| )MJX-TeXAtom-([^ ]*)/));
|
var match = (CLASS.match(/(^| )MJX-TeXAtom-([^ ]*)/));
|
||||||
if (match) {
|
if (match) {
|
||||||
mml = this.TeXAtom(match[2]);
|
mml = this.TeXAtom(match[2],match[2] === "OP" && !CLASS.match(/MJX-fixedlimits/));
|
||||||
} else if (!(MML[type] && MML[type].isa && MML[type].isa(MML.mbase))) {
|
} else if (!(MML[type] && MML[type].isa && MML[type].isa(MML.mbase))) {
|
||||||
MathJax.Hub.signal.Post(["MathML Jax - unknown node type",type]);
|
MathJax.Hub.signal.Post(["MathML Jax - unknown node type",type]);
|
||||||
return MML.Error(_("UnknownNodeType","Unknown node type: %1",type));
|
return MML.Error(_("UnknownNodeType","Unknown node type: %1",type));
|
||||||
@ -88,9 +88,9 @@
|
|||||||
if (MATHML.config.useMathMLspacing) {mml.useMMLspacing = 0x08}
|
if (MATHML.config.useMathMLspacing) {mml.useMMLspacing = 0x08}
|
||||||
return mml;
|
return mml;
|
||||||
},
|
},
|
||||||
TeXAtom: function (mclass) {
|
TeXAtom: function (mclass,movablelimits) {
|
||||||
var mml = MML.TeXAtom().With({texClass:MML.TEXCLASS[mclass]});
|
var mml = MML.TeXAtom().With({texClass:MML.TEXCLASS[mclass]});
|
||||||
if (mml.texClass === MML.TEXCLASS.OP) {mml.movesupsub = mml.movablelimits = true}
|
if (movablelimits) {mml.movesupsub = mml.movablelimits = true}
|
||||||
return mml;
|
return mml;
|
||||||
},
|
},
|
||||||
CheckClass: function (mml,CLASS) {
|
CheckClass: function (mml,CLASS) {
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
MathJax.InputJax.TeX = MathJax.InputJax({
|
MathJax.InputJax.TeX = MathJax.InputJax({
|
||||||
id: "TeX",
|
id: "TeX",
|
||||||
version: "2.6.0",
|
version: "2.6.1",
|
||||||
directory: MathJax.InputJax.directory + "/TeX",
|
directory: MathJax.InputJax.directory + "/TeX",
|
||||||
extensionDir: MathJax.InputJax.extensionDir + "/TeX",
|
extensionDir: MathJax.InputJax.extensionDir + "/TeX",
|
||||||
|
|
||||||
|
@ -1264,6 +1264,8 @@
|
|||||||
{if (mo.defaults.hasOwnProperty(id) && mi[id] != null) {mo[id] = mi[id]}}
|
{if (mo.defaults.hasOwnProperty(id) && mi[id] != null) {mo[id] = mi[id]}}
|
||||||
for (id in MML.copyAttributes)
|
for (id in MML.copyAttributes)
|
||||||
{if (MML.copyAttributes.hasOwnProperty(id) && mi[id] != null) {mo[id] = mi[id]}}
|
{if (MML.copyAttributes.hasOwnProperty(id) && mi[id] != null) {mo[id] = mi[id]}}
|
||||||
|
mo.lspace = mo.rspace = "0"; // prevent mo from having space in NativeMML
|
||||||
|
mo.useMMLspacing &= ~(mo.SPACE_ATTR.lspace | mo.SPACE_ATTR.rspace); // don't count these explicit settings
|
||||||
return mo;
|
return mo;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1367,6 +1369,7 @@
|
|||||||
}
|
}
|
||||||
op.movesupsub = (limits ? true : false);
|
op.movesupsub = (limits ? true : false);
|
||||||
op.Core().movablelimits = false;
|
op.Core().movablelimits = false;
|
||||||
|
if (op.movablelimits) op.movablelimits = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
Over: function (name,open,close) {
|
Over: function (name,open,close) {
|
||||||
@ -1452,10 +1455,12 @@
|
|||||||
|
|
||||||
Overset: function (name) {
|
Overset: function (name) {
|
||||||
var top = this.ParseArg(name), base = this.ParseArg(name);
|
var top = this.ParseArg(name), base = this.ParseArg(name);
|
||||||
|
if (base.movablelimits) base.movablelimits = false;
|
||||||
this.Push(MML.mover(base,top));
|
this.Push(MML.mover(base,top));
|
||||||
},
|
},
|
||||||
Underset: function (name) {
|
Underset: function (name) {
|
||||||
var bot = this.ParseArg(name), base = this.ParseArg(name);
|
var bot = this.ParseArg(name), base = this.ParseArg(name);
|
||||||
|
if (base.movablelimits) base.movablelimits = false;
|
||||||
this.Push(MML.munder(base,bot));
|
this.Push(MML.munder(base,bot));
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -2021,7 +2026,6 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Break up a string into text and math blocks
|
* Break up a string into text and math blocks
|
||||||
* @@@ FIXME: pass environment to TEX.Parse? @@@
|
|
||||||
*/
|
*/
|
||||||
InternalMath: function (text,level) {
|
InternalMath: function (text,level) {
|
||||||
var def = (this.stack.env.font ? {mathvariant: this.stack.env.font} : {});
|
var def = (this.stack.env.font ? {mathvariant: this.stack.env.font} : {});
|
||||||
@ -2031,7 +2035,7 @@
|
|||||||
c = text.charAt(i++);
|
c = text.charAt(i++);
|
||||||
if (c === '$') {
|
if (c === '$') {
|
||||||
if (match === '$' && braces === 0) {
|
if (match === '$' && braces === 0) {
|
||||||
mml.push(MML.TeXAtom(TEX.Parse(text.slice(k,i-1),{}).mml().With(def)));
|
mml.push(MML.TeXAtom(TEX.Parse(text.slice(k,i-1),{}).mml()));
|
||||||
match = ''; k = i;
|
match = ''; k = i;
|
||||||
} else if (match === '') {
|
} else if (match === '') {
|
||||||
if (k < i-1) mml.push(this.InternalText(text.slice(k,i-1),def));
|
if (k < i-1) mml.push(this.InternalText(text.slice(k,i-1),def));
|
||||||
@ -2057,7 +2061,7 @@
|
|||||||
if (k < i-2) mml.push(this.InternalText(text.slice(k,i-2),def));
|
if (k < i-2) mml.push(this.InternalText(text.slice(k,i-2),def));
|
||||||
match = ')'; k = i;
|
match = ')'; k = i;
|
||||||
} else if (c === ')' && match === ')' && braces === 0) {
|
} else if (c === ')' && match === ')' && braces === 0) {
|
||||||
mml.push(MML.TeXAtom(TEX.Parse(text.slice(k,i-2),{}).mml().With(def)));
|
mml.push(MML.TeXAtom(TEX.Parse(text.slice(k,i-2),{}).mml()));
|
||||||
match = ''; k = i;
|
match = ''; k = i;
|
||||||
} else if (c.match(/[${}\\]/) && match === '') {
|
} else if (c.match(/[${}\\]/) && match === '') {
|
||||||
i--; text = text.substr(0,i-1) + text.substr(i); // remove \ from \$, \{, \}, or \\
|
i--; text = text.substr(0,i-1) + text.substr(i); // remove \ from \$, \{, \}, or \\
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
MathJax.OutputJax.SVG = MathJax.OutputJax({
|
MathJax.OutputJax.SVG = MathJax.OutputJax({
|
||||||
id: "SVG",
|
id: "SVG",
|
||||||
version: "2.6.0",
|
version: "2.6.1",
|
||||||
directory: MathJax.OutputJax.directory + "/SVG",
|
directory: MathJax.OutputJax.directory + "/SVG",
|
||||||
extensionDir: MathJax.OutputJax.extensionDir + "/SVG",
|
extensionDir: MathJax.OutputJax.extensionDir + "/SVG",
|
||||||
autoloadDir: MathJax.OutputJax.directory + "/SVG/autoload",
|
autoloadDir: MathJax.OutputJax.directory + "/SVG/autoload",
|
||||||
|
@ -222,7 +222,7 @@
|
|||||||
onmouseover:EVENT.Mouseover, onmouseout:EVENT.Mouseout, onmousemove:EVENT.Mousemove,
|
onmouseover:EVENT.Mouseover, onmouseout:EVENT.Mouseout, onmousemove:EVENT.Mousemove,
|
||||||
onclick:EVENT.Click, ondblclick:EVENT.DblClick,
|
onclick:EVENT.Click, ondblclick:EVENT.DblClick,
|
||||||
// Added for keyboard accessible menu.
|
// Added for keyboard accessible menu.
|
||||||
onkeydown: EVENT.Keydown, tabIndex: "0"
|
onkeydown: EVENT.Keydown, tabIndex: HUB.getTabOrder(jax)
|
||||||
});
|
});
|
||||||
if (HUB.Browser.noContextMenu) {
|
if (HUB.Browser.noContextMenu) {
|
||||||
span.ontouchstart = TOUCH.start;
|
span.ontouchstart = TOUCH.start;
|
||||||
@ -1882,8 +1882,9 @@
|
|||||||
toSVG: function (HW,D) {
|
toSVG: function (HW,D) {
|
||||||
this.SVGgetStyles();
|
this.SVGgetStyles();
|
||||||
var values = this.getValues("displaystyle","accent","accentunder","align");
|
var values = this.getValues("displaystyle","accent","accentunder","align");
|
||||||
if (!values.displaystyle && this.data[this.base] != null &&
|
var base = this.data[this.base];
|
||||||
this.data[this.base].CoreMO().Get("movablelimits"))
|
if (!values.displaystyle && base != null &&
|
||||||
|
(base.movablelimits || base.CoreMO().Get("movablelimits")))
|
||||||
{return MML.msubsup.prototype.toSVG.call(this)}
|
{return MML.msubsup.prototype.toSVG.call(this)}
|
||||||
var svg = this.SVG(), scale = this.SVGgetScale(svg); this.SVGhandleSpace(svg);
|
var svg = this.SVG(), scale = this.SVGgetScale(svg); this.SVGhandleSpace(svg);
|
||||||
var boxes = [], stretch = [], box, i, m, W = -SVG.BIGDIMEN, WW = W;
|
var boxes = [], stretch = [], box, i, m, W = -SVG.BIGDIMEN, WW = W;
|
||||||
@ -1909,8 +1910,8 @@
|
|||||||
if (boxes[i].w > WW) {WW = boxes[i].w}
|
if (boxes[i].w > WW) {WW = boxes[i].w}
|
||||||
}}
|
}}
|
||||||
var t = SVG.TeX.rule_thickness * this.mscale;
|
var t = SVG.TeX.rule_thickness * this.mscale;
|
||||||
var base = boxes[this.base] || {w:0, h:0, d:0, H:0, D:0, l:0, r:0, y:0, scale:scale};
|
|
||||||
var x, y, z1, z2, z3, dw, k, delta = 0;
|
var x, y, z1, z2, z3, dw, k, delta = 0;
|
||||||
|
base = boxes[this.base] || {w:0, h:0, d:0, H:0, D:0, l:0, r:0, y:0, scale:scale};
|
||||||
if (base.ic) {delta = 1.3*base.ic + .05} // adjust faked IC to be more in line with expeted results
|
if (base.ic) {delta = 1.3*base.ic + .05} // adjust faked IC to be more in line with expeted results
|
||||||
for (i = 0, m = this.data.length; i < m; i++) {
|
for (i = 0, m = this.data.length; i < m; i++) {
|
||||||
if (this.data[i] != null) {
|
if (this.data[i] != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user