Merge branch 'issue71' into new-features (adds line numbering, \label and \ref)
This commit is contained in:
commit
fcefc54b20
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
|
@ -262,6 +262,13 @@ MathJax.Hub.Config({
|
||||||
//
|
//
|
||||||
processEnvironments: true,
|
processEnvironments: true,
|
||||||
|
|
||||||
|
//
|
||||||
|
// Controls whether tex2jax processes \ref{...} commands outside
|
||||||
|
// of math mode. Set to "false" to prevent processing of \ref
|
||||||
|
// except within math mode.
|
||||||
|
//
|
||||||
|
processRefs: true,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Controls whether tex2jax inserts MathJax_Preview spans to make a
|
// Controls whether tex2jax inserts MathJax_Preview spans to make a
|
||||||
// preview available, and what preview to use, when it locates in-line
|
// preview available, and what preview to use, when it locates in-line
|
||||||
|
@ -368,7 +375,20 @@ MathJax.Hub.Config({
|
||||||
// bold: ['{\\bf #1}', 1]
|
// bold: ['{\\bf #1}', 1]
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
Macros: {}
|
Macros: {},
|
||||||
|
|
||||||
|
//
|
||||||
|
// Equation numbering parameters.
|
||||||
|
//
|
||||||
|
equationNumbers: {
|
||||||
|
// formatNumber: function (n) {return n}, // format for equation number n
|
||||||
|
// formatTag: function (n) {return '('+n+')'}, // format for \tag and \eqref
|
||||||
|
// formatID: function (n) {return 'mjx-eqn-'+n}, // element ID to use for reference
|
||||||
|
// formatURL: function (n) {return '#mjx-eqn-'+escape(n)}, // URL to use for references
|
||||||
|
|
||||||
|
autoNumber: "none" // "AMS" for standard AMS environment numbering,
|
||||||
|
// or "all" to number all displayed equations
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
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
|
@ -12,5 +12,5 @@
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
MathJax.InputJax.TeX=MathJax.InputJax({id:"TeX",version:"1.1.2",directory:MathJax.InputJax.directory+"/TeX",extensionDir:MathJax.InputJax.extensionDir+"/TeX",config:{TagSide:"right",TagIndent:"0.8em",MultLineWidth:"85%"}});MathJax.InputJax.TeX.Register("math/tex");MathJax.InputJax.TeX.loadComplete("config.js");
|
MathJax.InputJax.TeX=MathJax.InputJax({id:"TeX",version:"1.1.3",directory:MathJax.InputJax.directory+"/TeX",extensionDir:MathJax.InputJax.extensionDir+"/TeX",config:{TagSide:"right",TagIndent:"0.8em",MultLineWidth:"85%",equationNumbers:{autoNumber:"none",formatNumber:function(a){return a},formatTag:function(a){return"("+a+")"},formatID:function(a){return"mjx-eqn-"+a},formatURL:function(a){return"#mjx-eqn-"+escape(a)}}}});MathJax.InputJax.TeX.Register("math/tex");MathJax.InputJax.TeX.loadComplete("config.js");
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -12,5 +12,5 @@
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
MathJax.OutputJax["HTML-CSS"]=MathJax.OutputJax({id:"HTML-CSS",version:"1.1.8",directory:MathJax.OutputJax.directory+"/HTML-CSS",extensionDir:MathJax.OutputJax.extensionDir+"/HTML-CSS",autoloadDir:MathJax.OutputJax.directory+"/HTML-CSS/autoload",fontDir:MathJax.OutputJax.directory+"/HTML-CSS/fonts",webfontDir:MathJax.OutputJax.fontDir+"/HTML-CSS",config:{scale:100,minScaleAdjust:50,availableFonts:["STIX","TeX"],preferredFont:"TeX",webFont:"TeX",imageFont:"TeX",undefinedFamily:"STIXGeneral,'Arial Unicode MS',serif",showMathMenu:true,styles:{".MathJax_Display":{"text-align":"center",margin:"1em 0em"},".MathJax .merror":{"background-color":"#FFFF88",color:"#CC0000",border:"1px solid #CC0000",padding:"1px 3px","font-family":"serif","font-style":"normal","font-size":"90%"},".MathJax_Preview":{color:"#888888"},"#MathJax_Tooltip":{"background-color":"InfoBackground",color:"InfoText",border:"1px solid black","box-shadow":"2px 2px 5px #AAAAAA","-webkit-box-shadow":"2px 2px 5px #AAAAAA","-moz-box-shadow":"2px 2px 5px #AAAAAA","-khtml-box-shadow":"2px 2px 5px #AAAAAA",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')",padding:"3px 4px"}}}});if(MathJax.Hub.Browser.isMSIE&&document.documentMode>=9){delete MathJax.OutputJax["HTML-CSS"].config.styles["#MathJax_Tooltip"].filter}if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax["HTML-CSS"].Register("jax/mml")}MathJax.Hub.Register.StartupHook("End Config",[function(b,c){var a=b.Insert({minBrowserVersion:{Firefox:3,Opera:9.52,MSIE:6,Chrome:0.3,Safari:2,Konqueror:4},inlineMathDelimiters:["$","$"],displayMathDelimiters:["$$","$$"],multilineDisplay:true,minBrowserTranslate:function(f){var e=b.getJaxFor(f),k=["[Math]"],j;var h=document.createElement("span",{className:"MathJax_Preview"});if(e.inputJax.id==="TeX"){if(e.root.Get("displaystyle")){j=a.displayMathDelimiters;k=[j[0]+e.originalText+j[1]];if(a.multilineDisplay){k=k[0].split(/\n/)}}else{j=a.inlineMathDelimiters;k=[j[0]+e.originalText.replace(/^\s+/,"").replace(/\s+$/,"")+j[1]]}}for(var g=0,d=k.length;g<d;g++){h.appendChild(document.createTextNode(k[g]));if(g<d-1){h.appendChild(document.createElement("br"))}}f.parentNode.insertBefore(h,f)}},(b.config["HTML-CSS"]||{}));if(b.Browser.version!=="0.0"&&!b.Browser.versionAtLeast(a.minBrowserVersion[b.Browser]||0)){c.Translate=a.minBrowserTranslate;b.Config({showProcessingMessages:false});MathJax.Message.Set("Your browser does not support MathJax",null,4000);b.Startup.signal.Post("MathJax not supported")}},MathJax.Hub,MathJax.OutputJax["HTML-CSS"]]);MathJax.OutputJax["HTML-CSS"].loadComplete("config.js");
|
MathJax.OutputJax["HTML-CSS"]=MathJax.OutputJax({id:"HTML-CSS",version:"1.1.9",directory:MathJax.OutputJax.directory+"/HTML-CSS",extensionDir:MathJax.OutputJax.extensionDir+"/HTML-CSS",autoloadDir:MathJax.OutputJax.directory+"/HTML-CSS/autoload",fontDir:MathJax.OutputJax.directory+"/HTML-CSS/fonts",webfontDir:MathJax.OutputJax.fontDir+"/HTML-CSS",config:{scale:100,minScaleAdjust:50,availableFonts:["STIX","TeX"],preferredFont:"TeX",webFont:"TeX",imageFont:"TeX",undefinedFamily:"STIXGeneral,'Arial Unicode MS',serif",showMathMenu:true,styles:{".MathJax_Display":{"text-align":"center",margin:"1em 0em"},".MathJax .merror":{"background-color":"#FFFF88",color:"#CC0000",border:"1px solid #CC0000",padding:"1px 3px","font-family":"serif","font-style":"normal","font-size":"90%"},".MathJax_Preview":{color:"#888888"},"#MathJax_Tooltip":{"background-color":"InfoBackground",color:"InfoText",border:"1px solid black","box-shadow":"2px 2px 5px #AAAAAA","-webkit-box-shadow":"2px 2px 5px #AAAAAA","-moz-box-shadow":"2px 2px 5px #AAAAAA","-khtml-box-shadow":"2px 2px 5px #AAAAAA",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')",padding:"3px 4px"}}}});if(MathJax.Hub.Browser.isMSIE&&document.documentMode>=9){delete MathJax.OutputJax["HTML-CSS"].config.styles["#MathJax_Tooltip"].filter}if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax["HTML-CSS"].Register("jax/mml")}MathJax.Hub.Register.StartupHook("End Config",[function(b,c){var a=b.Insert({minBrowserVersion:{Firefox:3,Opera:9.52,MSIE:6,Chrome:0.3,Safari:2,Konqueror:4},inlineMathDelimiters:["$","$"],displayMathDelimiters:["$$","$$"],multilineDisplay:true,minBrowserTranslate:function(f){var e=b.getJaxFor(f),k=["[Math]"],j;var h=document.createElement("span",{className:"MathJax_Preview"});if(e.inputJax==="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
|
@ -12,5 +12,5 @@
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
MathJax.OutputJax.NativeMML=MathJax.OutputJax({id:"NativeMML",version:"1.1.4",directory:MathJax.OutputJax.directory+"/NativeMML",extensionDir:MathJax.OutputJax.extensionDir+"/NativeMML",config:{scale:100,showMathMenu:true,showMathMenuMSIE:true,styles:{"DIV.MathJax_MathML":{"text-align":"center",margin:".75em 0px"}}}});if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax.NativeMML.Register("jax/mml")}MathJax.OutputJax.NativeMML.loadComplete("config.js");
|
MathJax.OutputJax.NativeMML=MathJax.OutputJax({id:"NativeMML",version:"1.1.5",directory:MathJax.OutputJax.directory+"/NativeMML",extensionDir:MathJax.OutputJax.extensionDir+"/NativeMML",config:{scale:100,showMathMenu:true,showMathMenuMSIE:true,styles:{"DIV.MathJax_MathML":{"text-align":"center",margin:".75em 0px"}}}});if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax.NativeMML.Register("jax/mml")}MathJax.OutputJax.NativeMML.loadComplete("config.js");
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -30,7 +30,7 @@ if (!window.MathJax) {window.MathJax= {}}
|
||||||
if (!MathJax.Hub) { // skip if already loaded
|
if (!MathJax.Hub) { // skip if already loaded
|
||||||
|
|
||||||
MathJax.version = "1.1a";
|
MathJax.version = "1.1a";
|
||||||
MathJax.fileversion = "1.1.7";
|
MathJax.fileversion = "1.1.8";
|
||||||
|
|
||||||
/**********************************************************/
|
/**********************************************************/
|
||||||
|
|
||||||
|
@ -366,24 +366,51 @@ MathJax.fileversion = "1.1.7";
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// Run an array of callbacks passing them the given data.
|
// An array or priorities hooks that are executed sequentially
|
||||||
|
// with a given set of data.
|
||||||
|
//
|
||||||
|
var HOOKS = MathJax.Object.Subclass({
|
||||||
|
//
|
||||||
|
// Initialize the array and the auto-reset status
|
||||||
|
//
|
||||||
|
Init: function (reset) {
|
||||||
|
this.hooks = [];
|
||||||
|
this.reset = reset;
|
||||||
|
},
|
||||||
|
//
|
||||||
|
// Add a callback to the list, in priority order (default priority is 10)
|
||||||
|
//
|
||||||
|
Add: function (hook,priority) {
|
||||||
|
if (priority == null) {priority = 10}
|
||||||
|
if (!ISCALLBACK(hook)) {hook = USING(hook)}
|
||||||
|
hook.priority = priority;
|
||||||
|
var i = this.hooks.length;
|
||||||
|
while (i > 0 && priority < this.hooks[i-1].priority) {i--}
|
||||||
|
this.hooks.splice(i,0,hook);
|
||||||
|
return hook;
|
||||||
|
},
|
||||||
|
Remove: function (hook) {
|
||||||
|
for (var i = 0, m = this.hooks.length; i < m; i++) {
|
||||||
|
if (this.hooks[i] === hook) {this.hooks.splice(i,1); return}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//
|
||||||
|
// Execute the list of callbacks, resetting them if requested.
|
||||||
// If any return callbacks, return a callback that will be
|
// If any return callbacks, return a callback that will be
|
||||||
// executed when they all have completed.
|
// executed when they all have completed.
|
||||||
//
|
//
|
||||||
var HOOKS = function (hooks,data,reset) {
|
Execute: function () {
|
||||||
if (!hooks) {return null}
|
|
||||||
if (!(hooks instanceof Array)) {hooks = [hooks]}
|
|
||||||
if (!(data instanceof Array)) {data = (data == null ? [] : [data])}
|
|
||||||
var callbacks = [{}];
|
var callbacks = [{}];
|
||||||
for (var i = 0, m = hooks.length; i < m; i++) {
|
for (var i = 0, m = this.hooks.length; i < m; i++) {
|
||||||
if (reset) {hooks[i].reset()}
|
if (this.reset) {this.hooks[i].reset()}
|
||||||
var result = hooks[i].apply(window,data);
|
var result = this.hooks[i].apply(window,arguments);
|
||||||
if (ISCALLBACK(result) && !result.called) {callbacks.push(result)}
|
if (ISCALLBACK(result) && !result.called) {callbacks.push(result)}
|
||||||
}
|
}
|
||||||
if (callbacks.length === 1) {return null}
|
if (callbacks.length === 1) {return null}
|
||||||
if (callbacks.length === 2) {return callbacks[1]}
|
if (callbacks.length === 2) {return callbacks[1]}
|
||||||
return AFTER.apply({},callbacks);
|
return AFTER.apply({},callbacks);
|
||||||
};
|
}
|
||||||
|
});
|
||||||
|
|
||||||
//
|
//
|
||||||
// Command queue that performs commands in order, waiting when
|
// Command queue that performs commands in order, waiting when
|
||||||
|
@ -448,7 +475,7 @@ MathJax.fileversion = "1.1.7";
|
||||||
QUEUE.prototype.Init.call(this);
|
QUEUE.prototype.Init.call(this);
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.posted = []; // the messages posted so far
|
this.posted = []; // the messages posted so far
|
||||||
this.listeners = []; // those with interest in this signal
|
this.listeners = HOOKS(true); // those with interest in this signal
|
||||||
},
|
},
|
||||||
//
|
//
|
||||||
// Post a message to the signal listeners, with callback for when complete
|
// Post a message to the signal listeners, with callback for when complete
|
||||||
|
@ -460,12 +487,9 @@ MathJax.fileversion = "1.1.7";
|
||||||
} else {
|
} else {
|
||||||
this.callback = callback; callback.reset();
|
this.callback = callback; callback.reset();
|
||||||
if (!forget) {this.posted.push(message)}
|
if (!forget) {this.posted.push(message)}
|
||||||
this.Suspend(); this.posting = 1;
|
this.Suspend(); this.posting = true;
|
||||||
for (var i = 0, m = this.listeners.length; i < m; i++) {
|
var result = this.listeners.Execute(message);
|
||||||
this.listeners[i].reset();
|
|
||||||
var result = (this.listeners[i])(message);
|
|
||||||
if (ISCALLBACK(result) && !result.called) {WAITFOR(result,this)}
|
if (ISCALLBACK(result) && !result.called) {WAITFOR(result,this)}
|
||||||
}
|
|
||||||
this.Resume(); delete this.posting;
|
this.Resume(); delete this.posting;
|
||||||
if (!this.pending) {this.call()}
|
if (!this.pending) {this.call()}
|
||||||
}
|
}
|
||||||
|
@ -491,11 +515,11 @@ MathJax.fileversion = "1.1.7";
|
||||||
|
|
||||||
//
|
//
|
||||||
// A listener calls this to register intrest in the signal (so it will be called
|
// A listener calls this to register intrest in the signal (so it will be called
|
||||||
// when posts occur). If ignorePast is 1, it will not be sent the post history.
|
// when posts occur). If ignorePast is true, it will not be sent the post history.
|
||||||
//
|
//
|
||||||
Interest: function (callback,ignorePast) {
|
Interest: function (callback,ignorePast,priority) {
|
||||||
callback = USING(callback);
|
callback = USING(callback);
|
||||||
this.listeners[this.listeners.length] = callback;
|
this.listeners.Add(callback,priority);
|
||||||
if (!ignorePast) {
|
if (!ignorePast) {
|
||||||
for (var i = 0, m = this.posted.length; i < m; i++) {
|
for (var i = 0, m = this.posted.length; i < m; i++) {
|
||||||
callback.reset();
|
callback.reset();
|
||||||
|
@ -509,19 +533,17 @@ MathJax.fileversion = "1.1.7";
|
||||||
// A listener calls this to remove itself from a signal
|
// A listener calls this to remove itself from a signal
|
||||||
//
|
//
|
||||||
NoInterest: function (callback) {
|
NoInterest: function (callback) {
|
||||||
for (var i = 0, m = this.listeners.length; i < m; i++) {
|
this.listeners.Remove(callback);
|
||||||
if (this.listeners[i] === callback) {this.listeners.splice(i,1); return}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//
|
//
|
||||||
// Hook a callback to a particular message on this signal
|
// Hook a callback to a particular message on this signal
|
||||||
//
|
//
|
||||||
MessageHook: function (msg,callback) {
|
MessageHook: function (msg,callback,priority) {
|
||||||
callback = USING(callback);
|
callback = USING(callback);
|
||||||
if (!this.hooks) {this.hooks = {}; this.Interest(["ExecuteHooks",this])}
|
if (!this.hooks) {this.hooks = {}; this.Interest(["ExecuteHooks",this])}
|
||||||
if (!this.hooks[msg]) {this.hooks[msg] = []}
|
if (!this.hooks[msg]) {this.hooks[msg] = HOOKS(true)}
|
||||||
this.hooks[msg].push(callback);
|
this.hooks[msg].Add(callback,priority);
|
||||||
for (var i = 0, m = this.posted.length; i < m; i++)
|
for (var i = 0, m = this.posted.length; i < m; i++)
|
||||||
{if (this.posted[i] == msg) {callback.reset(); callback(this.posted[i])}}
|
{if (this.posted[i] == msg) {callback.reset(); callback(this.posted[i])}}
|
||||||
return callback;
|
return callback;
|
||||||
|
@ -531,7 +553,8 @@ MathJax.fileversion = "1.1.7";
|
||||||
//
|
//
|
||||||
ExecuteHooks: function (msg,more) {
|
ExecuteHooks: function (msg,more) {
|
||||||
var type = ((msg instanceof Array) ? msg[0] : msg);
|
var type = ((msg instanceof Array) ? msg[0] : msg);
|
||||||
return HOOKS(this.hooks[type],[msg],true);
|
if (!this.hooks[type]) {return null}
|
||||||
|
return this.hooks[type].Execute(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
},{
|
},{
|
||||||
|
@ -550,7 +573,7 @@ MathJax.fileversion = "1.1.7";
|
||||||
BASE.Callback.After = AFTER;
|
BASE.Callback.After = AFTER;
|
||||||
BASE.Callback.Queue = QUEUE;
|
BASE.Callback.Queue = QUEUE;
|
||||||
BASE.Callback.Signal = SIGNAL.find;
|
BASE.Callback.Signal = SIGNAL.find;
|
||||||
BASE.Callback.ExecuteHooks = HOOKS;
|
BASE.Callback.Hooks = HOOKS;
|
||||||
})("MathJax");
|
})("MathJax");
|
||||||
|
|
||||||
/**********************************************************/
|
/**********************************************************/
|
||||||
|
@ -635,8 +658,7 @@ MathJax.fileversion = "1.1.7";
|
||||||
else {type = file.split(/\./).pop().toUpperCase()}
|
else {type = file.split(/\./).pop().toUpperCase()}
|
||||||
file = this.fileURL(file);
|
file = this.fileURL(file);
|
||||||
if (this.loading[file]) {
|
if (this.loading[file]) {
|
||||||
if (!this.loadHooks[file]) {this.loadHooks[file] = []}
|
this.addHook(file,callback);
|
||||||
this.loadHooks[file].push(callback);
|
|
||||||
} else {
|
} else {
|
||||||
this.head = HEAD(this.head);
|
this.head = HEAD(this.head);
|
||||||
if (this.loader[type]) {this.loader[type].call(this,file,callback)}
|
if (this.loader[type]) {this.loader[type].call(this,file,callback)}
|
||||||
|
@ -649,18 +671,18 @@ MathJax.fileversion = "1.1.7";
|
||||||
// Register a load hook for a particular file (it will be called when
|
// Register a load hook for a particular file (it will be called when
|
||||||
// loadComplete() is called for that file)
|
// loadComplete() is called for that file)
|
||||||
//
|
//
|
||||||
LoadHook: function (file,callback) {
|
LoadHook: function (file,callback,priority) {
|
||||||
callback = BASE.Callback(callback);
|
callback = BASE.Callback(callback);
|
||||||
if (file instanceof Object) {for (var i in file) {file = file[i]}}
|
if (file instanceof Object) {for (var i in file) {file = file[i]}}
|
||||||
file = this.fileURL(file);
|
file = this.fileURL(file);
|
||||||
if (this.loaded[file]) {
|
if (this.loaded[file]) {callback(this.loaded[file])}
|
||||||
callback(this.loaded[file]);
|
else {this.addHook(file,callback,priority)}
|
||||||
} else {
|
|
||||||
if (!this.loadHooks[file]) {this.loadHooks[file] = []}
|
|
||||||
this.loadHooks[file].push(callback);
|
|
||||||
}
|
|
||||||
return callback;
|
return callback;
|
||||||
},
|
},
|
||||||
|
addHook: function (file,callback,priority) {
|
||||||
|
if (!this.loadHooks[file]) {this.loadHooks[file] = MathJax.Callback.Hooks()}
|
||||||
|
this.loadHooks[file].Add(callback,priority);
|
||||||
|
},
|
||||||
|
|
||||||
//
|
//
|
||||||
// Used when files are combined in a preloading configuration file
|
// Used when files are combined in a preloading configuration file
|
||||||
|
@ -818,13 +840,13 @@ MathJax.fileversion = "1.1.7";
|
||||||
SCRIPTS.push(loading.script);
|
SCRIPTS.push(loading.script);
|
||||||
}
|
}
|
||||||
this.loaded[file] = loading.status; delete this.loading[file];
|
this.loaded[file] = loading.status; delete this.loading[file];
|
||||||
if (!this.loadHooks[file]) {this.loadHooks[file] = []}
|
this.addHook(file,loading.callback);
|
||||||
this.loadHooks[file].push(loading.callback);
|
|
||||||
} else {
|
} else {
|
||||||
this.loaded[file] = this.STATUS.OK;
|
this.loaded[file] = this.STATUS.OK;
|
||||||
loading = {status: this.STATUS.OK}
|
loading = {status: this.STATUS.OK}
|
||||||
}
|
}
|
||||||
BASE.Callback.ExecuteHooks(this.loadHooks[file],loading.status);
|
if (!this.loadHooks[file]) {return null}
|
||||||
|
return this.loadHooks[file].Execute(loading.status);
|
||||||
},
|
},
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1091,6 +1113,9 @@ MathJax.Message = {
|
||||||
} else if (text.match(/^Processing /)) {
|
} else if (text.match(/^Processing /)) {
|
||||||
if (!this.processing) {this.processing = "Processing "}
|
if (!this.processing) {this.processing = "Processing "}
|
||||||
text = this.processing; this.processing += ".";
|
text = this.processing; this.processing += ".";
|
||||||
|
} else if (text.match(/^Typesetting /)) {
|
||||||
|
if (!this.typesetting) {this.typesetting = "Typesetting "}
|
||||||
|
text = this.typesetting; this.typesetting += ".";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
|
@ -1186,10 +1211,6 @@ MathJax.Hub = {
|
||||||
"v1.0-compatible": true, // set to false to prevent loading of default configuration file
|
"v1.0-compatible": true, // set to false to prevent loading of default configuration file
|
||||||
elements: [], // array of elements to process when none is given explicitly
|
elements: [], // array of elements to process when none is given explicitly
|
||||||
|
|
||||||
preProcessors: [], // list of callbacks for preprocessing (initialized by extensions)
|
|
||||||
inputJax: {}, // mime-type mapped to input jax (by registration)
|
|
||||||
outputJax: {order:{}}, // mime-type mapped to output jax list (by registration)
|
|
||||||
|
|
||||||
menuSettings: {
|
menuSettings: {
|
||||||
//format: "MathML", // the Show Source format (set in MathMenu.js)
|
//format: "MathML", // the Show Source format (set in MathMenu.js)
|
||||||
zoom: "None", // when to do MathZoom
|
zoom: "None", // when to do MathZoom
|
||||||
|
@ -1209,6 +1230,10 @@ MathJax.Hub = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
preProcessors: MathJax.Callback.Hooks(true), // list of callbacks for preprocessing (initialized by extensions)
|
||||||
|
inputJax: {}, // mime-type mapped to input jax (by registration)
|
||||||
|
outputJax: {order:{}}, // mime-type mapped to output jax list (by registration)
|
||||||
|
|
||||||
processUpdateTime: 250, // time between screen updates when processing math (milliseconds)
|
processUpdateTime: 250, // time between screen updates when processing math (milliseconds)
|
||||||
|
|
||||||
signal: MathJax.Callback.Signal("Hub"), // Signal used for Hub events
|
signal: MathJax.Callback.Signal("Hub"), // Signal used for Hub events
|
||||||
|
@ -1228,7 +1253,7 @@ MathJax.Hub = {
|
||||||
},
|
},
|
||||||
|
|
||||||
Register: {
|
Register: {
|
||||||
PreProcessor: function (callback) {MathJax.Hub.config.preProcessors.push(MathJax.Callback(callback))},
|
PreProcessor: function () {MathJax.Hub.preProcessors.Add.apply(MathJax.Hub.preProcessors,arguments)},
|
||||||
MessageHook: function () {return MathJax.Hub.signal.MessageHook.apply(MathJax.Hub.signal,arguments)},
|
MessageHook: function () {return MathJax.Hub.signal.MessageHook.apply(MathJax.Hub.signal,arguments)},
|
||||||
StartupHook: function () {return MathJax.Hub.Startup.signal.MessageHook.apply(MathJax.Hub.Startup.signal,arguments)},
|
StartupHook: function () {return MathJax.Hub.Startup.signal.MessageHook.apply(MathJax.Hub.Startup.signal,arguments)},
|
||||||
LoadHook: function () {return MathJax.Ajax.LoadHook.apply(MathJax.Ajax,arguments)}
|
LoadHook: function () {return MathJax.Ajax.LoadHook.apply(MathJax.Ajax,arguments)}
|
||||||
|
@ -1275,7 +1300,7 @@ MathJax.Hub = {
|
||||||
if (element && element.tagName != null && element.tagName.toLowerCase() === 'script') {
|
if (element && element.tagName != null && element.tagName.toLowerCase() === 'script') {
|
||||||
if (element.MathJax)
|
if (element.MathJax)
|
||||||
{return (element.MathJax.state === MathJax.ElementJax.STATE.PROCESSED ? 1 : -1)}
|
{return (element.MathJax.state === MathJax.ElementJax.STATE.PROCESSED ? 1 : -1)}
|
||||||
if (element.type && this.config.inputJax[element.type.replace(/ *;(.|\s)*/,"")]) {return -1}
|
if (element.type && this.inputJax[element.type.replace(/ *;(.|\s)*/,"")]) {return -1}
|
||||||
}
|
}
|
||||||
// FIXME: check for results of outputJax
|
// FIXME: check for results of outputJax
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1307,8 +1332,7 @@ MathJax.Hub = {
|
||||||
if (ec.elements[i]) {
|
if (ec.elements[i]) {
|
||||||
queue.Push(
|
queue.Push(
|
||||||
["Post",this.signal,["Begin PreProcess",ec.elements[i]]],
|
["Post",this.signal,["Begin PreProcess",ec.elements[i]]],
|
||||||
["ExecuteHooks",MathJax.Callback,
|
(arguments.callee.disabled? {} : ["Execute",this.preProcessors,ec.elements[i]]),
|
||||||
(arguments.callee.disabled ? [] : this.config.preProcessors), ec.elements[i], true],
|
|
||||||
["Post",this.signal,["End PreProcess",ec.elements[i]]]
|
["Post",this.signal,["End PreProcess",ec.elements[i]]]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1330,7 +1354,12 @@ MathJax.Hub = {
|
||||||
["Post",this.signal,["Begin "+action,ec.elements[i]]],
|
["Post",this.signal,["Begin "+action,ec.elements[i]]],
|
||||||
["Post",this.signal,["Begin Math",ec.elements[i]]],
|
["Post",this.signal,["Begin Math",ec.elements[i]]],
|
||||||
["prepareScripts",this,action,ec.elements[i],scripts],
|
["prepareScripts",this,action,ec.elements[i],scripts],
|
||||||
["processScripts",this,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,["End Math",ec.elements[i]]],
|
||||||
["Post",this.signal,["End "+action,ec.elements[i]]]
|
["Post",this.signal,["End "+action,ec.elements[i]]]
|
||||||
);
|
);
|
||||||
|
@ -1343,14 +1372,12 @@ MathJax.Hub = {
|
||||||
Process: function (script) {},
|
Process: function (script) {},
|
||||||
Update: function (script) {
|
Update: function (script) {
|
||||||
var jax = script.MathJax.elementJax;
|
var jax = script.MathJax.elementJax;
|
||||||
// FIXME: Have intputJax determine if things have changed?
|
if (jax && jax.needsUpdate()) {jax.Remove(true); script.MathJax.state = jax.STATE.UPDATE}
|
||||||
if (jax && jax.originalText === (script.text == "" ? script.innerHTML : script.text))
|
else {script.MathJax.state = jax.STATE.PROCESSED}
|
||||||
{script.MathJax.state = jax.STATE.PROCESSED} else
|
|
||||||
{jax.outputJax.Remove(jax); script.MathJax.state = jax.STATE.UPDATE}
|
|
||||||
},
|
},
|
||||||
Reprocess: function (script) {
|
Reprocess: function (script) {
|
||||||
var jax = script.MathJax.elementJax;
|
var jax = script.MathJax.elementJax;
|
||||||
if (jax) {jax.outputJax.Remove(jax); script.MathJax.state = jax.STATE.UPDATE}
|
if (jax) {jax.Remove(true); script.MathJax.state = jax.STATE.UPDATE}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1360,7 +1387,7 @@ MathJax.Hub = {
|
||||||
var STATE = MathJax.ElementJax.STATE;
|
var STATE = MathJax.ElementJax.STATE;
|
||||||
for (var i = 0, m = scripts.length; i < m; i++) {
|
for (var i = 0, m = scripts.length; i < m; i++) {
|
||||||
var script = scripts[i];
|
var script = scripts[i];
|
||||||
if (script.type && this.config.inputJax[script.type.replace(/ *;(.|\n)*/,"")]) {
|
if (script.type && this.inputJax[script.type.replace(/ *;(.|\n)*/,"")]) {
|
||||||
if (script.MathJax && script.MathJax.state !== STATE.PENDING)
|
if (script.MathJax && script.MathJax.state !== STATE.PENDING)
|
||||||
{this.scriptAction[action](script)}
|
{this.scriptAction[action](script)}
|
||||||
if (!script.MathJax) {script.MathJax = {state: STATE.PENDING}}
|
if (!script.MathJax) {script.MathJax = {state: STATE.PENDING}}
|
||||||
|
@ -1403,13 +1430,12 @@ MathJax.Hub = {
|
||||||
if (script.MathJax) {script.MathJax.checked = 1}
|
if (script.MathJax) {script.MathJax.checked = 1}
|
||||||
},
|
},
|
||||||
|
|
||||||
processScripts: function (scripts,start,n) {
|
processInput: function (scripts,start,n) {
|
||||||
if (arguments.callee.disabled) {return null}
|
if (arguments.callee.disabled) {return null}
|
||||||
var result, STATE = MathJax.ElementJax.STATE;
|
|
||||||
var inputJax = this.config.inputJax, outputJax = this.config.outputJax;
|
|
||||||
try {
|
|
||||||
if (!start) {start = new Date().getTime()}
|
if (!start) {start = new Date().getTime()}
|
||||||
|
var result, STATE = MathJax.ElementJax.STATE;
|
||||||
var i = 0, script, prev;
|
var i = 0, script, prev;
|
||||||
|
try {
|
||||||
while (i < scripts.length) {
|
while (i < scripts.length) {
|
||||||
script = scripts[i]; if (!script) {i++; continue}
|
script = scripts[i]; if (!script) {i++; continue}
|
||||||
prev = script.previousSibling;
|
prev = script.previousSibling;
|
||||||
|
@ -1418,46 +1444,68 @@ MathJax.Hub = {
|
||||||
if (!script.MathJax || script.MathJax.state === STATE.PROCESSED) {i++; continue};
|
if (!script.MathJax || script.MathJax.state === STATE.PROCESSED) {i++; continue};
|
||||||
if (!script.MathJax.elementJax || script.MathJax.state === STATE.UPDATE) {
|
if (!script.MathJax.elementJax || script.MathJax.state === STATE.UPDATE) {
|
||||||
this.checkScriptSiblings(script);
|
this.checkScriptSiblings(script);
|
||||||
result = inputJax[type].Process(script);
|
result = this.inputJax[type].Process(script);
|
||||||
if (typeof result === 'function') {
|
if (typeof result === 'function') {
|
||||||
if (result.called) continue; // go back and call Process() again
|
if (result.called) continue; // go back and call Process() again
|
||||||
this.RestartAfter(result);
|
this.RestartAfter(result);
|
||||||
}
|
}
|
||||||
result.Attach(script,inputJax[type]);
|
result.Attach(script,this.inputJax[type].id);
|
||||||
script.MathJax.state = STATE.OUTPUT;
|
script.MathJax.state = STATE.OUTPUT;
|
||||||
}
|
}
|
||||||
var jax = script.MathJax.elementJax;
|
|
||||||
if (!outputJax[jax.mimeType]) {
|
|
||||||
script.MathJax.state = STATE.UPDATE;
|
|
||||||
throw Error("No output jax registered for "+jax.mimeType);
|
|
||||||
}
|
|
||||||
jax.outputJax = outputJax[jax.mimeType][0];
|
|
||||||
result = jax.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;
|
|
||||||
this.signal.Post(["New Math",jax.inputID]); // FIXME: wait for this? (i.e., restart if returns uncalled callback)
|
|
||||||
i++;
|
i++;
|
||||||
if (new Date().getTime() - start > this.processUpdateTime && i < scripts.length)
|
if (new Date().getTime() - start > this.processUpdateTime && i < scripts.length)
|
||||||
{start = 0; this.RestartAfter(MathJax.Callback.Delay(1))}
|
{start = 0; this.RestartAfter(MathJax.Callback.Delay(1))}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {return this.processError(err,scripts,i,n,start,"Input")}
|
||||||
if (!err.restart) {
|
if ((n || scripts.length) && this.config.showProcessingMessages)
|
||||||
if (!this.config.errorSettings.message) {throw err}
|
{MathJax.Message.Set("Processing math: 100%",0)}
|
||||||
this.formatError(script,err); i++;
|
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;
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
if (!n) {n = 0}; var m = Math.floor((n+i)/(n+scripts.length)*100); n += i;
|
var outputJax = this.outputJax[jax.mimeType][0];
|
||||||
if (this.config.showProcessingMessages) {MathJax.Message.Set("Processing math: "+m+"%",0)}
|
jax.outputJax = outputJax.id;
|
||||||
return MathJax.Callback.After(["processScripts",this,scripts.slice(i),start,n],err.restart);
|
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++;
|
||||||
|
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))}
|
||||||
|
}
|
||||||
|
} catch (err) {return this.processError(err,scripts,i,n,start,"Output")}
|
||||||
if ((n || scripts.length) && this.config.showProcessingMessages) {
|
if ((n || scripts.length) && this.config.showProcessingMessages) {
|
||||||
MathJax.Message.Set("Processing Math: 100%",0);
|
MathJax.Message.Set("Typesetting math: 100%",0);
|
||||||
MathJax.Message.Clear(0);
|
MathJax.Message.Clear(0);
|
||||||
}
|
}
|
||||||
return null;
|
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;
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
|
||||||
formatError: function (script,err) {
|
formatError: function (script,err) {
|
||||||
var error = MathJax.HTML.Element("span",{className:"MathJax_Error"},this.config.errorSettings.message);
|
var error = MathJax.HTML.Element("span",{className:"MathJax_Error"},this.config.errorSettings.message);
|
||||||
script.parentNode.insertBefore(error,script);
|
script.parentNode.insertBefore(error,script);
|
||||||
|
@ -1505,8 +1553,7 @@ MathJax.Hub.Insert(MathJax.Hub.config.styles,MathJax.Message.styles);
|
||||||
MathJax.Hub.Insert(MathJax.Hub.config.styles,{".MathJax_Error":MathJax.Hub.config.errorSettings.style});
|
MathJax.Hub.Insert(MathJax.Hub.config.styles,{".MathJax_Error":MathJax.Hub.config.errorSettings.style});
|
||||||
|
|
||||||
//
|
//
|
||||||
// Storage area for preprocessors and extensions
|
// Storage area for extensions and preprocessors
|
||||||
// (should these be classes?)
|
|
||||||
//
|
//
|
||||||
MathJax.Extension = {};
|
MathJax.Extension = {};
|
||||||
|
|
||||||
|
@ -1637,11 +1684,11 @@ MathJax.Hub.Startup = {
|
||||||
// Load the input and output jax
|
// Load the input and output jax
|
||||||
//
|
//
|
||||||
Jax: function () {
|
Jax: function () {
|
||||||
var config = MathJax.Hub.config;
|
var config = MathJax.Hub.config, jax = MathJax.Hub.outputJax;
|
||||||
// Save the order of the output jax since they are loading asynchronously
|
// Save the order of the output jax since they are loading asynchronously
|
||||||
for (var i = 0, m = config.jax.length, k = 0; i < m; i++) {
|
for (var i = 0, m = config.jax.length, k = 0; i < m; i++) {
|
||||||
if (config.jax[i].substr(0,7) === "output/")
|
if (config.jax[i].substr(0,7) === "output/")
|
||||||
{config.outputJax.order[config.jax[i].substr(7)] = k; k++}
|
{jax.order[config.jax[i].substr(7)] = k; k++}
|
||||||
}
|
}
|
||||||
var queue = MathJax.Callback.Queue();
|
var queue = MathJax.Callback.Queue();
|
||||||
return queue.Push(
|
return queue.Push(
|
||||||
|
@ -1674,7 +1721,7 @@ MathJax.Hub.Startup = {
|
||||||
// (this must come after the jax are loaded)
|
// (this must come after the jax are loaded)
|
||||||
//
|
//
|
||||||
Menu: function () {
|
Menu: function () {
|
||||||
var menu = MathJax.Hub.config.menuSettings, jax = MathJax.Hub.config.outputJax, registered;
|
var menu = MathJax.Hub.config.menuSettings, jax = MathJax.Hub.outputJax, registered;
|
||||||
for (var id in jax) {if (jax.hasOwnProperty(id)) {
|
for (var id in jax) {if (jax.hasOwnProperty(id)) {
|
||||||
if (jax[id].length) {registered = jax[id]; break}
|
if (jax[id].length) {registered = jax[id]; break}
|
||||||
}}
|
}}
|
||||||
|
@ -1840,13 +1887,17 @@ MathJax.Hub.Startup = {
|
||||||
var load = queue.Push(AJAX.Require(this.directory+"/"+this.JAXFILE));
|
var load = queue.Push(AJAX.Require(this.directory+"/"+this.JAXFILE));
|
||||||
if (!load.called) {this.constructor.prototype.Process = function () {return load}}
|
if (!load.called) {this.constructor.prototype.Process = function () {return load}}
|
||||||
// Load the associated output jax
|
// Load the associated output jax
|
||||||
jax = HUB.config.outputJax["jax/"+jax[0]];
|
jax = HUB.outputJax["jax/"+jax[0]];
|
||||||
if (jax) {queue.Push(AJAX.Require(jax[0].directory+"/"+this.JAXFILE))}
|
if (jax) {queue.Push(AJAX.Require(jax[0].directory+"/"+this.JAXFILE))}
|
||||||
return queue.Push({});
|
return queue.Push({});
|
||||||
},
|
},
|
||||||
|
needsUpdate: function (jax) {
|
||||||
|
var script = jax.SourceElement();
|
||||||
|
return (jax.originalText !== (script.text == "" ? script.innerHTML : script.text));
|
||||||
|
},
|
||||||
Register: function (mimetype) {
|
Register: function (mimetype) {
|
||||||
if (!HUB.config.inputJax) {HUB.config.inputJax = {}}
|
if (!HUB.inputJax) {HUB.inputJax = {}}
|
||||||
HUB.config.inputJax[mimetype] = this;
|
HUB.inputJax[mimetype] = this;
|
||||||
}
|
}
|
||||||
},{
|
},{
|
||||||
version: "1.1",
|
version: "1.1",
|
||||||
|
@ -1858,7 +1909,7 @@ MathJax.Hub.Startup = {
|
||||||
|
|
||||||
BASE.OutputJax = JAX.Subclass({
|
BASE.OutputJax = JAX.Subclass({
|
||||||
Register: function (mimetype) {
|
Register: function (mimetype) {
|
||||||
var jax = HUB.config.outputJax;
|
var jax = HUB.outputJax;
|
||||||
if (!jax[mimetype]) {jax[mimetype] = []}
|
if (!jax[mimetype]) {jax[mimetype] = []}
|
||||||
// If the output jax is earlier in the original configuration list, put it first here
|
// If the output jax is earlier in the original configuration list, put it first here
|
||||||
if (jax[mimetype].length && (this.id === HUB.config.menuSettings.renderer ||
|
if (jax[mimetype].length && (this.id === HUB.config.menuSettings.renderer ||
|
||||||
|
@ -1905,10 +1956,15 @@ MathJax.Hub.Startup = {
|
||||||
script.MathJax.state = this.STATE.OUTPUT;
|
script.MathJax.state = this.STATE.OUTPUT;
|
||||||
return HUB.Process(script,callback);
|
return HUB.Process(script,callback);
|
||||||
},
|
},
|
||||||
Remove: function () {
|
Remove: function (keep) {
|
||||||
this.outputJax.Remove(this);
|
BASE.OutputJax[this.outputJax].Remove(this);
|
||||||
|
if (!keep) {
|
||||||
HUB.signal.Post(["Remove Math",this.inputID]); // wait for this to finish?
|
HUB.signal.Post(["Remove Math",this.inputID]); // wait for this to finish?
|
||||||
this.Detach();
|
this.Detach();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
needsUpdate: function () {
|
||||||
|
return BASE.InputJax[this.inputJax].needsUpdate(this);
|
||||||
},
|
},
|
||||||
|
|
||||||
SourceElement: function () {return document.getElementById(this.inputID)},
|
SourceElement: function () {return document.getElementById(this.inputID)},
|
||||||
|
|
|
@ -262,6 +262,13 @@ MathJax.Hub.Config({
|
||||||
//
|
//
|
||||||
processEnvironments: true,
|
processEnvironments: true,
|
||||||
|
|
||||||
|
//
|
||||||
|
// Controls whether tex2jax processes \ref{...} commands outside
|
||||||
|
// of math mode. Set to "false" to prevent processing of \ref
|
||||||
|
// except within math mode.
|
||||||
|
//
|
||||||
|
processRefs: true,
|
||||||
|
|
||||||
//
|
//
|
||||||
// Controls whether tex2jax inserts MathJax_Preview spans to make a
|
// Controls whether tex2jax inserts MathJax_Preview spans to make a
|
||||||
// preview available, and what preview to use, when it locates in-line
|
// preview available, and what preview to use, when it locates in-line
|
||||||
|
@ -368,7 +375,20 @@ MathJax.Hub.Config({
|
||||||
// bold: ['{\\bf #1}', 1]
|
// bold: ['{\\bf #1}', 1]
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
Macros: {}
|
Macros: {},
|
||||||
|
|
||||||
|
//
|
||||||
|
// Equation numbering parameters.
|
||||||
|
//
|
||||||
|
equationNumbers: {
|
||||||
|
// formatNumber: function (n) {return n}, // format for equation number n
|
||||||
|
// formatTag: function (n) {return '('+n+')'}, // format for \tag and \eqref
|
||||||
|
// formatID: function (n) {return 'mjx-eqn-'+n}, // element ID to use for reference
|
||||||
|
// formatURL: function (n) {return '#mjx-eqn-'+escape(n)}, // URL to use for references
|
||||||
|
|
||||||
|
autoNumber: "none" // "AMS" for standard AMS environment numbering,
|
||||||
|
// or "all" to number all displayed equations
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function (HUB,HTML,AJAX,HTMLCSS,nMML) {
|
(function (HUB,HTML,AJAX,HTMLCSS,nMML) {
|
||||||
var VERSION = "1.1";
|
var VERSION = "1.1.1";
|
||||||
|
|
||||||
var CONFIG = HUB.CombineConfig("MathZoom",{
|
var CONFIG = HUB.CombineConfig("MathZoom",{
|
||||||
delay: 400, // mouse must be still this long (milliseconds)
|
delay: 400, // mouse must be still this long (milliseconds)
|
||||||
|
@ -148,8 +148,8 @@
|
||||||
if (parent.parentNode.className === "MathJax_MathContainer") {parent = parent.parentNode.parentNode}
|
if (parent.parentNode.className === "MathJax_MathContainer") {parent = parent.parentNode.parentNode}
|
||||||
var script = (String(parent.className).match(/^MathJax_(MathML|Display)$/) ? parent : math).nextSibling;
|
var script = (String(parent.className).match(/^MathJax_(MathML|Display)$/) ? parent : math).nextSibling;
|
||||||
var jax = HUB.getJaxFor(script), root = jax.root;
|
var jax = HUB.getJaxFor(script), root = jax.root;
|
||||||
var JAX = (HTMLCSS && jax.outputJax.isa(HTMLCSS.constructor) ? "HTMLCSS" :
|
var JAX = (HTMLCSS && jax.outputJax === "HTML-CSS" ? "HTMLCSS" :
|
||||||
(nMML && jax.outputJax.isa(nMML.constructor) ? "MathML" : null));
|
(nMML && jax.outputJax === "NativeMML" ? "MathML" : null));
|
||||||
if (!JAX) return; // FIXME: report an error?
|
if (!JAX) return; // FIXME: report an error?
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*
|
*
|
||||||
* ---------------------------------------------------------------------
|
* ---------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* Copyright (c) 2009 Design Science, Inc.
|
* Copyright (c) 2009-2011 Design Science, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -21,16 +21,30 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
MathJax.Extension["TeX/AMSmath"] = {
|
||||||
var VERSION = "1.1";
|
version: "1.1.1",
|
||||||
|
|
||||||
var MML = MathJax.ElementJax.mml;
|
number: 0, // current equation number
|
||||||
var TEX = MathJax.InputJax.TeX;
|
startNumber: 0, // current starting equation number (for when equation is restarted)
|
||||||
var TEXDEF = TEX.Definitions;
|
labels: {}, // the set of labels
|
||||||
var STACKITEM = TEX.Stack.Item;
|
eqlabels: {}, // labels in the current equation
|
||||||
|
refs: [] // array of jax with unresolved references
|
||||||
|
};
|
||||||
|
|
||||||
|
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
|
|
||||||
|
var MML = MathJax.ElementJax.mml,
|
||||||
|
TEX = MathJax.InputJax.TeX,
|
||||||
|
AMS = MathJax.Extension["TeX/AMSmath"];
|
||||||
|
|
||||||
|
var TEXDEF = TEX.Definitions,
|
||||||
|
STACKITEM = TEX.Stack.Item,
|
||||||
|
CONFIG = TEX.config.equationNumbers;
|
||||||
|
|
||||||
var COLS = function (W) {return W.join("em ") + "em"};
|
var COLS = function (W) {return W.join("em ") + "em"};
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
MathJax.Hub.Insert(TEXDEF,{
|
MathJax.Hub.Insert(TEXDEF,{
|
||||||
macros: {
|
macros: {
|
||||||
mathring: ['Accent','2DA'], // or 0x30A
|
mathring: ['Accent','2DA'], // or 0x30A
|
||||||
|
@ -54,6 +68,9 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
|
|
||||||
tag: 'HandleTag',
|
tag: 'HandleTag',
|
||||||
notag: 'HandleNoTag',
|
notag: 'HandleNoTag',
|
||||||
|
label: 'HandleLabel',
|
||||||
|
ref: 'HandleRef',
|
||||||
|
eqref: ['HandleRef',true],
|
||||||
|
|
||||||
substack: ['Macro','\\begin{subarray}{c}#1\\end{subarray}',1],
|
substack: ['Macro','\\begin{subarray}{c}#1\\end{subarray}',1],
|
||||||
|
|
||||||
|
@ -101,7 +118,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
gathered: ['Array',null,null,null,'c',null,".5em",'D'],
|
gathered: ['Array',null,null,null,'c',null,".5em",'D'],
|
||||||
|
|
||||||
subarray: ['Array',null,null,null,null,COLS([0,0,0,0]),"0.1em",'S',1],
|
subarray: ['Array',null,null,null,null,COLS([0,0,0,0]),"0.1em",'S',1],
|
||||||
smallmatrix: ['Array',null,null,null,'c',COLS([1/3]),".2em",'S',1]
|
smallmatrix: ['Array',null,null,null,'c',COLS([1/3]),".2em",'S',1],
|
||||||
|
|
||||||
|
'equation': ['EquationBegin','Equation',true],
|
||||||
|
'equation*': ['EquationBegin','EquationStar',false]
|
||||||
},
|
},
|
||||||
|
|
||||||
delimiter: {
|
delimiter: {
|
||||||
|
@ -113,21 +133,50 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
TEX.Parse.Augment({
|
TEX.Parse.Augment({
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add the tag to the environment to be added to the table row later
|
* Add the tag to the environment (to be added to the table row later)
|
||||||
*/
|
*/
|
||||||
HandleTag: function (name) {
|
HandleTag: function (name) {
|
||||||
var arg = this.trimSpaces(this.GetArgument(name));
|
var arg = this.trimSpaces(this.GetArgument(name)), tag = arg;
|
||||||
if (arg === "*") {arg = this.GetArgument(name)} else {arg = "("+arg+")"}
|
if (arg === "*") {tag = arg = this.GetArgument(name)} else {arg = CONFIG.formatTag(arg)}
|
||||||
if (this.stack.global.notag)
|
var global = this.stack.global; global.tagID = tag;
|
||||||
{TEX.Error(name+" not allowed in "+this.stack.global.notag+" environment")}
|
if (global.notags) {TEX.Error(name+" not allowed in "+global.notags+" environment")}
|
||||||
if (this.stack.global.tag) {TEX.Error("Multiple "+name)}
|
if (global.tag) {TEX.Error("Multiple "+name)}
|
||||||
this.stack.global.tag = MML.mtd.apply(MML,this.InternalMath(arg));
|
global.tag = MML.mtd.apply(MML,this.InternalMath(arg)).With({id:CONFIG.formatID(tag)});
|
||||||
},
|
},
|
||||||
HandleNoTag: function (name) {
|
HandleNoTag: function (name) {
|
||||||
if (this.stack.global.tag) {delete this.stack.global.tag}
|
if (this.stack.global.tag) {delete this.stack.global.tag}
|
||||||
|
this.stack.global.notag = true; // prevent auto-tagging
|
||||||
|
},
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Record a label name for a tag
|
||||||
|
*/
|
||||||
|
HandleLabel: function (name) {
|
||||||
|
var global = this.stack.global, label = this.GetArgument(name);
|
||||||
|
if (!AMS.refUpdate) {
|
||||||
|
if (global.label) {TEX.Error("Multiple "+name+"'s")}
|
||||||
|
global.label = label;
|
||||||
|
if (AMS.labels[label] || AMS.eqlabels[label]) {TEX.Error("Label '"+label+"' mutiply defined")}
|
||||||
|
AMS.eqlabels[label] = "???"; // will be replaced by tag value later
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Handle a label reference
|
||||||
|
*/
|
||||||
|
HandleRef: function (name,eqref) {
|
||||||
|
var label = this.GetArgument(name);
|
||||||
|
var ref = AMS.labels[label] || AMS.eqlabels[label];
|
||||||
|
if (!ref) {ref = "??"; AMS.badref = !AMS.refUpdate}
|
||||||
|
var tag = ref; if (eqref) {tag = CONFIG.formatTag(tag)}
|
||||||
|
this.Push(MML.mrow.apply(MML,this.InternalMath(tag)).With({
|
||||||
|
href:CONFIG.formatURL(ref), "class":"MathJax_ref"
|
||||||
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -202,7 +251,6 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
if (STYLE === "D") {frac.displaystyle = true; frac.scriptlevel = 0}
|
if (STYLE === "D") {frac.displaystyle = true; frac.scriptlevel = 0}
|
||||||
else {frac.displaystyle = false; frac.scriptlevel = style - 1}
|
else {frac.displaystyle = false; frac.scriptlevel = style - 1}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Push(frac);
|
this.Push(frac);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -210,8 +258,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
* Implements multline environment (mostly handled through STACKITEM below)
|
* Implements multline environment (mostly handled through STACKITEM below)
|
||||||
*/
|
*/
|
||||||
Multline: function (begin,numbered) {
|
Multline: function (begin,numbered) {
|
||||||
this.Push(begin);
|
this.Push(begin); this.checkEqnEnv();
|
||||||
return STACKITEM.multline().With({
|
return STACKITEM.multline(numbered,this.stack).With({
|
||||||
arraydef: {
|
arraydef: {
|
||||||
displaystyle: true,
|
displaystyle: true,
|
||||||
rowspacing: ".5em",
|
rowspacing: ".5em",
|
||||||
|
@ -226,7 +274,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
* Handle AMS aligned environments
|
* Handle AMS aligned environments
|
||||||
*/
|
*/
|
||||||
AMSarray: function (begin,numbered,taggable,align,spacing) {
|
AMSarray: function (begin,numbered,taggable,align,spacing) {
|
||||||
this.Push(begin);
|
this.Push(begin); if (taggable) {this.checkEqnEnv()}
|
||||||
align = align.replace(/[^clr]/g,'').split('').join(' ');
|
align = align.replace(/[^clr]/g,'').split('').join(' ');
|
||||||
align = align.replace(/l/g,'left').replace(/r/g,'right').replace(/c/g,'center');
|
align = align.replace(/l/g,'left').replace(/r/g,'right').replace(/c/g,'center');
|
||||||
return STACKITEM.AMSarray(begin.name,numbered,taggable,this.stack).With({
|
return STACKITEM.AMSarray(begin.name,numbered,taggable,this.stack).With({
|
||||||
|
@ -242,6 +290,9 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Handle alignat environments
|
||||||
|
*/
|
||||||
AlignAt: function (begin,numbered,taggable) {
|
AlignAt: function (begin,numbered,taggable) {
|
||||||
var n = this.GetArgument("\\begin{"+begin.name+"}");
|
var n = this.GetArgument("\\begin{"+begin.name+"}");
|
||||||
if (n.match(/[^0-9]/)) {TEX.Error("Argument to \\begin{"+begin.name+"} must me a positive integer")}
|
if (n.match(/[^0-9]/)) {TEX.Error("Argument to \\begin{"+begin.name+"} must me a positive integer")}
|
||||||
|
@ -252,6 +303,27 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
return this.Array(begin,null,null,align,spacing,".5em",'D');
|
return this.Array(begin,null,null,align,spacing,".5em",'D');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Handle equation environment
|
||||||
|
*/
|
||||||
|
EquationBegin: function (begin,force) {
|
||||||
|
this.checkEqnEnv();
|
||||||
|
this.stack.global.forcetag = (force && CONFIG.autoNumber !== "none");
|
||||||
|
return begin;
|
||||||
|
},
|
||||||
|
EquationStar: function (begin,row) {
|
||||||
|
this.stack.global.tagged = true; // prevent automatic tagging
|
||||||
|
return row;
|
||||||
|
},
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check for bad nesting of equation environments
|
||||||
|
*/
|
||||||
|
checkEqnEnv: function () {
|
||||||
|
if (this.stack.global.eqnenv) {TEX.Error("Erroneous nesting of equation structures")}
|
||||||
|
this.stack.global.eqnenv = true;
|
||||||
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Handle multiple integrals (make a mathop if followed by limits)
|
* Handle multiple integrals (make a mathop if followed by limits)
|
||||||
*/
|
*/
|
||||||
|
@ -268,6 +340,9 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
this.i = 0;
|
this.i = 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Handle stretchable arrows
|
||||||
|
*/
|
||||||
xArrow: function (name,chr,l,r) {
|
xArrow: function (name,chr,l,r) {
|
||||||
var def = {width: "+"+(l+r)+"mu", lspace: l+"mu"};
|
var def = {width: "+"+(l+r)+"mu", lspace: l+"mu"};
|
||||||
var bot = this.GetBrackets(name),
|
var bot = this.GetBrackets(name),
|
||||||
|
@ -295,11 +370,43 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
STACKITEM.Augment({
|
||||||
|
/*
|
||||||
|
* Increment equation number and form tag mtd element
|
||||||
|
*/
|
||||||
|
autoTag: function () {
|
||||||
|
var global = this.global;
|
||||||
|
if (!global.notag) {
|
||||||
|
AMS.number++; global.tagID = CONFIG.formatNumber(AMS.number.toString());
|
||||||
|
var mml = TEX.Parse("\\text{"+CONFIG.formatTag(global.tagID)+"}",{}).mml();
|
||||||
|
global.tag = MML.mtd(mml.With({id:CONFIG.formatID(global.tagID)}));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get the tag and record the label, if any
|
||||||
|
*/
|
||||||
|
getTag: function () {
|
||||||
|
var global = this.global, tag = global.tag; global.tagged = true;
|
||||||
|
if (global.label) {AMS.eqlabels[global.label] = global.tagID}
|
||||||
|
delete global.tag; delete global.tagID; delete global.label;
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Implement multline environment via a STACKITEM
|
* Implement multline environment via a STACKITEM
|
||||||
*/
|
*/
|
||||||
STACKITEM.multline = STACKITEM.array.Subclass({
|
STACKITEM.multline = STACKITEM.array.Subclass({
|
||||||
type: "multline",
|
type: "multline",
|
||||||
|
Init: function (numbered,stack) {
|
||||||
|
this.SUPER(arguments).Init.apply(this);
|
||||||
|
this.numbered = (numbered && CONFIG.autoNumber !== "none");
|
||||||
|
this.save = {notag: stack.global.notag};
|
||||||
|
stack.global.tagged = !numbered && !stack.global.forcetag; // prevent automatic tagging in starred environments
|
||||||
|
},
|
||||||
EndEntry: function () {
|
EndEntry: function () {
|
||||||
var mtd = MML.mtd.apply(MML,this.data);
|
var mtd = MML.mtd.apply(MML,this.data);
|
||||||
if (this.data.shove) {mtd.columnalign = this.data.shove}
|
if (this.data.shove) {mtd.columnalign = this.data.shove}
|
||||||
|
@ -317,37 +424,46 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
if (!this.table[0][0].columnalign) {this.table[0][0].columnalign = MML.ALIGN.LEFT}
|
if (!this.table[0][0].columnalign) {this.table[0][0].columnalign = MML.ALIGN.LEFT}
|
||||||
if (!this.table[m][0].columnalign) {this.table[m][0].columnalign = MML.ALIGN.RIGHT}
|
if (!this.table[m][0].columnalign) {this.table[m][0].columnalign = MML.ALIGN.RIGHT}
|
||||||
var mtr = MML.mtr;
|
var mtr = MML.mtr;
|
||||||
if (this.global.tag) {
|
if (!this.global.tag && this.numbered) {this.autoTag()}
|
||||||
this.table[0] = [this.global.tag].concat(this.table[0]);
|
if (this.global.tag && !this.global.notags) {
|
||||||
delete this.global.tag; mtr = MML.mlabeledtr;
|
this.table[0] = [this.getTag()].concat(this.table[0]);
|
||||||
|
mtr = MML.mlabeledtr;
|
||||||
}
|
}
|
||||||
this.table[0] = mtr.apply(MML,this.table[0]);
|
this.table[0] = mtr.apply(MML,this.table[0]);
|
||||||
for (i = 1, m = this.table.length; i < m; i++)
|
for (i = 1, m = this.table.length; i < m; i++)
|
||||||
{this.table[i] = MML.mtr.apply(MML,this.table[i])}
|
{this.table[i] = MML.mtr.apply(MML,this.table[i])}
|
||||||
}
|
}
|
||||||
|
this.global.notag = this.save.notag;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Save data about numbering and taging equations, and add
|
||||||
|
* tags at the ends of rows.
|
||||||
|
*/
|
||||||
STACKITEM.AMSarray = STACKITEM.array.Subclass({
|
STACKITEM.AMSarray = STACKITEM.array.Subclass({
|
||||||
type: "AMSarray",
|
type: "AMSarray",
|
||||||
Init: function (name,numbered,taggable,stack) {
|
Init: function (name,numbered,taggable,stack) {
|
||||||
this.SUPER(arguments).Init.apply(this);
|
this.SUPER(arguments).Init.apply(this);
|
||||||
this.numbered = numbered;
|
this.numbered = (numbered && CONFIG.autoNumber !== "none");
|
||||||
this.save_notag = stack.global.notag;
|
this.save = {notags: stack.global.notags, notag: stack.global.notag};
|
||||||
stack.global.notag = (taggable ? null : name);
|
stack.global.notags = (taggable ? null : name);
|
||||||
|
stack.global.tagged = !numbered && !stack.global.forcetag; // prevent automatic tagging in starred environments
|
||||||
},
|
},
|
||||||
EndRow: function () {
|
EndRow: function () {
|
||||||
var mtr = MML.mtr;
|
var mtr = MML.mtr;
|
||||||
if (this.global.tag) {
|
if (!this.global.tag && this.numbered) {this.autoTag()}
|
||||||
this.row = [this.global.tag].concat(this.row);
|
if (this.global.tag &&! this.global.notags) {
|
||||||
|
this.row = [this.getTag()].concat(this.row);
|
||||||
mtr = MML.mlabeledtr;
|
mtr = MML.mlabeledtr;
|
||||||
delete this.global.tag;
|
|
||||||
}
|
}
|
||||||
|
if (this.numbered) {delete this.global.notag}
|
||||||
this.table.push(mtr.apply(MML,this.row)); this.row = [];
|
this.table.push(mtr.apply(MML,this.row)); this.row = [];
|
||||||
},
|
},
|
||||||
EndTable: function () {
|
EndTable: function () {
|
||||||
this.SUPER(arguments).EndTable.call(this);
|
this.SUPER(arguments).EndTable.call(this);
|
||||||
this.global.notag = this.save_notag;
|
this.global.notags = this.save.notags;
|
||||||
|
this.global.notag = this.save.notag;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -358,9 +474,11 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
oldCheckItem: STACKITEM.start.prototype.checkItem,
|
oldCheckItem: STACKITEM.start.prototype.checkItem,
|
||||||
checkItem: function (item) {
|
checkItem: function (item) {
|
||||||
if (item.type === "stop") {
|
if (item.type === "stop") {
|
||||||
var mml = this.mmlData();
|
var mml = this.mmlData(), global = this.global;
|
||||||
if (this.global.tag) {
|
if (AMS.display && !global.tag && !global.tagged && !global.isInner &&
|
||||||
var row = [this.global.tag,MML.mtd(mml)]; delete this.global.tag;
|
(CONFIG.autoNumber === "all" || global.forcetag)) {this.autoTag()}
|
||||||
|
if (global.tag) {
|
||||||
|
var row = [this.getTag(),MML.mtd(mml)];
|
||||||
var def = {
|
var def = {
|
||||||
side: TEX.config.TagSide,
|
side: TEX.config.TagSide,
|
||||||
minlabelspacing: TEX.config.TagIndent,
|
minlabelspacing: TEX.config.TagIndent,
|
||||||
|
@ -383,10 +501,44 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||||
}
|
}
|
||||||
return STACKITEM.mml(mml);
|
return STACKITEM.mml(mml);
|
||||||
}
|
}
|
||||||
return this.SUPER(arguments).checkItem.call(this,item);
|
return this.oldCheckItem.call(this,item);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add pre- and post-filters to handle the equation number maintainance.
|
||||||
|
*/
|
||||||
|
TEX.prefilterHooks.Add(function (data) {
|
||||||
|
AMS.display = data.display;
|
||||||
|
AMS.number = AMS.startNumber; // reset equation numbers (in case the equation restarted)
|
||||||
|
AMS.eqlabels = {}; AMS.badref = false;
|
||||||
|
if (AMS.refUpdate) {AMS.number = data.script.MathJax.startNumber}
|
||||||
|
});
|
||||||
|
TEX.postfilterHooks.Add(function (data) {
|
||||||
|
data.script.MathJax.startNumber = AMS.startNumber;
|
||||||
|
AMS.startNumber = AMS.number; // equation numbers for next equation
|
||||||
|
MathJax.Hub.Insert(AMS.labels,AMS.eqlabels); // save labels from this equation
|
||||||
|
if (AMS.badref && !data.math.texError) {AMS.refs.push(data.script)} // reprocess later
|
||||||
|
});
|
||||||
|
|
||||||
|
MathJax.Hub.Register.MessageHook("Begin Math Input",function () {
|
||||||
|
AMS.refs = []; // array of jax with bad references
|
||||||
|
AMS.refUpdate = false;
|
||||||
|
});
|
||||||
|
MathJax.Hub.Register.MessageHook("End Math Input",function (message) {
|
||||||
|
if (AMS.refs.length) {
|
||||||
|
AMS.refUpdate = true;
|
||||||
|
for (var i = 0, m = AMS.refs.length; i < m; i++)
|
||||||
|
{AMS.refs[i].MathJax.state = MathJax.ElementJax.STATE.UPDATE}
|
||||||
|
return MathJax.Hub.processInput(AMS.refs);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
MathJax.Hub.Startup.signal.Post("TeX AMSmath Ready");
|
MathJax.Hub.Startup.signal.Post("TeX AMSmath Ready");
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
MathJax.Extension.tex2jax = {
|
MathJax.Extension.tex2jax = {
|
||||||
version: "1.1.3",
|
version: "1.1.4",
|
||||||
config: {
|
config: {
|
||||||
inlineMath: [ // The start/stop pairs for in-line math
|
inlineMath: [ // The start/stop pairs for in-line math
|
||||||
// ['$','$'], // (comment out any you don't want, or add your own, but
|
// ['$','$'], // (comment out any you don't want, or add your own, but
|
||||||
|
@ -56,6 +56,8 @@ MathJax.Extension.tex2jax = {
|
||||||
processEnvironments: true, // set to true to process \begin{xxx}...\end{xxx} outside
|
processEnvironments: true, // set to true to process \begin{xxx}...\end{xxx} outside
|
||||||
// of math mode, false to prevent that
|
// of math mode, false to prevent that
|
||||||
|
|
||||||
|
processRefs: true, // set to true to process \ref{...} outside of math mode
|
||||||
|
|
||||||
preview: "TeX" // set to "none" to not insert MathJax_Preview spans
|
preview: "TeX" // set to "none" to not insert MathJax_Preview spans
|
||||||
// or set to an array specifying an HTML snippet
|
// or set to an array specifying an HTML snippet
|
||||||
// to use the same preview for every equation.
|
// to use the same preview for every equation.
|
||||||
|
@ -98,7 +100,8 @@ MathJax.Extension.tex2jax = {
|
||||||
this.start = new RegExp(
|
this.start = new RegExp(
|
||||||
starts.sort(this.sortLength).join("|") +
|
starts.sort(this.sortLength).join("|") +
|
||||||
(config.processEnvironments ? "|\\\\begin\\{([^}]*)\\}" : "") +
|
(config.processEnvironments ? "|\\\\begin\\{([^}]*)\\}" : "") +
|
||||||
(config.processEscapes ? "|\\\\*\\\\\\\$" : ""), "g"
|
(config.processEscapes ? "|\\\\*\\\\\\\$" : "") +
|
||||||
|
(config.processRefs ? "|\\\\(eq)?ref\\{[^}]*\\}" : ""), "g"
|
||||||
);
|
);
|
||||||
this.skipTags = new RegExp("^("+config.skipTags.join("|")+")$","i");
|
this.skipTags = new RegExp("^("+config.skipTags.join("|")+")$","i");
|
||||||
this.ignoreClass = new RegExp("(^| )("+config.ignoreClass+")( |$)");
|
this.ignoreClass = new RegExp("(^| )("+config.ignoreClass+")( |$)");
|
||||||
|
@ -172,6 +175,12 @@ MathJax.Extension.tex2jax = {
|
||||||
isBeginEnd: true
|
isBeginEnd: true
|
||||||
};
|
};
|
||||||
this.switchPattern(this.endPattern(this.search.end));
|
this.switchPattern(this.endPattern(this.search.end));
|
||||||
|
} else if (match[0].substr(0,4) === "\\ref" || match[0].substr(0,6) === "\\eqref") {
|
||||||
|
this.search = {
|
||||||
|
mode: "", end: "", open: element,
|
||||||
|
olen: 0, opos: this.pattern.lastIndex - match[0].length,
|
||||||
|
}
|
||||||
|
return this.endMatch([""],element);
|
||||||
} else { // escaped dollar signs
|
} else { // escaped dollar signs
|
||||||
// put $ in a span so it doesn't get processed again
|
// put $ in a span so it doesn't get processed again
|
||||||
// split off backslashes so they don't get removed later
|
// split off backslashes so they don't get removed later
|
||||||
|
|
|
@ -24,14 +24,23 @@
|
||||||
|
|
||||||
MathJax.InputJax.TeX = MathJax.InputJax({
|
MathJax.InputJax.TeX = MathJax.InputJax({
|
||||||
id: "TeX",
|
id: "TeX",
|
||||||
version: "1.1.2",
|
version: "1.1.3",
|
||||||
directory: MathJax.InputJax.directory + "/TeX",
|
directory: MathJax.InputJax.directory + "/TeX",
|
||||||
extensionDir: MathJax.InputJax.extensionDir + "/TeX",
|
extensionDir: MathJax.InputJax.extensionDir + "/TeX",
|
||||||
|
|
||||||
config: {
|
config: {
|
||||||
TagSide: "right",
|
TagSide: "right",
|
||||||
TagIndent: "0.8em",
|
TagIndent: "0.8em",
|
||||||
MultLineWidth: "85%"
|
MultLineWidth: "85%",
|
||||||
|
|
||||||
|
equationNumbers: {
|
||||||
|
autoNumber: "none", // "AMS" for standard AMS numbering,
|
||||||
|
// or "all" for all displayed equations
|
||||||
|
formatNumber: function (n) {return n},
|
||||||
|
formatTag: function (n) {return '('+n+')'},
|
||||||
|
formatID: function (n) {return 'mjx-eqn-'+n},
|
||||||
|
formatURL: function (n) {return '#mjx-eqn-'+escape(n)}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
MathJax.InputJax.TeX.Register("math/tex");
|
MathJax.InputJax.TeX.Register("math/tex");
|
||||||
|
|
|
@ -23,13 +23,13 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function (TEX) {
|
(function (TEX,HUB,AJAX) {
|
||||||
var TRUE = true, FALSE = false, MML, NBSP = String.fromCharCode(0xA0);
|
var TRUE = true, FALSE = false, MML, NBSP = String.fromCharCode(0xA0);
|
||||||
|
|
||||||
var STACK = MathJax.Object.Subclass({
|
var STACK = MathJax.Object.Subclass({
|
||||||
Init: function (env) {
|
Init: function (env,inner) {
|
||||||
this.global = {};
|
this.global = {isInner: inner};
|
||||||
this.data = [STACKITEM.start().With({global: this.global})];
|
this.data = [STACKITEM.start(this.global)];
|
||||||
if (env) {this.data[0].env = env}
|
if (env) {this.data[0].env = env}
|
||||||
this.env = this.data[0].env;
|
this.env = this.data[0].env;
|
||||||
},
|
},
|
||||||
|
@ -102,6 +102,10 @@
|
||||||
|
|
||||||
STACKITEM.start = STACKITEM.Subclass({
|
STACKITEM.start = STACKITEM.Subclass({
|
||||||
type: "start", isOpen: TRUE,
|
type: "start", isOpen: TRUE,
|
||||||
|
Init: function (global) {
|
||||||
|
this.SUPER(arguments).Init.call(this);
|
||||||
|
this.global = global;
|
||||||
|
},
|
||||||
checkItem: function (item) {
|
checkItem: function (item) {
|
||||||
if (item.type === "stop") {return STACKITEM.mml(this.mmlData())}
|
if (item.type === "stop") {return STACKITEM.mml(this.mmlData())}
|
||||||
return this.SUPER(arguments).checkItem.call(this,item);
|
return this.SUPER(arguments).checkItem.call(this,item);
|
||||||
|
@ -291,7 +295,7 @@
|
||||||
var TEXDEF = {};
|
var TEXDEF = {};
|
||||||
var STARTUP = function () {
|
var STARTUP = function () {
|
||||||
MML = MathJax.ElementJax.mml;
|
MML = MathJax.ElementJax.mml;
|
||||||
MathJax.Hub.Insert(TEXDEF,{
|
HUB.Insert(TEXDEF,{
|
||||||
|
|
||||||
// patterns for letters and numbers
|
// patterns for letters and numbers
|
||||||
letter: /[a-z]/i,
|
letter: /[a-z]/i,
|
||||||
|
@ -846,8 +850,10 @@
|
||||||
|
|
||||||
tag: ['Extension','AMSmath'],
|
tag: ['Extension','AMSmath'],
|
||||||
notag: ['Extension','AMSmath'],
|
notag: ['Extension','AMSmath'],
|
||||||
label: ['Macro','',1], // not implemented yet
|
label: ['Extension','AMSmath'],
|
||||||
nonumber: ['Macro',''], // not implemented yet
|
ref: ['Extension','AMSmath'],
|
||||||
|
eqref: ['Extension','AMSmath'],
|
||||||
|
nonumber: ['Macro','\\notag'],
|
||||||
|
|
||||||
// Extensions to TeX
|
// Extensions to TeX
|
||||||
unicode: ['Extension','unicode'],
|
unicode: ['Extension','unicode'],
|
||||||
|
@ -917,9 +923,8 @@
|
||||||
Init: function (string,env) {
|
Init: function (string,env) {
|
||||||
this.string = string; this.i = 0; this.macroCount = 0;
|
this.string = string; this.i = 0; this.macroCount = 0;
|
||||||
var ENV; if (env) {ENV = {}; for (var id in env) {if (env.hasOwnProperty(id)) {ENV[id] = env[id]}}}
|
var ENV; if (env) {ENV = {}; for (var id in env) {if (env.hasOwnProperty(id)) {ENV[id] = env[id]}}}
|
||||||
this.stack = TEX.Stack(ENV);
|
this.stack = TEX.Stack(ENV,!!env);
|
||||||
this.Parse();
|
this.Parse(); this.Push(STACKITEM.stop());
|
||||||
this.Push(STACKITEM.stop());
|
|
||||||
},
|
},
|
||||||
Parse: function () {
|
Parse: function () {
|
||||||
var c;
|
var c;
|
||||||
|
@ -1344,9 +1349,9 @@
|
||||||
if (name && !typeof(name) === "string") {name = name.name}
|
if (name && !typeof(name) === "string") {name = name.name}
|
||||||
file = TEX.extensionDir+"/"+file;
|
file = TEX.extensionDir+"/"+file;
|
||||||
if (!file.match(/\.js$/)) {file += ".js"}
|
if (!file.match(/\.js$/)) {file += ".js"}
|
||||||
if (!MathJax.Ajax.loaded[MathJax.Ajax.fileURL(file)]) {
|
if (!AJAX.loaded[AJAX.fileURL(file)]) {
|
||||||
if (name != null) {delete TEXDEF[array || 'macros'][name.replace(/^\\/,"")]}
|
if (name != null) {delete TEXDEF[array || 'macros'][name.replace(/^\\/,"")]}
|
||||||
MathJax.Hub.RestartAfter(MathJax.Ajax.Require(file));
|
HUB.RestartAfter(AJAX.Require(file));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1643,30 +1648,38 @@
|
||||||
InternalMath: function (text,level) {
|
InternalMath: function (text,level) {
|
||||||
var def = {displaystyle: FALSE}; if (level != null) {def.scriptlevel = level}
|
var def = {displaystyle: FALSE}; if (level != null) {def.scriptlevel = level}
|
||||||
if (this.stack.env.font) {def.mathvariant = this.stack.env.font}
|
if (this.stack.env.font) {def.mathvariant = this.stack.env.font}
|
||||||
if (!text.match(/\$|\\\(/)) {return [this.InternalText(text,def)]}
|
if (!text.match(/\$|\\\(|\\(eq)?ref\s*\{/)) {return [this.InternalText(text,def)]}
|
||||||
var i = 0, k = 0, c, match = '';
|
var i = 0, k = 0, c, match = '';
|
||||||
var mml = [];
|
var mml = [];
|
||||||
while (i < text.length) {
|
while (i < text.length) {
|
||||||
c = text.charAt(i++);
|
c = text.charAt(i++);
|
||||||
if (c === '$') {
|
if (c === '$') {
|
||||||
if (match === '$') {
|
if (match === '$') {
|
||||||
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().With(def)));
|
||||||
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))}
|
||||||
match = '$'; k = i;
|
match = '$'; k = i;
|
||||||
}
|
}
|
||||||
|
} else if (c === '}' && match === '}') {
|
||||||
|
mml.push(MML.TeXAtom(TEX.Parse(text.slice(k,i),{}).mml().With(def)));
|
||||||
|
match = ''; k = i;
|
||||||
} else if (c === '\\') {
|
} else if (c === '\\') {
|
||||||
|
if (match === '' && text.substr(i).match(/^(eq)?ref\s*\{/)) {
|
||||||
|
if (k < i-1) {mml.push(this.InternalText(text.slice(k,i-1),def))}
|
||||||
|
match = '}'; k = i-1;
|
||||||
|
} else {
|
||||||
c = text.charAt(i++);
|
c = text.charAt(i++);
|
||||||
if (c === '(' && match === '') {
|
if (c === '(' && match === '') {
|
||||||
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 === ')') {
|
} else if (c === ')' && match === ')') {
|
||||||
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().With(def)));
|
||||||
match = ''; k = i;
|
match = ''; k = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (match !== '') {TEX.Error("Math not terminated in text box")}
|
if (match !== '') {TEX.Error("Math not terminated in text box")}
|
||||||
if (k < text.length) {mml.push(this.InternalText(text.slice(k),def))}
|
if (k < text.length) {mml.push(this.InternalText(text.slice(k),def))}
|
||||||
return mml;
|
return mml;
|
||||||
|
@ -1720,42 +1733,75 @@
|
||||||
MAXBUFFER: 5*1024 // maximum size of TeX string to process
|
MAXBUFFER: 5*1024 // maximum size of TeX string to process
|
||||||
},
|
},
|
||||||
|
|
||||||
|
prefilterHooks: MathJax.Callback.Hooks(true), // hooks to run before processing TeX
|
||||||
|
postfilterHooks: MathJax.Callback.Hooks(true), // hooks to run after processing TeX
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check if AMSmath extension must be loaded and push
|
||||||
|
// it on the extensions array, if needed
|
||||||
|
//
|
||||||
|
Config: function () {
|
||||||
|
this.SUPER(arguments).Config.apply(this,arguments);
|
||||||
|
if (this.config.equationNumbers.autoNumber !== "none") {
|
||||||
|
if (!this.config.extensions) {this.config.extensions = []}
|
||||||
|
this.config.extensions.push("AMSmath.js");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//
|
||||||
|
// Convert TeX to ElementJax
|
||||||
|
//
|
||||||
Translate: function (script) {
|
Translate: function (script) {
|
||||||
var mml, math = script.innerHTML.replace(/^\s+/,"").replace(/\s+$/,"");
|
var mml, isError = false, math = script.innerHTML.replace(/^\s+/,"").replace(/\s+$/,"");
|
||||||
if (MathJax.Hub.Browser.isKonqueror)
|
var display = (script.type.replace(/\n/g," ").match(/(;|\s|\n)mode\s*=\s*display(;|\s|\n|$)/) != null);
|
||||||
{math = math.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}
|
var data = {math:math, display:display, script:script};
|
||||||
var displaystyle =
|
this.prefilterHooks.Execute(data); math = data.math;
|
||||||
(script.type.replace(/\n/g," ").match(/(;|\s|\n)mode\s*=\s*display(;|\s|\n|$)/) != null);
|
|
||||||
math = TEX.prefilterMath(math,displaystyle,script);
|
|
||||||
try {
|
try {
|
||||||
mml = TEX.Parse(math).mml();
|
mml = TEX.Parse(math).mml();
|
||||||
// mml = MML.semantics(mml,MML.annotation(math).With({encoding:"application:x-tex"}));
|
// mml = MML.semantics(mml,MML.annotation(math).With({encoding:"application:x-tex"}));
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
if (!err.texError) {throw err}
|
if (!err.texError) {throw err}
|
||||||
mml = this.formatError(err,math,displaystyle,script);
|
mml = this.formatError(err,math,display,script);
|
||||||
|
isError = true;
|
||||||
}
|
}
|
||||||
if (mml.inferred) {mml = MML.apply(MathJax.ElementJax,mml.data)} else {mml = MML(mml)}
|
if (mml.inferred) {mml = MML.apply(MathJax.ElementJax,mml.data)} else {mml = MML(mml)}
|
||||||
if (displaystyle) {mml.root.display = "block"}
|
if (display) {mml.root.display = "block"}
|
||||||
return this.postfilterMath(mml,displaystyle,script);
|
if (isError) {mml.texError = true}
|
||||||
|
data.math = mml; this.postfilterHooks.Execute(data);
|
||||||
|
return data.math;
|
||||||
},
|
},
|
||||||
prefilterMath: function (math,displaystyle,script) {
|
prefilterMath: function (data) {
|
||||||
|
// Konqueror incorrectly quotes these characters in script.innerHTML
|
||||||
|
if (HUB.Browser.isKonqueror)
|
||||||
|
{data.math = data.math.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}
|
||||||
// avoid parsing super- and subscript numbers as a unit
|
// avoid parsing super- and subscript numbers as a unit
|
||||||
return math.replace(/([_^]\s*\d)([0-9.,])/g,"$1 $2");
|
data.math = data.math.replace(/([_^]\s*\d)([0-9.,])/g,"$1 $2");
|
||||||
},
|
},
|
||||||
postfilterMath: function (math,displaystyle,script) {
|
postfilterMath: function (data) {
|
||||||
this.combineRelations(math.root);
|
this.combineRelations(data.math.root);
|
||||||
return math;
|
|
||||||
},
|
},
|
||||||
formatError: function (err,math,displaystyle,script) {
|
formatError: function (err,math,display,script) {
|
||||||
return MML.merror(err.message.replace(/\n.*/,""));
|
return MML.merror(err.message.replace(/\n.*/,""));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//
|
||||||
|
// Produce an error and stop processing this equation
|
||||||
|
//
|
||||||
Error: function (message) {
|
Error: function (message) {
|
||||||
throw MathJax.Hub.Insert(Error(message),{texError: TRUE});
|
throw HUB.Insert(Error(message),{texError: TRUE});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//
|
||||||
|
// Add a user-defined macro to the macro list
|
||||||
|
//
|
||||||
Macro: function (name,def,argn) {
|
Macro: function (name,def,argn) {
|
||||||
TEXDEF.macros[name] = ['Macro'].concat([].slice.call(arguments,1));
|
TEXDEF.macros[name] = ['Macro'].concat([].slice.call(arguments,1));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//
|
||||||
|
// Combine adjacent <mo> elements that are relations
|
||||||
|
// (since MathML treats the spacing very differently)
|
||||||
|
//
|
||||||
combineRelations: function (mml) {
|
combineRelations: function (mml) {
|
||||||
for (var i = 0, m = mml.data.length; i < m; i++) {
|
for (var i = 0, m = mml.data.length; i < m; i++) {
|
||||||
if (mml.data[i]) {
|
if (mml.data[i]) {
|
||||||
|
@ -1774,6 +1820,12 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//
|
||||||
|
// Add the default filters
|
||||||
|
//
|
||||||
|
TEX.prefilterHooks.Add(["prefilterMath",TEX]);
|
||||||
|
TEX.postfilterHooks.Add(["postfilterMath",TEX]);
|
||||||
|
|
||||||
TEX.loadComplete("jax.js");
|
TEX.loadComplete("jax.js");
|
||||||
|
|
||||||
})(MathJax.InputJax.TeX);
|
})(MathJax.InputJax.TeX,MathJax.Hub,MathJax.Ajax);
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
MathJax.OutputJax["HTML-CSS"] = MathJax.OutputJax({
|
MathJax.OutputJax["HTML-CSS"] = MathJax.OutputJax({
|
||||||
id: "HTML-CSS",
|
id: "HTML-CSS",
|
||||||
version: "1.1.8",
|
version: "1.1.9",
|
||||||
directory: MathJax.OutputJax.directory + "/HTML-CSS",
|
directory: MathJax.OutputJax.directory + "/HTML-CSS",
|
||||||
extensionDir: MathJax.OutputJax.extensionDir + "/HTML-CSS",
|
extensionDir: MathJax.OutputJax.extensionDir + "/HTML-CSS",
|
||||||
autoloadDir: MathJax.OutputJax.directory + "/HTML-CSS/autoload",
|
autoloadDir: MathJax.OutputJax.directory + "/HTML-CSS/autoload",
|
||||||
|
@ -110,7 +110,7 @@ MathJax.Hub.Register.StartupHook("End Config",[function (HUB,HTMLCSS) {
|
||||||
minBrowserTranslate: function (script) {
|
minBrowserTranslate: function (script) {
|
||||||
var MJ = HUB.getJaxFor(script), text = ["[Math]"], delim;
|
var MJ = HUB.getJaxFor(script), text = ["[Math]"], delim;
|
||||||
var span = document.createElement("span",{className: "MathJax_Preview"});
|
var span = document.createElement("span",{className: "MathJax_Preview"});
|
||||||
if (MJ.inputJax.id === "TeX") {
|
if (MJ.inputJax === "TeX") {
|
||||||
if (MJ.root.Get("displaystyle")) {
|
if (MJ.root.Get("displaystyle")) {
|
||||||
delim = CONFIG.displayMathDelimiters;
|
delim = CONFIG.displayMathDelimiters;
|
||||||
text = [delim[0]+MJ.originalText+delim[1]];
|
text = [delim[0]+MJ.originalText+delim[1]];
|
||||||
|
|
|
@ -433,7 +433,7 @@
|
||||||
var math = (this.parentNode.className === "MathJax_Display" ? this.parentNode : this)
|
var math = (this.parentNode.className === "MathJax_Display" ? this.parentNode : this)
|
||||||
MENU.jax = HUB.getJaxFor(math.nextSibling);
|
MENU.jax = HUB.getJaxFor(math.nextSibling);
|
||||||
MENU.menu.items[1].menu.items[1].name =
|
MENU.menu.items[1].menu.items[1].name =
|
||||||
(MENU.jax.inputJax.id === "MathML" ? "Original" : MENU.jax.inputJax.id);
|
(MENU.jax.inputJax === "MathML" ? "Original" : MENU.jax.inputJax);
|
||||||
return MENU.menu.Post(event);
|
return MENU.menu.Post(event);
|
||||||
} else {
|
} else {
|
||||||
if (!AJAX.loadingMathMenu) {
|
if (!AJAX.loadingMathMenu) {
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
MathJax.OutputJax.NativeMML = MathJax.OutputJax({
|
MathJax.OutputJax.NativeMML = MathJax.OutputJax({
|
||||||
id: "NativeMML",
|
id: "NativeMML",
|
||||||
version: "1.1.4",
|
version: "1.1.5",
|
||||||
directory: MathJax.OutputJax.directory + "/NativeMML",
|
directory: MathJax.OutputJax.directory + "/NativeMML",
|
||||||
extensionDir: MathJax.OutputJax.extensionDir + "/NativeMML",
|
extensionDir: MathJax.OutputJax.extensionDir + "/NativeMML",
|
||||||
|
|
||||||
|
|
|
@ -202,7 +202,7 @@
|
||||||
var script = (isMSIE ? this.parentNode.parentNode.nextSibling : this.parentNode.nextSibling);
|
var script = (isMSIE ? this.parentNode.parentNode.nextSibling : this.parentNode.nextSibling);
|
||||||
MENU.jax = HUB.getJaxFor(script);
|
MENU.jax = HUB.getJaxFor(script);
|
||||||
MENU.menu.items[1].menu.items[1].name =
|
MENU.menu.items[1].menu.items[1].name =
|
||||||
(MENU.jax.inputJax.id === "MathML" ? "Original" : MENU.jax.inputJax.id);
|
(MENU.jax.inputJax === "MathML" ? "Original" : MENU.jax.inputJax);
|
||||||
delete nMML.trapClick; delete nMML.trapUp;
|
delete nMML.trapClick; delete nMML.trapUp;
|
||||||
return MENU.menu.Post(event);
|
return MENU.menu.Post(event);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user