Merge branch 'localization' into develop

This commit is contained in:
Davide P. Cervone 2013-04-29 19:25:03 -04:00
commit b8561b07bf
47 changed files with 3393 additions and 357 deletions

View File

@ -684,7 +684,7 @@ MathJax.fileversion = "2.1.4";
} else {
this.head = HEAD(this.head);
if (this.loader[type]) {this.loader[type].call(this,file,callback)}
else {throw Error("Can't load files of type "+type)}
else {throw Error("Can't load files of type "+type)}
}
return callback;
},
@ -725,16 +725,18 @@ MathJax.fileversion = "2.1.4";
//
// Create a SCRIPT tag to load the file
//
JS: function (file,callback) {
JS: function (file,callback) {
var script = document.createElement("script");
var timeout = BASE.Callback(["loadTimeout",this,file]);
this.loading[file] = {
callback: callback,
message: BASE.Message.File(file),
timeout: setTimeout(timeout,this.timeout),
status: this.STATUS.OK,
script: script
};
// Add this to the structure above after it is created to prevent recursion
// when loading the initial localization file (before loading messsage is available)
this.loading[file].message = BASE.Message.File(file);
script.onerror = timeout; // doesn't work in IE and no apparent substitute
script.type = "text/javascript";
script.src = file;
@ -888,7 +890,7 @@ MathJax.fileversion = "2.1.4";
// The default error hook for file load failures
//
loadError: function (file) {
BASE.Message.Set("File failed to load: "+file,null,2000);
BASE.Message.Set(["LoadFailed","File failed to load: %1",file],null,2000);
BASE.Hub.signal.Post(["file load error",file]);
},
@ -1056,6 +1058,391 @@ MathJax.HTML = {
};
/**********************************************************/
MathJax.Localization = {
locale: "en",
directory: "[MathJax]/localization",
strings: {
en: {isLoaded: true, menuTitle: "English"}, // nothing needs to be loaded for this
de: {menuTitle: "Deutsch"},
fr: {menuTitle: "Fran\u00E7ais"}
},
//
// The pattern for substitution escapes:
// %n or %{n} or %{plural:%n|option1|option1|...} or %c
//
pattern: /%(\d+|\{\d+\}|\{[a-z]+:\%\d+(?:\|(?:%\{\d+\}|%.|[^\}])*)+\}|.)/g,
_: function (id,phrase) {
if (phrase instanceof Array) {return this.processSnippet(id,phrase)}
return this.processString(this.lookupPhrase(id,phrase),[].slice.call(arguments,2));
},
processString: function (string,args,domain) {
//
// Process arguments for substitution
// If the argument is a snippet (and we are processing snippets) do so,
// Otherwise, if it is a number, convert it for the lacale
//
for (var i = 0, m = args.length; i < m; i++) {
if (domain && args[i] instanceof Array) {args[i] = this.processSnippet(domain,args[i])}
}
//
// Split string at escapes and process them individually
//
var parts = string.split(this.pattern);
for (var i = 1, m = parts.length; i < m; i += 2) {
var c = parts[i].charAt(0); // first char will be { or \d or a char to be kept literally
if (c >= "0" && c <= "9") { // %n
parts[i] = args[parts[i]-1];
if (typeof parts[i] === "number") parts[i] = this.number(parts[i]);
} else if (c === "{") { // %{n} or %{plural:%n|...}
c = parts[i].substr(1);
if (c >= "0" && c <= "9") { // %{n}
parts[i] = args[parts[i].substr(1,parts[i].length-2)-1];
if (typeof parts[i] === "number") parts[i] = this.number(parts[i]);
} else { // %{plural:%n|...}
var match = parts[i].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/);
if (match) {
if (match[1] === "plural") {
var n = args[match[2]-1];
if (typeof n === "undefined") {
parts[i] = "???"; // argument doesn't exist
} else {
n = this.plural(n) - 1; // index of the form to use
var plurals = match[3].replace(/(^|[^%])(%%)*%\|/g,"$1$2%\uEFEF").split(/\|/); // the parts (replacing %| with a special character)
if (n >= 0 && n < plurals.length) {
parts[i] = this.processString(plurals[n].replace(/\uEFEF/g,"|"),args,domain);
} else {
parts[i] = "???"; // no string for this index
}
}
} else {parts[i] = "%"+parts[i]} // not "plural", put back the % and leave unchanged
}
}
}
if (parts[i] == null) {parts[i] = "???"}
}
//
// If we are not forming a snippet, return the completed string
//
if (!domain) {return parts.join("")}
//
// We need to return an HTML snippet, so buld it from the
// broken up string with inserted parts (that could be snippets)
//
var snippet = [], part = "";
for (i = 0; i < m; i++) {
part += parts[i]; i++; // add the string and move on to substitution result
if (i < m) {
if (parts[i] instanceof Array) { // substitution was a snippet
snippet.push(part); // add the accumulated string
snippet = snippet.concat(parts[i]); // concatenate the substution snippet
part = ""; // start accumulating a new string
} else { // substitution was a string
part += parts[i]; // add to accumulating string
}
}
}
if (part !== "") {snippet.push(part)} // add final string
return snippet;
},
processSnippet: function (domain,snippet) {
var result = []; // the new snippet
//
// Look through the original snippet for
// strings or snippets to translate
//
for (var i = 0, m = snippet.length; i < m; i++) {
if (snippet[i] instanceof Array) {
//
// This could be a sub-snippet:
// ["tag"] or ["tag",{properties}] or ["tag",{properties},snippet]
// Or it could be something to translate:
// [id,string,args] or [domain,snippet]
var data = snippet[i];
if (typeof data[1] === "string") { // [id,string,args]
var id = data[0]; if (!(id instanceof Array)) {id = [domain,id]}
var phrase = this.lookupPhrase(id,data[1]);
result = result.concat(this.processMarkdown(phrase,data.slice(2),domain));
} else if (data[1] instanceof Array) { // [domain,snippet]
result = result.concat(this.processSnippet.apply(this,data));
} else if (data.length >= 3) { // ["tag",{properties},snippet]
result.push([data[0],data[1],this.processSnippet(domain,data[2])]);
} else { // ["tag"] or ["tag",{properties}]
result.push(snippet[i]);
}
} else { // a string
result.push(snippet[i]);
}
}
return result;
},
markdownPattern: /(%.)|(\*{1,3})((?:%.|.)+?)\2|(`+)((?:%.|.)+?)\4|\[((?:%.|.)+?)\]\(([^\s\)]+)\)/,
// %c or *bold*, **italics**, ***bold-italics***, or `code`, or [link](url)
processMarkdown: function (phrase,args,domain) {
var result = [], data;
//
// Split the string by the Markdown pattern
// (the text blocks are separated by
// c,stars,star-text,backtics,code-text,link-text,URL).
// Start with teh first text string from the split.
//
var parts = phrase.split(this.markdownPattern);
var string = parts[0];
//
// Loop through the matches and process them
//
for (var i = 1, m = parts.length; i < m; i += 8) {
if (parts[i+1]) { // stars (for bold/italic)
//
// Select the tag to use by number of stars (three stars requires two tags)
//
data = this.processString(parts[i+2],args,domain);
if (!(data instanceof Array)) {data = [data]}
data = [["b","i","i"][parts[i+1].length-1],{},data]; // number of stars determines type
if (parts[i+1].length === 3) {data = ["b",{},data]} // bold-italic
} else if (parts[i+3]) { // backtics (for code)
//
// Remove one leading or trailing space, and process substitutions
// Make a <code> tag
//
data = this.processString(parts[i+4].replace(/^\s/,"").replace(/\s$/,""),args,domain);
if (!(data instanceof Array)) {data = [data]}
data = ["code",{},data];
} else if (parts[i+5]) { // hyperlink
//
// Process the link text, and make an <a> tag with the URL
//
data = this.processString(parts[i+5],args,domain);
if (!(data instanceof Array)) {data = [data]}
data = ["a",{href:this.processString(parts[i+6],args),target:"_blank"},data];
} else {
//
// Escaped character (%c) gets added into the string.
//
string += parts[i]; data = null;
}
//
// If there is a tag to insert,
// Add any pending string, then push the tag
//
if (data) {
result = this.concatString(result,string,args,domain);
result.push(data); string = "";
}
//
// Process the string that follows matches pattern
//
if (parts[i+7] !== "") {string += parts[i+7]}
};
//
// Add any pending string and return the resulting snippet
//
result = this.concatString(result,string,args,domain);
return result;
},
concatString: function (result,string,args,domain) {
if (string != "") {
//
// Process the substutions.
// If the result is not a snippet, turn it into one.
// Then concatenate the snippet to the current one
//
string = this.processString(string,args,domain);
if (!(string instanceof Array)) {string = [string]}
result = result.concat(string);
}
return result;
},
lookupPhrase: function (id,phrase,domain) {
//
// Get the domain and messageID
//
if (!domain) {domain = "_"}
if (id instanceof Array) {domain = (id[0] || "_"); id = (id[1] || "")}
//
// Check if the data is available and if not,
// load it and throw a restart error so the calling
// code can wait for the load and try again.
//
var load = this.loadDomain(domain);
if (load) {MathJax.Hub.RestartAfter(load)}
//
// Look up the message in the localization data
// (if not found, the original English is used)
//
var localeData = this.strings[this.locale];
if (localeData) {
if (localeData.domains && domain in localeData.domains) {
var domainData = localeData.domains[domain];
if (domainData.strings && id in domainData.strings)
{phrase = domainData.strings[id]}
}
}
//
// return the translated phrase
//
return phrase;
},
//
// Load a langauge data file from the proper
// directory and file.
//
loadFile: function (file,data,callback) {
callback = MathJax.Callback(callback||{});
file = (data.file || file); // the data's file name or the default name
if (!file.match(/\.js$/)) {file += ".js"} // add .js if needed
//
// Add the directory if the file doesn't
// contain a full URL already.
//
if (!file.match(/^([a-z]+:|\[MathJax\])/)) {
var dir = (this.strings[this.locale].directory ||
this.directory + "/" + this.locale ||
"[MathJax]/localization/" + this.locale);
file = dir + "/" + file;
}
//
// Load the file and mark the data as loaded (even if it
// failed to load, so we don't continue to try to load it
// over and over).
//
var load = MathJax.Ajax.Require(file,function () {data.isLoaded = true; return callback()});
//
// Return the callback if needed, otherwise null.
//
return (load.called ? null : load);
},
//
// Check to see if the localization data are loaded
// for the given domain; if not, load the data file,
// and return a callback for the loading operation.
// Otherwise return null (data are loaded).
//
loadDomain: function (domain,callback) {
var load, localeData = this.strings[this.locale];
if (localeData) {
if (!localeData.isLoaded) {
load = this.loadFile(this.locale,localeData);
if (load) {
return MathJax.Callback.Queue(
load,["loadDomain",this,domain] // call again to load domain
).Push(callback);
}
}
if (localeData.domains && domain in localeData.domains) {
var domainData = localeData.domains[domain];
if (!domainData.isLoaded) {
load = this.loadFile(domain,domainData);
if (load) {return MathJax.Callback.Queue(load).Push(callback)}
}
}
}
// localization data are loaded, so just do the callback
return MathJax.Callback(callback)();
},
//
// Perform a function, properly handling
// restarts due to localization file loads.
//
// Note that this may return before the function
// has been called successfully, so you should
// consider fn as running asynchronously. (Callbacks
// can be used to synchronize it with other actions.)
//
Try: function (fn) {
fn = MathJax.Callback(fn); fn.autoReset = true;
try {fn()} catch (err) {
if (!err.restart) {throw err}
MathJax.Callback.After(["Try",this,fn],err.restart);
}
},
//
// Set the current language
//
setLocale: function(locale) {
// don't set it if there isn't a definition for it
if (this.strings[locale]) {this.locale = locale}
if (MathJax.Menu) {this.loadDomain("MathMenu")}
},
//
// Add or update a language or domain
//
addTranslation: function (locale,domain,definition) {
var data = this.strings[locale], isNew = false;
if (!data) {data = this.strings[locale] = {}; isNew = true}
if (!data.domains) {data.domains = {}}
if (domain) {
if (!data.domains[domain]) {data.domains[domain] = {}}
data = data.domains[domain];
}
MathJax.Hub.Insert(data,definition);
if (isNew && MathJax.Menu) {MathJax.Menu.CreateLocaleMenu()}
},
//
// Set CSS for an element based on font requirements
//
setCSS: function (div) {
var locale = this.strings[this.locale];
if (locale) {
if (locale.fontFamily) {div.style.fontFamily = locale.fontFamily}
if (locale.fontDirection) {
div.style.direction = locale.fontDirection;
if (locale.fontDirection === "rtl") {div.style.textAlign = "right"}
}
}
return div;
},
//
// Get the language's font family or direction
//
fontFamily: function () {
var locale = this.strings[this.locale];
return (locale ? locale.fontFamily : null);
},
fontDirection: function () {
var locale = this.strings[this.locale];
return (locale ? locale.fontDirection : null);
},
//
// Get the language's plural index for a number
//
plural: function (n) {
var locale = this.strings[this.locale];
if (locale && locale.plural) {return locale.plural(n)}
// default
if (n == 1) {return 1} // one
return 2; // other
},
//
// Convert a number to language-specific form
//
number: function(n) {
var locale = this.strings[this.locale];
if (locale && locale.number) {return locale.number(n)}
// default
return n;
}
};
/**********************************************************/
MathJax.Message = {
@ -1140,17 +1527,21 @@ MathJax.Message = {
frame = frame.firstChild;
frame.style.height = body.clientHeight + 'px';
},
localize: function (message) {
return MathJax.Localization._(message,message);
},
filterText: function (text,n) {
filterText: function (text,n,id) {
if (MathJax.Hub.config.messageStyle === "simple") {
if (text.match(/^Loading /)) {
if (!this.loading) {this.loading = "Loading "}
if (id === "LoadFile") {
if (!this.loading) {this.loading = this.localize("Loading") + " "}
text = this.loading; this.loading += ".";
} else if (text.match(/^Processing /)) {
if (!this.processing) {this.processing = "Processing "}
} else if (id === "ProcessMath") {
if (!this.processing) {this.processing = this.localize("Processing") + " "}
text = this.processing; this.processing += ".";
} else if (text.match(/^Typesetting /)) {
if (!this.typesetting) {this.typesetting = "Typesetting "}
} else if (id === "TypesetMath") {
if (!this.typesetting) {this.typesetting = this.localize("Typesetting") + " "}
text = this.typesetting; this.typesetting += ".";
}
}
@ -1158,14 +1549,49 @@ MathJax.Message = {
},
Set: function (text,n,clearDelay) {
if (this.timer) {clearTimeout(this.timer); delete this.timeout}
if (n == null) {n = this.log.length; this.log[n] = {}}
this.log[n].text = text; this.log[n].filteredText = text = this.filterText(text,n);
//
// Translate message if it is [id,message,arguments]
//
var id = "";
if (text instanceof Array) {
id = text[0]; if (id instanceof Array) {id = id[1]}
//
// Localization._() will throw a restart error if a localization file
// needs to be loaded, so trap that and redo the Set() call
// after it is loaded.
//
try {
text = MathJax.Localization._.apply(MathJax.Localization,text);
} catch (err) {
if (!err.restart) {throw err}
if (!err.restart.called) {
this.log[n].restarted = true; // mark it so we can tell if the Clear() comes before the message is up
MathJax.Callback.After(["Set",this,text,n,clearDelay],err.restart);
return n;
}
}
}
//
// Clear the timout timer.
//
if (this.timer) {clearTimeout(this.timer); delete this.timer}
//
// Save the message and filtered message.
//
this.log[n].text = text; this.log[n].filteredText = text = this.filterText(text,n,id);
//
// Hook the message into the message list so we can tell
// what message to put up when this one is removed.
//
if (typeof(this.log[n].next) === "undefined") {
this.log[n].next = this.current;
if (this.current != null) {this.log[this.current].prev = n}
this.current = n;
}
//
// Show the message if it is the currently active one.
//
if (this.current === n && MathJax.Hub.config.messageStyle !== "none") {
if (this.Init()) {
if (this.textNodeBug) {this.div.innerHTML = text} else {this.text.nodeValue = text}
@ -1176,24 +1602,50 @@ MathJax.Message = {
this.status = true;
}
}
//
// Check if the message was resetarted to load a localization file
// and if it has been cleared in the meanwhile.
//
if (this.log[n].restarted) {
if (this.log[n].cleared) {clearDelay = 0}
delete this.log[n].restarted, this.log[n].cleared;
}
//
// Check if we need to clear the message automatically.
//
if (clearDelay) {setTimeout(MathJax.Callback(["Clear",this,n]),clearDelay)}
else if (clearDelay == 0) {this.Clear(n,0)}
//
// Return the message number.
//
return n;
},
Clear: function (n,delay) {
//
// Detatch the message from the active list.
//
if (this.log[n].prev != null) {this.log[this.log[n].prev].next = this.log[n].next}
if (this.log[n].next != null) {this.log[this.log[n].next].prev = this.log[n].prev}
//
// If it is the current message, get the next one to show.
//
if (this.current === n) {
this.current = this.log[n].next;
if (this.text) {
if (this.div.parentNode == null) {this.Init()} // see ASCIIMathML comments above
if (this.current == null) {
if (this.timer) {clearTimeout(this.timer); delete this.timer}
//
// If there are no more messages, remove the message box.
//
if (this.timer) {clearTimeout(this.timer); delete this.timer}
if (delay == null) {delay = 600}
if (delay === 0) {this.Remove()}
else {this.timer = setTimeout(MathJax.Callback(["Remove",this]),delay)}
} else if (MathJax.Hub.config.messageStyle !== "none") {
//
// If there is an old message, put it in place
//
if (this.textNodeBug) {this.div.innerHTML = this.log[this.current].filteredText}
else {this.text.nodeValue = this.log[this.current].filteredText}
}
@ -1202,8 +1654,16 @@ MathJax.Message = {
window.status = (this.current == null ? "" : this.log[this.current].text);
}
}
//
// Clean up the log data no longer needed
//
delete this.log[n].next; delete this.log[n].prev;
delete this.log[n].filteredText;
//
// If this is a restarted localization message, mark that it has been cleared
// while waiting for the file to load.
//
if (this.log[n].restarted) {this.log[n].cleared = true}
},
Remove: function () {
@ -1215,7 +1675,7 @@ MathJax.Message = {
File: function (file) {
var root = MathJax.Ajax.config.root;
if (file.substr(0,root.length) === root) {file = "[MathJax]"+file.substr(root.length)}
return this.Set("Loading "+file);
return this.Set(["LoadFile","Loading %1",file],null,null);
},
Log: function () {
@ -1267,13 +1727,15 @@ MathJax.Hub = {
renderer: "", // set when Jax are loaded
font: "Auto", // what font HTML-CSS should use
context: "MathJax", // or "Browser" for pass-through to browser menu
locale: "en", // the language to use for messages
mpContext: false, // true means pass menu events to MathPlayer in IE
mpMouse: false, // true means pass mouse events to MathPlayer in IE
texHints: true // include class names for TeXAtom elements
},
errorSettings: {
message: ["[Math Processing Error]"], // HTML snippet structure for message to use
// localized HTML snippet structure for message to use
message: ["[",["MathProcessingError","Math Processing Error"],"]"],
style: {color: "#CC0000", "font-style":"italic"} // style for message
}
},
@ -1558,7 +2020,7 @@ MathJax.Hub = {
// Put up final message, reset the state and return
//
if (state.scripts.length && this.config.showProcessingMessages)
{MathJax.Message.Set("Processing math: 100%",0)}
{MathJax.Message.Set(["ProcessMath","Processing math: %1%%",100],0)}
state.start = new Date().getTime(); state.i = state.j = 0;
return null;
},
@ -1610,7 +2072,7 @@ MathJax.Hub = {
}
} catch (err) {
if (!err.restart) {
MathJax.Message.Set("Error preparing "+id+" output ("+method+")",null,600);
MathJax.Message.Set(["PrepError","Error preparing %1 output (%2)",id,method],null,600);
MathJax.Hub.lastPrepError = err;
state.j++;
}
@ -1657,7 +2119,7 @@ MathJax.Hub = {
// Put up the typesetting-complete message
//
if (state.scripts.length && this.config.showProcessingMessages) {
MathJax.Message.Set("Typesetting math: 100%",0);
MathJax.Message.Set(["TypesetMath","Typesetting math: %1%%",100],0);
MathJax.Message.Clear(0);
}
state.i = state.j = 0;
@ -1666,8 +2128,9 @@ MathJax.Hub = {
processMessage: function (state,type) {
var m = Math.floor(state.i/(state.scripts.length)*100);
var message = (type === "Output" ? "Typesetting" : "Processing");
if (this.config.showProcessingMessages) {MathJax.Message.Set(message+" math: "+m+"%",0)}
var message = (type === "Output" ? ["TypesetMath","Typesetting math: %1%%"] :
["ProcessMath","Processing math: %1%%"]);
if (this.config.showProcessingMessages) {MathJax.Message.Set(message.concat(m),0)}
},
processError: function (err,state,type) {
@ -1680,7 +2143,9 @@ MathJax.Hub = {
},
formatError: function (script,err) {
var error = MathJax.HTML.Element("span",{className:"MathJax_Error"},this.config.errorSettings.message);
var errorSettings = this.config.errorSettings;
var errorText = MathJax.Localization._(errorSettings.messageId,errorSettings.message);
var error = MathJax.HTML.Element("span",{className:"MathJax_Error"},errorText);
error.jaxID = "Error";
if (MathJax.Extension.MathEvents) {
error.oncontextmenu = MathJax.Extension.MathEvents.Event.Menu;
@ -1766,14 +2231,23 @@ MathJax.Hub.Startup = {
Config: function () {
this.queue.Push(["Post",this.signal,"Begin Config"]);
//
// If a locale is given as a parameter,
// set the locale and the default menu value for the locale
//
if (this.params.locale) {
MathJax.Localization.locale = this.params.locale;
MathJax.Hub.config.menuSettings.locale = this.params.locale;
}
//
// Check for user cookie configuration
//
var user = MathJax.HTML.Cookie.Get("user");
if (user.URL || user.Config) {
if (confirm(
"MathJax has found a user-configuration cookie that includes code to be run. " +
"Do you want to run it?\n\n"+
"(You should press Cancel unless you set up the cookie yourself.)"
MathJax.Localization._("CookieConfig",
"MathJax has found a user-configuration cookie that includes code to "+
"be run. Do you want to run it?\n\n"+
"(You should press Cancel unless you set up the cookie yourself.)")
)) {
if (user.URL) {this.queue.Push(["Require",MathJax.Ajax,user.URL])}
if (user.Config) {this.queue.Push(new Function(user.Config))}
@ -1830,6 +2304,7 @@ MathJax.Hub.Startup = {
//
// Read cookie and set up menu defaults
// (set the locale according to the cookie)
// (adjust the jax to accommodate renderer preferences)
//
Cookie: function () {
@ -1837,6 +2312,8 @@ MathJax.Hub.Startup = {
["Post",this.signal,"Begin Cookie"],
["Get",MathJax.HTML.Cookie,"menu",MathJax.Hub.config.menuSettings],
[function (config) {
if (config.menuSettings.locale)
{MathJax.Localization.locale = config.menuSettings.locale}
var renderer = config.menuSettings.renderer, jax = config.jax;
if (renderer) {
var name = "output/"+renderer; jax.sort();
@ -1955,7 +2432,16 @@ MathJax.Hub.Startup = {
MenuZoom: function () {
if (!MathJax.Extension.MathMenu) {
setTimeout(
MathJax.Callback(["Require",MathJax.Ajax,"[MathJax]/extensions/MathMenu.js",{}]),
function () {
MathJax.Callback.Queue(
["Require",MathJax.Ajax,"[MathJax]/extensions/MathMenu.js",{}],
["loadDomain",MathJax.Localization,"MathMenu"]
)
},1000
);
} else {
setTimeout(
MathJax.Callback(["loadDomain",MathJax.Localization,"MathMenu"]),
1000
);
}
@ -2121,6 +2607,7 @@ MathJax.Hub.Startup = {
BASE.InputJax = JAX.Subclass({
elementJax: "mml", // the element jax to load for this input jax
sourceMenuTitle: /*_(MathMenu)*/ ["OriginalForm","Original Form"],
copyTranslate: true,
Process: function (script,state) {
var queue = CALLBACK.Queue(), file;
@ -2300,11 +2787,16 @@ MathJax.Hub.Startup = {
id: "Error", version: "2.1", config: {},
ContextMenu: function () {return BASE.Extension.MathEvents.Event.ContextMenu.apply(BASE.Extension.MathEvents.Event,arguments)},
Mousedown: function () {return BASE.Extension.MathEvents.Event.AltContextMenu.apply(BASE.Extension.MathEvents.Event,arguments)},
getJaxFromMath: function () {return {inputJax:"Error", outputJax:"Error", originalText:"Math Processing Error"}}
getJaxFromMath: function () {
return {
inputJax: "Error", outputJax: "Error",
originalText: BASE.Localization._("MathProcessingError","Math Processing Error")
};
}
};
BASE.InputJax.Error = {
id: "Error", version: "2.1", config: {},
sourceMenuTitle: "Error Message"
sourceMenuTitle: /*_(MathMenu)*/ ["ErrorMessage","Error Message"]
};
})("MathJax");
@ -2479,5 +2971,3 @@ MathJax.Hub.Startup = {
})("MathJax");
}}
/**********************************************************/

View File

@ -1,3 +1,5 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*
* /MathJax/unpacked/config/Accessible-full.js
*
@ -22,7 +24,7 @@ MathJax.Hub.Config({
mpMouse: true
},
errorSettings: {
message: ["[Math Error]"]
message: ["[",["MathError","Math Error],"]"]
}
});

View File

@ -1,3 +1,5 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*
* /MathJax/unpacked/config/Accessible.js
*
@ -22,7 +24,7 @@ MathJax.Hub.Config({
mpMouse: true
},
errorSettings: {
message: ["[Math Error]"]
message: ["[",["MathError","Math Error],"]"]
}
});

View File

@ -1,3 +1,5 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/config/MMLorHTML.js
@ -95,7 +97,10 @@
} else {
HUB.PreProcess.disabled = true;
HUB.prepareScripts.disabled = true;
MathJax.Message.Set("Your browser does not support MathJax",null,4000);
MathJax.Message.Set(
["MathJaxNotSupported","Your browser does not support MathJax"],
null,4000
);
HUB.Startup.signal.Post("MathJax not supported");
}
});

View File

@ -1,3 +1,5 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/config/default.js
@ -235,6 +237,7 @@ MathJax.Hub.Config({
//
errorSettings: {
message: ["[Math Processing Error]"], // HTML snippet structure for message to use
messageId: "MathProcessingError", // ID of snippet for localization
style: {color: "#CC0000", "font-style":"italic"} // style for message
},

View File

@ -1,3 +1,6 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/extensions/FontWarnings.js
@ -83,7 +86,10 @@
*/
(function (HUB,HTML) {
var VERSION = "2.1";
var VERSION = "2.1.2";
var STIXURL = "http://www.stixfonts.org/";
var MATHJAXURL = "https://github.com/mathjax/MathJax/tree/master/fonts/HTML-CSS/TeX/otf";
var CONFIG = HUB.CombineConfig("FontWarnings",{
//
@ -110,31 +116,35 @@
// The messages for the various situations
//
Message: {
webFont: [
["closeBox"],
"MathJax is using web-based fonts to display the mathematics ",
"on this page. These take time to download, so the page would ",
"render faster if you installed math fonts directly in your ",
"system's font folder.",
["webFont",
"MathJax is using web-based fonts to display the mathematics "+
"on this page. These take time to download, so the page would "+
"render faster if you installed math fonts directly in your "+
"system's font folder."],
["fonts"]
],
imageFonts: [
["closeBox"],
"MathJax is using its image fonts rather than local or web-based fonts. ",
"This will render slower than usual, and the mathematics may not print ",
"at the full resolution of your printer.",
["imageFonts",
"MathJax is using its image fonts rather than local or web-based fonts. "+
"This will render slower than usual, and the mathematics may not print "+
"at the full resolution of your printer."],
["fonts"],
["webfonts"]
],
noFonts: [
["closeBox"],
"MathJax is unable to locate a font to use to display ",
"its mathematics, and image fonts are not available, so it ",
"is falling back on generic unicode characters in hopes that ",
"your browser will be able to display them. Some characters ",
"may not show up properly, or possibly not at all.",
["noFonts",
"MathJax is unable to locate a font to use to display "+
"its mathematics, and image fonts are not available, so it "+
"is falling back on generic unicode characters in hopes that "+
"your browser will be able to display them. Some characters "+
"may not show up properly, or possibly not at all."],
["fonts"],
["webfonts"]
]
@ -170,32 +180,38 @@
webfonts: [
["p"],
"Most modern browsers allow for fonts to be downloaded over the web. ",
"Updating to a more recent version of your browser (or changing browsers) ",
"could improve the quality of the mathematics on this page."
["webfonts",
"Most modern browsers allow for fonts to be downloaded over the web. "+
"Updating to a more recent version of your browser (or changing "+
"browsers) could improve the quality of the mathematics on this page."
]
],
fonts: [
["p"],
"MathJax can use either the ",
["a",{href:"http://www.stixfonts.org/",target:"_blank"},"STIX fonts"],
" or the ",
["a",{href:"http://www.mathjax.org/help-v2/fonts/",target:"_blank"},["MathJax TeX fonts"]],
". Download and install either one to improve your MathJax experience."
["fonts",
"MathJax can use either the [STIX fonts](%1) or the [MathJax TeX fonts](%2). " +
"Download and install one of those fonts to improve your MathJax experience.",
STIXURL,MATHJAXURL
]
],
STIXfonts: [
["p"],
"This page is designed to use the ",
["a",{href:"http://www.stixfonts.org/",target:"_blank"},"STIX fonts"],
". Download and install those fonts to improve your MathJax experience."
],
STIXfonts: [
["p"],
["STIXPage",
"This page is designed to use the [STIX fonts](%1). " +
"Download and install those fonts to improve your MathJax experience.",
STIXURL
]
],
TeXfonts: [
["p"],
"This page is designed to use the ",
["a",{href:"http://www.mathjax.org/help-v2/fonts/",target:"_blank"},["MathJax TeX fonts"]],
". Download and install those fonts to improve your MathJax experience."
["TeXPage",
"This page is designed to use the [MathJax TeX fonts](%1). " +
"Download and install those fonts to improve your MathJax experience.",
MATHJAXURL
]
]
},
@ -231,10 +247,20 @@
} else {delete CONFIG.messageStyle.filter}
CONFIG.messageStyle.maxWidth = (document.body.clientWidth-75) + "px";
var i = 0; while (i < data.length) {
if (data[i] instanceof Array && CONFIG.HTML[data[i][0]])
{data.splice.apply(data,[i,1].concat(CONFIG.HTML[data[i][0]]))} else {i++}
if (data[i] instanceof Array) {
if (data[i].length === 1 && CONFIG.HTML[data[i][0]]) {
data.splice.apply(data,[i,1].concat(CONFIG.HTML[data[i][0]]));
} else if (typeof data[i][1] === "string") {
var message = MathJax.Localization.lookupPhrase(["FontWarnings",data[i][0]],data[i][1]);
message = MathJax.Localization.processString(message,data[i].slice(2),"FontWarnings");
data.splice.apply(data,[i,1].concat(message));
i += message.length;
} else {i++}
} else {i++}
}
DATA.div = HTMLCSS.addElement(frame,"div",{id:"MathJax_FontWarning",style:CONFIG.messageStyle},data);
DATA.div = HTMLCSS.addElement(frame,"div",
{id:"MathJax_FontWarning",style:CONFIG.messageStyle},data);
MathJax.Localization.setCSS(DATA.div);
if (CONFIG.removeAfter) {
HUB.Register.StartupHook("End",function ()
{DATA.timer = setTimeout(FADEOUT,CONFIG.removeAfter)});
@ -276,7 +302,8 @@
if (message.match(/- Web-Font/)) {if (localFonts) {MSG = "webFont"}}
else if (message.match(/- using image fonts/)) {MSG = "imageFonts"}
else if (message.match(/- no valid font/)) {MSG = "noFonts"}
if (MSG && CONFIG.Message[MSG]) {CREATEMESSAGE(CONFIG.Message[MSG])}
if (MSG && CONFIG.Message[MSG])
{MathJax.Localization.loadDomain("FontWarnings",[CREATEMESSAGE,CONFIG.Message[MSG]])}
}
});
}

View File

@ -0,0 +1,154 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/extensions/HelpDialog.js
*
* Implements the MathJax Help dialog box.
*
* ---------------------------------------------------------------------
*
* Copyright (c) 2013 Design Science, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function (HUB,HTML,AJAX,OUTPUT,LOCALE) {
var HELP = MathJax.Extension.Help = {
version: "2.1"
};
var STIXURL = "http://www.stixfonts.org/";
var MENU = MathJax.Menu;
var CONFIG = HUB.CombineConfig("HelpDialog",{
closeImg: AJAX.fileURL(OUTPUT.imageDir+"/CloseX-31.png"), // image for close "X" for mobiles
styles: {
"#MathJax_Help": {
position:"fixed", left:"50%", width:"auto", "max-width": "90%", "text-align":"center",
border:"3px outset", padding:"1em 2em", "background-color":"#DDDDDD", color:"black",
cursor: "default", "font-family":"message-box", "font-size":"120%",
"font-style":"normal", "text-indent":0, "text-transform":"none",
"line-height":"normal", "letter-spacing":"normal", "word-spacing":"normal",
"word-wrap":"normal", "white-space":"wrap", "float":"none", "z-index":201,
"border-radius": "15px", // Opera 10.5 and IE9
"-webkit-border-radius": "15px", // Safari and Chrome
"-moz-border-radius": "15px", // Firefox
"-khtml-border-radius": "15px", // Konqueror
"box-shadow":"0px 10px 20px #808080", // Opera 10.5 and IE9
"-webkit-box-shadow":"0px 10px 20px #808080", // Safari 3 and Chrome
"-moz-box-shadow":"0px 10px 20px #808080", // Forefox 3.5
"-khtml-box-shadow":"0px 10px 20px #808080", // Konqueror
filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')" // IE
},
"#MathJax_HelpContent": {
overflow:"auto", "text-align":"left", "font-size":"80%",
padding:".4em .6em", border:"1px inset", margin:"1em 0px",
"max-height":"20em", "max-width":"30em", "background-color":"#EEEEEE"
}
}
});
/*
* Handle the Help Dialog box
*/
HELP.Dialog = function () {
LOCALE.loadDomain("HelpDialog",["Post",HELP]);
};
HELP.Post = function () {
this.div = MENU.Background(this);
var help = HTML.addElement(this.div,"div",{
id: "MathJax_Help"
},LOCALE._("HelpDialog",[
["b",{style:{fontSize:"120%"}},[["Help","MathJax Help"]]],
["div",{id: "MathJax_HelpContent"},[
["p",{},[["MathJax",
"*MathJax* is a JavaScript library that allows page authors to include " +
"mathematics within their web pages. As a reader, you don't need to do " +
"anything to make that happen."]]
],
["p",{},[["Browsers",
"*Browsers*: MathJax works with all modern browsers including IE6+, Firefox 3+, " +
"Chrome 0.2+, Safari 2+, Opera 9.6+ and most mobile browsers."]]
],
["p",{},[["Menu",
"*Math Menu*: MathJax adds a contextual menu to equations. Right-click or " +
"CTRL-click on any mathematics to access the menu."]]
],
["div",{style:{"margin-left":"1em"}},[
["p",{},[["ShowMath",
"*Show Math As* allows you to view the formula's source markup " +
"for copy & paste (as MathML or in its origianl format)."]]
],
["p",{},[["Settings",
"*Settings* gives you control over features of MathJax, such as the " +
"size of the mathematics, and the mechanism used to display equations."]]
],
["p",{},[["Language",
"*Language* lets you select the language used by MathJax for its menus " +
"and warning messages."]]
],
]],
["p",{},[["Zoom",
"*Math Zoom*: If you are having difficulty reading an equation, MathJax can " +
"enlarge it to help you see it better."]]
],
["p",{},[["Accessibilty",
"*Accessibility*: MathJax will automatically work with screen readers to make " +
"mathematics accessible to the visually impaired."]]
],
["p",{},[["Fonts",
"*Fonts*: MathJax will use certain math fonts if they are installed on your " +
"computer; otherwise, it will use web-based fonts. Although not required, " +
"locally installed fonts will speed up typesetting. We suggest installing " +
"the [STIX fonts](%1).",STIXURL]]
]
]],
["a",{href:"http://www.mathjax.org/"},["www.mathjax.org"]],
["img", {
src: CONFIG.closeImg,
style: {width:"21px", height:"21px", position:"absolute", top:".2em", right:".2em"},
onclick: HELP.Remove
}]
]));
LOCALE.setCSS(help);
var doc = (document.documentElement||{});
var H = window.innerHeight || doc.clientHeight || doc.scrollHeight || 0;
if (MENU.prototype.msieAboutBug) {
help.style.width = "20em"; help.style.position = "absolute";
help.style.left = Math.floor((document.documentElement.scrollWidth - help.offsetWidth)/2)+"px";
help.style.top = (Math.floor((H-help.offsetHeight)/3)+document.body.scrollTop)+"px";
} else {
help.style.marginLeft = Math.floor(-help.offsetWidth/2)+"px";
help.style.top = Math.floor((H-help.offsetHeight)/3)+"px";
}
};
HELP.Remove = function (event) {
if (HELP.div) {document.body.removeChild(HELP.div); delete HELP.div}
};
MathJax.Callback.Queue(
HUB.Register.StartupHook("End Config",{}), // wait until config is complete
["Styles",AJAX,CONFIG.styles],
["Post",HUB.Startup.signal,"HelpDialig Ready"],
["loadComplete",AJAX,"[MathJax]/extensions/HelpDialog.js"]
);
})(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.OutputJax,MathJax.Localization);

View File

@ -22,8 +22,8 @@
* limitations under the License.
*/
(function (HUB,HTML,AJAX,CALLBACK,OUTPUT,INPUT) {
var VERSION = "2.1";
(function (HUB,HTML,AJAX,CALLBACK,LOCALE,OUTPUT,INPUT) {
var VERSION = "2.1.1";
var EXTENSION = MathJax.Extension;
var ME = EXTENSION.MathEvents = {version: VERSION};
@ -141,33 +141,46 @@
}
//
// If the menu code is loaded, post the menu
// Otherwse lad the menu code and try again
// If the menu code is loaded,
// Check if localization needs loading;
// If not, post the menu, and return.
// Otherwise wait for the localization to load
// Otherwse load the menu code.
// Try again after the file is loaded.
//
var MENU = MathJax.Menu;
var MENU = MathJax.Menu; var load, fn;
if (MENU) {
MENU.jax = jax;
var source = MENU.menu.Find("Show Math As").menu;
source.items[1].name = (INPUT[jax.inputJax].sourceMenuTitle||"Original Form");
source.items[0].hidden = (jax.inputJax === "Error"); // hide MathML choice for error messages
var MathPlayer = MENU.menu.Find("Math Settings","MathPlayer");
MathPlayer.hidden = !(jax.outputJax === "NativeMML" && HUB.Browser.hasMathPlayer);
return MENU.menu.Post(event);
} else {
if (!AJAX.loadingMathMenu) {
AJAX.loadingMathMenu = true;
var ev = {
pageX:event.pageX, pageY:event.pageY,
clientX:event.clientX, clientY:event.clientY
};
CALLBACK.Queue(
AJAX.Require("[MathJax]/extensions/MathMenu.js"),
function () {delete AJAX.loadingMathMenu; if (!MathJax.Menu) {MathJax.Menu = {}}},
["ContextMenu",this,ev,math,force] // call this function again
);
if (MENU.loadingDomain) {return EVENT.False(event)}
load = LOCALE.loadDomain("MathMenu");
if (!load) {
MENU.jax = jax;
var source = MENU.menu.Find("Show Math As").menu;
source.items[1].name = INPUT[jax.inputJax].sourceMenuTitle;
source.items[0].hidden = (jax.inputJax === "Error"); // hide MathML choice for error messages
var MathPlayer = MENU.menu.Find("Math Settings","MathPlayer");
MathPlayer.hidden = !(jax.outputJax === "NativeMML" && HUB.Browser.hasMathPlayer);
return MENU.menu.Post(event);
}
MENU.loadingDomain = true;
fn = function () {delete MENU.loadingDomain};
} else {
if (AJAX.loadingMathMenu) {return EVENT.False(event)}
AJAX.loadingMathMenu = true;
load = AJAX.Require("[MathJax]/extensions/MathMenu.js");
fn = function () {
delete AJAX.loadingMathMenu;
if (!MathJax.Menu) {MathJax.Menu = {}}
}
return EVENT.False(event);
}
var ev = {
pageX:event.pageX, pageY:event.pageY,
clientX:event.clientX, clientY:event.clientY
};
CALLBACK.Queue(
load, fn, // load the file and delete the marker when done
["ContextMenu",EVENT,ev,math,force] // call this function again
);
return EVENT.False(event);
},
//
@ -530,4 +543,5 @@
["loadComplete",AJAX,"[MathJax]/extensions/MathEvents.js"]
);
})(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.Callback,MathJax.OutputJax,MathJax.InputJax);
})(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.Callback,
MathJax.Localization,MathJax.OutputJax,MathJax.InputJax);

View File

@ -1,3 +1,6 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/extensions/MathMenu.js
@ -24,7 +27,7 @@
*/
(function (HUB,HTML,AJAX,CALLBACK,OUTPUT) {
var VERSION = "2.1";
var VERSION = "2.1.2";
var SIGNAL = MathJax.Callback.Signal("menu") // signal for menu events
@ -33,12 +36,18 @@
signal: SIGNAL
};
var _ = function (id) {
return MathJax.Localization._.apply(
MathJax.Localization,
[["MathMenu",id]].concat([].slice.call(arguments,1))
);
};
var isPC = HUB.Browser.isPC, isMSIE = HUB.Browser.isMSIE, isIE9 = ((document.documentMode||0) > 8);
var ROUND = (isPC ? null : "5px");
var CONFIG = HUB.CombineConfig("MathMenu",{
delay: 150, // the delay for submenus
helpURL: "http://www.mathjax.org/help-v2/user/", // the URL for the "MathJax Help" menu
closeImg: AJAX.fileURL(OUTPUT.imageDir+"/CloseX-31.png"), // image for close "X" for mobiles
showRenderer: true, // show the "Math Renderer" menu?
@ -46,6 +55,7 @@
showFontMenu: false, // show the "Font Preference" menu?
showContext: false, // show the "Context Menu" menu?
showDiscoverable: false, // show the "Discoverable" menu?
showLocale: true, // show the "Locale" menu?
windowSettings: { // for source window
status: "no", toolbar: "no", locationbar: "no", menubar: "no",
@ -175,7 +185,6 @@
*/
Post: function (event,parent) {
if (!event) {event = window.event};
var title = (!this.title ? null : [["div",{className: "MathJax_MenuTitle"},[this.title]]]);
var div = document.getElementById("MathJax_MenuFrame");
if (!div) {
div = MENU.Background(this);
@ -187,7 +196,8 @@
onmouseup: MENU.Mouseup, ondblclick: FALSE,
ondragstart: FALSE, onselectstart: FALSE, oncontextmenu: FALSE,
menuItem: this, className: "MathJax_Menu"
},title);
});
MathJax.Localization.setCSS(menu);
for (var i = 0, m = this.items.length; i < m; i++) {this.items[i].Create(menu)}
if (MENU.isMobile) {
@ -251,16 +261,17 @@
},
/*
* Find a named item in a menu (or submenu).
* A list of names means descend into submenus.
* Find an item in a menu (or submenu) by name (Find) or ID (FindID).
* A list of names or IDs means descend into submenus.
*/
Find: function (name) {
var names = [].slice.call(arguments,1);
Find: function (name) {return this.FindN(1,name,[].slice.call(arguments,1))},
FindId: function (name) {return this.FindN(0,name,[].slice.call(arguments,1))},
FindN: function (n,name,names) {
for (var i = 0, m = this.items.length; i < m; i++) {
if (this.items[i].name === name) {
if (this.items[i].name[n] === name) {
if (names.length) {
if (!this.items[i].menu) {return null}
return this.items[i].menu.Find.apply(this.items[i].menu,names);
return this.items[i].menu.FindN(n,names[0],names.slice(1));
}
return this.items[i];
}
@ -271,9 +282,11 @@
/*
* Find the index of a menu item (so we can insert before or after it)
*/
IndexOf: function (name) {
IndexOf: function (name) {return this.IndexOfN(1,name)},
IndexOfId: function (name) {return this.IndexOfN(0,name)},
IndexOfN: function (n,name) {
for (var i = 0, m = this.items.length; i < m; i++)
{if (this.items[i].name === name) {return i}}
{if (this.items[i].name[n] === name) {return i}}
return null;
}
@ -317,12 +330,12 @@
var div = HTML.addElement(document.body,"div",{style:this.BGSTYLE, id:"MathJax_MenuFrame"},
[["div",{style: this.BGSTYLE, menuItem: menu, onmousedown: this.Remove}]]);
var bg = div.firstChild;
if (menu.msieBackgroundBug) {
if (MENU.msieBackgroundBug) {
// MSIE doesn't allow transparent background to be hit boxes, so
// fake it using opacity with solid background color
bg.style.backgroundColor = "white"; bg.style.filter = "alpha(opacity=0)";
}
if (menu.msieFixedPositionBug) {
if (MENU.msieFixedPositionBug) {
// MSIE can't do fixed position, so use a full-sized background
// and an onresize handler to update it (stupid, but necessary)
div.width = div.height = 0; this.Resize();
@ -361,7 +374,7 @@
* The menu item root subclass
*/
var ITEM = MENU.ITEM = MathJax.Object.Subclass({
name: "", // the menu item's label
name: "", // the menu item's label as [id,label] pair
Create: function (menu) {
if (!this.hidden) {
@ -376,6 +389,7 @@
HTML.addElement(menu,"div",def,this.Label(def,menu));
}
},
Name: function () {return _(this.name[0],this.name[1])},
Mouseover: function (event,menu) {
if (!this.disabled) {this.Activate(menu)}
@ -433,11 +447,12 @@
action: function () {},
Init: function (name,action,def) {
if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair
this.name = name; this.action = action;
this.With(def);
},
Label: function (def,menu) {return [this.name]},
Label: function (def,menu) {return [this.Name()]},
Mouseup: function (event,menu) {
if (!this.disabled) {
this.Remove(event,menu);
@ -457,13 +472,14 @@
marker: (isPC && !HUB.Browser.isSafari ? "\u25B6" : "\u25B8"), // the menu arrow
Init: function (name,def) {
if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair
this.name = name; var i = 1;
if (!(def instanceof MENU.ITEM)) {this.With(def), i++}
this.menu = MENU.apply(MENU,[].slice.call(arguments,i));
},
Label: function (def,menu) {
this.menu.posted = false;
return [this.name+" ",["span",{className:"MathJax_MenuArrow"},[this.marker]]];
return [this.Name()+" ",["span",{className:"MathJax_MenuArrow"},[this.marker]]];
},
Timer: function (event,menu) {
if (this.timer) {clearTimeout(this.timer)}
@ -506,13 +522,14 @@
marker: (isPC ? "\u25CF" : "\u2713"), // the checkmark
Init: function (name,variable,def) {
if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair
this.name = name; this.variable = variable; this.With(def);
if (this.value == null) {this.value = this.name}
if (this.value == null) {this.value = this.name[0]}
},
Label: function (def,menu) {
var span = {className:"MathJax_MenuRadioCheck"};
if (CONFIG.settings[this.variable] !== this.value) {span = {style:{display:"none"}}}
return [["span",span,[this.marker]]," "+this.name];
return [["span",span,[this.marker]]," "+this.Name()];
},
Mouseup: function (event,menu) {
if (!this.disabled) {
@ -542,12 +559,13 @@
marker: "\u2713", // the checkmark
Init: function (name,variable,def) {
if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair
this.name = name; this.variable = variable; this.With(def);
},
Label: function (def,menu) {
var span = {className:"MathJax_MenuCheck"};
if (!CONFIG.settings[this.variable]) {span = {style:{display:"none"}}}
return [["span",span,[this.marker]]," "+this.name];
return [["span",span,[this.marker]]," "+this.Name()];
},
Mouseup: function (event,menu) {
if (!this.disabled) {
@ -567,11 +585,14 @@
* A menu item that is a label
*/
MENU.ITEM.LABEL = MENU.ITEM.Subclass({
Init: function (name,def) {this.name = name; this.With(def)},
Init: function (name,def) {
if (!(name instanceof Array)) {name = [name,name]} // make [id,label] pair
this.name = name; this.With(def);
},
Label: function (def,menu) {
delete def.onmouseover, delete def.onmouseout; delete def.onmousedown;
def.className += " MathJax_MenuLabel";
return [this.name];
return [this.Name()];
}
});
@ -594,28 +615,31 @@
* Handle the ABOUT box
*/
MENU.About = function () {
var HTMLCSS = OUTPUT["HTML-CSS"] || {fontInUse: ""};
var local = (HTMLCSS.webFonts ? "" : "local "), web = (HTMLCSS.webFonts ? " web" : "");
var font = (HTMLCSS.imgFonts ? "Image" : local+HTMLCSS.fontInUse+web) + " fonts";
if (font === "local fonts" && OUTPUT.SVG) {font = "web SVG fonts"}
var HTMLCSS = OUTPUT["HTML-CSS"] || {};
var font =
(HTMLCSS.imgFonts ? "image" :
(HTMLCSS.fontInUse ?
(HTMLCSS.webFonts ? "web" : "local")+" "+HTMLCSS.fontInUse :
(OUTPUT.SVG ? "web SVG" : "generic")) ) + " fonts";
var format = (!HTMLCSS.webFonts || HTMLCSS.imgFonts ? null :
HTMLCSS.allowWebFonts.replace(/otf/,"woff or otf") + " fonts");
var jax = ["MathJax.js v"+MathJax.fileversion,["br"]];
jax.push(["div",{style:{"border-top":"groove 2px",margin:".25em 0"}}]);
MENU.About.GetJax(jax,MathJax.InputJax,"Input Jax");
MENU.About.GetJax(jax,MathJax.OutputJax,"Output Jax");
MENU.About.GetJax(jax,MathJax.ElementJax,"Element Jax");
MENU.About.GetJax(jax,MathJax.InputJax,["InputJax","%1 Input Jax v%2"]);
MENU.About.GetJax(jax,MathJax.OutputJax,["OutputJax","%1 Output Jax v%2"]);
MENU.About.GetJax(jax,MathJax.ElementJax,["ElementJax","%1 Element Jax v%2"]);
jax.push(["div",{style:{"border-top":"groove 2px",margin:".25em 0"}}]);
MENU.About.GetJax(jax,MathJax.Extension,"Extension",true);
MENU.About.GetJax(jax,MathJax.Extension,["Extension","%1 Extension v%2"],true);
jax.push(["div",{style:{"border-top":"groove 2px",margin:".25em 0"}}],["center",{},[
HUB.Browser + " v"+HUB.Browser.version +
(HTMLCSS.webFonts && !HTMLCSS.imgFonts ? " \u2014 " +
HTMLCSS.allowWebFonts.replace(/otf/,"woff or otf") + " fonts" : "")
HUB.Browser + " v"+HUB.Browser.version + (format ?
" \u2014 " + _(format.replace(/ /g,""),format) : "")
]]);
MENU.About.div = MENU.Background(MENU.About);
var about = HTML.addElement(MENU.About.div,"div",{
id: "MathJax_About"
},[
["b",{style:{fontSize:"120%"}},["MathJax"]]," v"+MathJax.version,["br"],
"using "+font,["br"],["br"],
_(font.replace(/ /g,""),"using "+font),["br"],["br"],
["span",{style:{
display:"inline-block", "text-align":"left", "font-size":"80%",
"max-height":"20em", overflow:"auto",
@ -628,6 +652,7 @@
onclick: MENU.About.Remove
}]
]);
MathJax.Localization.setCSS(about);
var doc = (document.documentElement||{});
var H = window.innerHeight || doc.clientHeight || doc.scrollHeight || 0;
if (MENU.prototype.msieAboutBug) {
@ -646,7 +671,7 @@
var info = [];
for (var id in JAX) {if (JAX.hasOwnProperty(id) && JAX[id]) {
if ((noTypeCheck && JAX[id].version) || (JAX[id].isa && JAX[id].isa(JAX)))
{info.push((JAX[id].id||id)+" "+type+" v"+JAX[id].version)}
{info.push(_(type[0],type[1],(JAX[id].id||id),JAX[id].version))}
}}
info.sort();
for (var i = 0, m = info.length; i < m; i++) {jax.push(info[i],["br"])}
@ -658,7 +683,8 @@
* Handle the MathJax HELP menu
*/
MENU.Help = function () {
window.open(CONFIG.helpURL,"MathJaxHelp");
AJAX.Require("[MathJax]/extensions/HelpDialog.js",
function () {MathJax.Extension.Help.Dialog()});
};
/*
@ -690,7 +716,10 @@
return;
}
} else {
if (MENU.jax.originalText == null) {alert("No original form available"); return}
if (MENU.jax.originalText == null) {
alert(_("NoOriginalForm","No original form available"));
return;
}
MENU.ShowSource.Text(MENU.jax.originalText,event);
}
};
@ -706,16 +735,17 @@
var w = MENU.ShowSource.Window(event); delete MENU.ShowSource.w;
text = text.replace(/^\s*/,"").replace(/\s*$/,"");
text = text.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
var title = _("EqSource","MathJax Equation Source");
if (MENU.isMobile) {
w.document.open();
w.document.write("<html><head><meta name='viewport' content='width=device-width, initial-scale=1.0' /><title>MathJax Equation Source</title></head><body style='font-size:85%'>");
w.document.write("<html><head><meta name='viewport' content='width=device-width, initial-scale=1.0' /><title>"+title+"</title></head><body style='font-size:85%'>");
w.document.write("<pre>"+text+"</pre>");
w.document.write("<hr><input type='button' value='Close' onclick='window.close()' />");
w.document.write("<hr><input type='button' value='"+_("Close","Close")+"' onclick='window.close()' />");
w.document.write("</body></html>");
w.document.close();
} else {
w.document.open();
w.document.write("<html><head><title>MathJax Equation Source</title></head><body style='font-size:85%'>");
w.document.write("<html><head><title>"+title+"</title></head><body style='font-size:85%'>");
w.document.write("<table><tr><td><pre>"+text+"</pre></td></tr></table>");
w.document.write("</body></html>");
w.document.close();
@ -740,7 +770,7 @@
MENU.Scale = function () {
var HTMLCSS = OUTPUT["HTML-CSS"], nMML = OUTPUT.NativeMML, SVG = OUTPUT.SVG;
var SCALE = (HTMLCSS||nMML||SVG||{config:{scale:100}}).config.scale;
var scale = prompt("Scale all mathematics (compared to surrounding text) by",SCALE+"%");
var scale = prompt(_("ScaleMath","Scale all mathematics (compared to surrounding text) by"),SCALE+"%");
if (scale) {
if (scale.match(/^\s*\d+(\.\d*)?\s*%?\s*$/)) {
scale = parseFloat(scale);
@ -752,8 +782,9 @@
MENU.cookie.scale = scale;
MENU.saveCookie(); HUB.Reprocess();
}
} else {alert("The scale should not be zero")}
} else {alert("The scale should be a percentage (e.g., 120%)")}
} else {alert(_("NonZeroScale","The scale should not be zero"))}
} else {alert(_("PercentScale",
"The scale should be a percentage (e.g., 120%%)"))}
}
};
@ -777,7 +808,8 @@
switch (CONFIG.settings.renderer) {
case "NativeMML":
if (!CONFIG.settings.warnedMML) {
if (BROWSER.isChrome || (BROWSER.isSafari && !BROWSER.versionAtLeast("5.0"))) {message = MESSAGE.MML.WebKit}
if (BROWSER.isChrome && BROWSER.version.substr(0,3) !== "24.") {message = MESSAGE.MML.WebKit}
else if (BROWSER.isSafari && !BROWSER.versionAtLeast("5.0")) {message = MESSAGE.MML.WebKit}
else if (BROWSER.isMSIE) {if (!BROWSER.hasMathPlayer) {message = MESSAGE.MML.MSIE}}
else {message = MESSAGE.MML[BROWSER]}
warned = "warnedMML";
@ -791,10 +823,18 @@
break;
}
if (message) {
message += "\n\nSwitch the renderer anyway?\n\n" +
"(Press OK to switch, CANCEL to continue with the current renderer)";
MENU.cookie.renderer = jax[0].id; MENU.saveCookie(); if (!confirm(message)) {return}
if (warned) {MENU.cookie[warned] = CONFIG.settings[warned] = true}
message = _(message[0],message[1]);
message += "\n\n";
message += _("SwitchAnyway",
"Switch the renderer anyway?\n\n" +
"(Press OK to switch, CANCEL to continue with the current renderer)");
MENU.cookie.renderer = jax[0].id; MENU.saveCookie();
if (!confirm(message)) {
MENU.cookie.renderer = CONFIG.settings.renderer = HTML.Cookie.Get("menu").renderer;
MENU.saveCookie();
return;
}
if (warned) {MENU.cookie.warned = CONFIG.settings.warned = true}
MENU.cookie.renderer = CONFIG.settings.renderer; MENU.saveCookie();
}
HUB.Queue(
@ -805,28 +845,34 @@
};
MENU.Renderer.Messages = {
MML: {
WebKit: "Your browser doesn't seem to support MathML natively, " +
"so switching to MathML output may cause the mathematics " +
"on the page to become unreadable.",
WebKit: ["WebkitNativeMMLWarning",
"Your browser doesn't seem to support MathML natively, " +
"so switching to MathML output may cause the mathematics " +
"on the page to become unreadable."],
MSIE: "Internet Explorer requires the MathPlayer plugin " +
"in order to process MathML output.",
MSIE: ["MSIENativeMMLWarning",
"Internet Explorer requires the MathPlayer plugin " +
"in order to process MathML output."],
Opera: "Opera's support for MathML is limited, so switching to " +
"MathML output may cause some expressions to render poorly.",
Opera: ["OperaNativeMMLWarning",
"Opera's support for MathML is limited, so switching to " +
"MathML output may cause some expressions to render poorly."],
Safari: "Your browser's native MathML does not implement all the features " +
"used by MathJax, so some expressions may not render properly.",
Safari: ["SafariNativeMMLWarning",
"Your browser's native MathML does not implement all the features " +
"used by MathJax, so some expressions may not render properly."],
Firefox: "Your browser's native MathML does not implement all the features " +
"used by MathJax, so some expressions may not render properly."
Firefox: ["FirefoxNativeMMLWarning",
"Your browser's native MathML does not implement all the features " +
"used by MathJax, so some expressions may not render properly."]
},
SVG: {
MSIE: "SVG is not implemented in Internet Explorer prior to " +
"IE9, or when the browser is emulating IE8 or below. " +
"Switching to SVG output will cause the mathemtics to " +
"not display properly."
MSIE: ["MSIESVGWarning",
"SVG is not implemented in Internet Explorer prior to " +
"IE9 or when it is emulating IE8 or below. " +
"Switching to SVG output will cause the mathematics to " +
"not display properly."]
}
};
@ -838,6 +884,28 @@
document.location.reload();
};
/*
* Handle selection of locale and rerender the page
*/
MENU.Locale = function () {
MathJax.Localization.setLocale(CONFIG.settings.locale);
MathJax.Hub.Queue(["Reprocess",MathJax.Hub]); // FIXME: Just reprocess error messages?
};
MENU.LoadLocale = function () {
var url = prompt(_("LoadURL","Load translation data from this URL:"));
if (url) {
if (!url.match(/\.js$/)) {
alert(_("BadURL",
"The URL should be for a javascript file that defines MathJax translation data. " +
"Javascript file names should end with '.js'"
));
}
AJAX.Require(url,function (status) {
if (status != AJAX.STATUS.OK) {alert(_("BadData","Failed to load translation data from %1",url))}
});
}
};
/*
* Handle setting MathPlayer events
*/
@ -845,7 +913,7 @@
var discoverable = CONFIG.settings.discoverable,
MESSAGE = MENU.MPEvents.Messages;
if (!isIE9) {
if (CONFIG.settings.mpMouse && !confirm(MESSAGE.IE8warning)) {
if (CONFIG.settings.mpMouse && !confirm(_.apply(_,MESSAGE.IE8warning))) {
delete MENU.cookie.mpContext; delete CONFIG.settings.mpContext;
delete MENU.cookie.mpMouse; delete CONFIG.settings.mpMouse;
MENU.saveCookie();
@ -855,19 +923,20 @@
MENU.cookie.mpContext = MENU.cookie.mpMouse = CONFIG.settings.mpMouse;
MENU.saveCookie();
MathJax.Hub.Queue(["Rerender",MathJax.Hub])
} else if (!discoverable && item.name === "Menu Events" && CONFIG.settings.mpContext) {
alert(MESSAGE.IE9warning);
} else if (!discoverable && item.name[1] === "Menu Events" && CONFIG.settings.mpContext) {
alert(_.apply(_,MESSAGE.IE9warning));
}
};
MENU.MPEvents.Messages = {
IE8warning:
IE8warning: ["IE8warning",
"This will disable the MathJax menu and zoom features, " +
"but you can Alt-Click on an expression to obtain the MathJax " +
"menu instead.\n\nReally change the MathPlayer settings?",
"menu instead.\n\nReally change the MathPlayer settings?"],
IE9warning:
IE9warning: ["IE9warning",
"The MathJax contextual menu will be disabled, but you can " +
"Alt-Click on an expression to obtain the MathJax menu instead."
"Alt-Click on an expression to obtain the MathJax menu instead."]
};
/*************************************************************/
@ -914,28 +983,29 @@
/*
* The main menu
*/
// Localization: items used as key, should be refactored.
MENU.menu = MENU(
ITEM.SUBMENU("Show Math As",
ITEM.COMMAND("MathML Code", MENU.ShowSource, {nativeTouch: true, format: "MathML"}),
ITEM.COMMAND("Original Form", MENU.ShowSource, {nativeTouch: true}),
ITEM.SUBMENU(["Show","Show Math As"],
ITEM.COMMAND(["MathMLcode","MathML Code"], MENU.ShowSource, {nativeTouch: true, format: "MathML"}),
ITEM.COMMAND(["Original","Original Form"], MENU.ShowSource, {nativeTouch: true}),
ITEM.RULE(),
ITEM.CHECKBOX("Show TeX hints in MathML", "texHints")
ITEM.CHECKBOX(["texHints","Show TeX hints in MathML"], "texHints")
),
ITEM.RULE(),
ITEM.SUBMENU("Math Settings",
ITEM.SUBMENU("Zoom Trigger",
ITEM.RADIO("Hover", "zoom", {action: MENU.Zoom}),
ITEM.RADIO("Click", "zoom", {action: MENU.Zoom}),
ITEM.RADIO("Double-Click", "zoom", {action: MENU.Zoom}),
ITEM.RADIO("No Zoom", "zoom", {value: "None"}),
ITEM.SUBMENU(["Settings","Math Settings"],
ITEM.SUBMENU(["ZoomTrigger","Zoom Trigger"],
ITEM.RADIO(["Hover","Hover"], "zoom", {action: MENU.Zoom}),
ITEM.RADIO(["Click","Click"], "zoom", {action: MENU.Zoom}),
ITEM.RADIO(["DoubleClick","Double-Click"], "zoom", {action: MENU.Zoom}),
ITEM.RADIO(["NoZoom","No Zoom"], "zoom", {value: "None"}),
ITEM.RULE(),
ITEM.LABEL("Trigger Requires:"),
ITEM.CHECKBOX((HUB.Browser.isMac ? "Option" : "Alt"), "ALT"),
ITEM.CHECKBOX("Command", "CMD", {hidden: !HUB.Browser.isMac}),
ITEM.CHECKBOX("Control", "CTRL", {hidden: HUB.Browser.isMac}),
ITEM.CHECKBOX("Shift", "Shift")
ITEM.LABEL(["TriggerRequires","Trigger Requires:"]),
ITEM.CHECKBOX((HUB.Browser.isMac ? ["Option","Option"] : ["Alt","Alt"]), "ALT"),
ITEM.CHECKBOX(["Command","Command"], "CMD", {hidden: !HUB.Browser.isMac}),
ITEM.CHECKBOX(["Control","Control"], "CTRL", {hidden: HUB.Browser.isMac}),
ITEM.CHECKBOX(["Shift","Shift"], "Shift")
),
ITEM.SUBMENU("Zoom Factor",
ITEM.SUBMENU(["ZoomFactor","Zoom Factor"],
ITEM.RADIO("125%", "zscale"),
ITEM.RADIO("133%", "zscale"),
ITEM.RADIO("150%", "zscale"),
@ -946,40 +1016,44 @@
ITEM.RADIO("400%", "zscale")
),
ITEM.RULE(),
ITEM.SUBMENU("Math Renderer", {hidden:!CONFIG.showRenderer},
ITEM.SUBMENU(["Renderer","Math Renderer"], {hidden:!CONFIG.showRenderer},
ITEM.RADIO("HTML-CSS", "renderer", {action: MENU.Renderer}),
ITEM.RADIO("MathML", "renderer", {action: MENU.Renderer, value:"NativeMML"}),
ITEM.RADIO("SVG", "renderer", {action: MENU.Renderer})
),
ITEM.SUBMENU("MathPlayer", {hidden:!HUB.Browser.isMSIE ||
!CONFIG.showMathPlayer,
disabled:!HUB.Browser.hasMathPlayer},
ITEM.LABEL("Let MathPlayer Handle:"),
ITEM.CHECKBOX("Menu Events", "mpContext", {action: MENU.MPEvents, hidden:!isIE9}),
ITEM.CHECKBOX("Mouse Events", "mpMouse", {action: MENU.MPEvents, hidden:!isIE9}),
ITEM.CHECKBOX("Mouse and Menu Events", "mpMouse", {action: MENU.MPEvents, hidden:isIE9})
ITEM.SUBMENU("MathPlayer", {hidden:!HUB.Browser.isMSIE || !CONFIG.showMathPlayer,
disabled:!HUB.Browser.hasMathPlayer},
ITEM.LABEL(["MPHandles","Let MathPlayer Handle:"]),
ITEM.CHECKBOX(["MenuEvents","Menu Events"], "mpContext", {action: MENU.MPEvents, hidden:!isIE9}),
ITEM.CHECKBOX(["MouseEvents","Mouse Events"], "mpMouse", {action: MENU.MPEvents, hidden:!isIE9}),
ITEM.CHECKBOX(["MenuAndMouse","Mouse and Menu Events"], "mpMouse", {action: MENU.MPEvents, hidden:isIE9})
),
ITEM.SUBMENU("Font Preference", {hidden:!CONFIG.showFontMenu},
ITEM.LABEL("For HTML-CSS:"),
ITEM.RADIO("Auto", "font", {action: MENU.Font}),
ITEM.SUBMENU(["FontPrefs","Font Preference"], {hidden:!CONFIG.showFontMenu},
ITEM.LABEL(["ForHTMLCSS","For HTML-CSS:"]),
ITEM.RADIO(["Auto","Auto"], "font", {action: MENU.Font}),
ITEM.RULE(),
ITEM.RADIO("TeX (local)", "font", {action: MENU.Font}),
ITEM.RADIO("TeX (web)", "font", {action: MENU.Font}),
ITEM.RADIO("TeX (image)", "font", {action: MENU.Font}),
ITEM.RADIO(["TeXLocal","TeX (local)"], "font", {action: MENU.Font}),
ITEM.RADIO(["TeXWeb","TeX (web)"], "font", {action: MENU.Font}),
ITEM.RADIO(["TeXImage","TeX (image)"], "font", {action: MENU.Font}),
ITEM.RULE(),
ITEM.RADIO("STIX (local)", "font", {action: MENU.Font})
ITEM.RADIO(["STIXlocal","STIX (local)"], "font", {action: MENU.Font})
),
ITEM.SUBMENU("Contextual Menu", {hidden:!CONFIG.showContext},
ITEM.SUBMENU(["ContextMenu","Contextual Menu"], {hidden:!CONFIG.showContext},
ITEM.RADIO("MathJax", "context"),
ITEM.RADIO("Browser", "context")
ITEM.RADIO(["Browser","Browser"], "context")
),
ITEM.COMMAND("Scale All Math ...",MENU.Scale),
ITEM.RULE().With({hidden:!CONFIG.showDiscoverable, name:"discover_rule"}),
ITEM.CHECKBOX("Highlight on Hover", "discoverable", {hidden:!CONFIG.showDiscoverable})
ITEM.COMMAND(["Scale","Scale All Math ..."],MENU.Scale),
ITEM.RULE().With({hidden:!CONFIG.showDiscoverable, name:["","discover_rule"]}),
ITEM.CHECKBOX(["Discoverable","Highlight on Hover"], "discoverable", {hidden:!CONFIG.showDiscoverable})
),
ITEM.SUBMENU(["Locale","Language"], {hidden:!CONFIG.showLocale},
ITEM.RADIO("en", "locale", {action: MENU.Locale}),
ITEM.RULE(),
ITEM.COMMAND(["LoadLocale","Load from URL ..."], MENU.LoadLocale)
),
ITEM.RULE(),
ITEM.COMMAND("About MathJax",MENU.About),
ITEM.COMMAND("MathJax Help",MENU.Help)
ITEM.COMMAND(["About","About MathJax"],MENU.About),
ITEM.COMMAND(["Help","MathJax Help"],MENU.Help)
);
if (MENU.isMobile) {
@ -997,6 +1071,32 @@
}
});
//
// Creates the locale menu from the list of locales in MathJax.Localization.strings
//
MENU.CreateLocaleMenu = function () {
var menu = MENU.menu.Find("Language").menu, items = menu.items;
//
// Get the names of the languages and sort them
//
var locales = [], LOCALE = MathJax.Localization.strings;
for (var id in LOCALE) {if (LOCALE.hasOwnProperty(id)) {locales.push(id)}}
locales = locales.sort(); menu.items = [];
//
// Add a menu item for each
//
for (var i = 0, m = locales.length; i < m; i++) {
var title = LOCALE[locales[i]].menuTitle;
if (title) {title += " ("+locales[i]+")"} else {title = locales[i]}
menu.items.push(ITEM.RADIO([locales[i],title],"locale",{action:MENU.Locale}));
}
//
// Add the rule and "Load from URL" items
//
menu.items.push(items[items.length-2],items[items.length-1]);
};
MENU.CreateLocaleMenu();
MENU.showRenderer = function (show) {
MENU.cookie.showRenderer = CONFIG.showRenderer = show; MENU.saveCookie();
@ -1015,10 +1115,14 @@
MENU.menu.Find("Math Settings","Contextual Menu").hidden = !show;
};
MENU.showDiscoverable = function (show) {
MENU.cookie.showContext = CONFIG.showContext = show; MENU.saveCookie();
MENU.cookie.showDiscoverable = CONFIG.showDiscoverable = show; MENU.saveCookie();
MENU.menu.Find("Math Settings","Highlight on Hover").hidden = !show;
MENU.menu.Find("Math Settings","discover_rule").hidden = !show;
};
MENU.showLocale = function (show) {
MENU.cookie.showLocale = CONFIG.showLocale = show; MENU.saveCookie();
MENU.menu.Find("Language").hidden = !show;
};
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
if (!MathJax.OutputJax["HTML-CSS"].config.imageFont)

View File

@ -162,8 +162,13 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
var arg = this.trimSpaces(this.GetArgument(name)), tag = arg;
if (!star) {arg = CONFIG.formatTag(arg)}
var global = this.stack.global; global.tagID = tag;
if (global.notags) {TEX.Error(name+" not allowed in "+global.notags+" environment")}
if (global.tag) {TEX.Error("Multiple "+name)}
if (global.notags) {
TEX.Error(["CommandNotAllowedInEnv",
"%1 not allowed in %2 environment",
name,global.notags]
);
}
if (global.tag) {TEX.Error(["MultipleCommand","Multiple %1",name])}
global.tag = MML.mtd.apply(MML,this.InternalMath(arg)).With({id:CONFIG.formatID(tag)});
},
HandleNoTag: function (name) {
@ -178,9 +183,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
var global = this.stack.global, label = this.GetArgument(name);
if (label === "") return;
if (!AMS.refUpdate) {
if (global.label) {TEX.Error("Multiple "+name+"'s")}
if (global.label) {TEX.Error(["MultipleCommand","Multiple %1",name])}
global.label = label;
if (AMS.labels[label] || AMS.eqlabels[label]) {TEX.Error("Label '"+label+"' mutiply defined")}
if (AMS.labels[label] || AMS.eqlabels[label])
{TEX.Error(["MultipleLabel","Label '%1' multiply defined",label])}
AMS.eqlabels[label] = "???"; // will be replaced by tag value later
}
},
@ -224,7 +230,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
*/
HandleShove: function (name,shove) {
var top = this.stack.Top();
if (top.type !== "multline" || top.data.length) {TEX.Error(name+" must come at the beginning of the line")}
if (top.type !== "multline" || top.data.length) {
TEX.Error(["CommandAtTheBeginingOfLine",
"%1 must come at the beginning of the line",name]);
}
top.data.shove = shove;
},
@ -238,7 +247,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
var frac = MML.mfrac(TEX.Parse('\\strut\\textstyle{'+num+'}',this.stack.env).mml(),
TEX.Parse('\\strut\\textstyle{'+den+'}',this.stack.env).mml());
lr = ({l:MML.ALIGN.LEFT, r:MML.ALIGN.RIGHT,"":""})[lr];
if (lr == null) {TEX.Error("Illegal alignment specified in "+name)}
if (lr == null)
{TEX.Error(["IllegalAlign","Illegal alignment specified in %1",name])}
if (lr) {frac.numalign = frac.denomalign = lr}
this.Push(frac);
},
@ -258,7 +268,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
if (left || right) {frac = TEX.mfenced(left,frac,right)}
if (style !== "") {
var STYLE = (["D","T","S","SS"])[style];
if (STYLE == null) {TEX.Error("Bad math style for "+name)}
if (STYLE == null)
{TEX.Error(["BadMathStyleFor","Bad math style for %1",name])}
frac = MML.mstyle(frac);
if (STYLE === "D") {frac.displaystyle = true; frac.scriptlevel = 0}
else {frac.displaystyle = false; frac.scriptlevel = style - 1}
@ -309,7 +320,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
var n, valign, align = "", spacing = [];
if (!taggable) {valign = this.GetBrackets("\\begin{"+begin.name+"}")}
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(["PositiveIntegerArg","Argument to %1 must me a positive integer",
"\\begin{"+begin.name+"}"]);
}
while (n > 0) {align += "rl"; spacing.push("0em 0em"); n--}
spacing = spacing.join(" ");
if (taggable) {return this.AMSarray(begin,numbered,taggable,align,spacing)}
@ -334,7 +348,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
* Check for bad nesting of equation environments
*/
checkEqnEnv: function () {
if (this.stack.global.eqnenv) {TEX.Error("Erroneous nesting of equation structures")}
if (this.stack.global.eqnenv)
{TEX.Error(["ErroneousNestingEq","Erroneous nesting of equation structures"])}
this.stack.global.eqnenv = true;
},
@ -379,7 +394,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
GetDelimiterArg: function (name) {
var c = this.trimSpaces(this.GetArgument(name));
if (c == "") {return null}
if (TEXDEF.delimiter[c] == null) {TEX.Error("Missing or unrecognized delimiter for "+name)}
if (TEXDEF.delimiter[c] == null) {
TEX.Error(["MissingOrUnrecognizedDelim",
"Missing or unrecognized delimiter for %1",name]);
}
return this.convertDelimiter(c);
},
@ -441,7 +459,11 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
this.data = [];
},
EndRow: function () {
if (this.row.length != 1) {TEX.Error("multline rows must have exactly one column")}
if (this.row.length != 1) {
TEX.Error(["MultlineRowsOneCol",
"The rows within the %1 environment must have exactly one column",
"multline"]);
}
this.table.push(this.row); this.row = [];
},
EndTable: function () {

View File

@ -1,3 +1,6 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/extensions/TeX/bbox.js
@ -43,7 +46,7 @@
*/
MathJax.Extension["TeX/bbox"] = {
version: "2.1"
version: "2.1.1"
};
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
@ -62,17 +65,24 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
var part = parts[i].replace(/^\s+/,'').replace(/\s+$/,'');
var match = part.match(/^(\.\d+|\d+(\.\d*)?)(pt|em|ex|mu|px|in|cm|mm)$/);
if (match) {
if (def)
{TEX.Error(["MultipleBBoxProperty","%1 specified twice in %2","Padding",name])}
var pad = match[1]+match[3];
if (def) {TEX.Error("Padding specified twice in "+name)}
def = {height:"+"+pad, depth:"+"+pad, lspace:pad, width:"+"+(2*match[1])+match[3]};
} else if (part.match(/^([a-z0-9]+|\#[0-9a-f]{6}|\#[0-9a-f]{3})$/i)) {
if (background) {TEX.Error("Background specified twice in "+name)}
if (background)
{TEX.Error(["MultipleBBoxProperty","%1 specified twice in %2","Background",name])}
background = part;
} else if (part.match(/^[-a-z]+:/i)) {
if (style) {TEX.Error("Style specified twice in "+name)}
if (style)
{TEX.Error(["MultipleBBoxProperty","%1 specified twice in %2", "Style",name])}
style = part;
} else if (part !== "") {
TEX.Error("'"+part+"' doesn't look like a color, a padding dimension, or a style");
TEX.Error(
["InvalidBBoxProperty",
"'%1' doesn't look like a color, a padding dimension, or a style",
part]
);
}
}
if (def) {math = MML.mpadded(math).With(def)}

View File

@ -1,3 +1,6 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/extensions/TeX/begingroup.js
@ -23,7 +26,7 @@
*/
MathJax.Extension["TeX/begingroup"] = {
version: "2.1"
version: "2.1.1"
};
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
@ -213,7 +216,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
if (TEX.eqnStack.top > 1) {
TEX.eqnStack.Pop();
} else if (TEX.rootStack.top === 1) {
TEX.Error("Extra "+name+" or missing \\begingroup");
TEX.Error(["ExtraEndMissingBegin","Extra %1 or missing \\begingroup",name]);
} else {
TEX.eqnStack.Clear();
TEX.rootStack.Pop();
@ -288,8 +291,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
//
Global: function (name) {
var i = this.i; var cs = this.GetCSname(name); this.i = i;
if (cs !== "let" && cs !== "def" && cs !== "newcommand")
{TEX.Error(name+" not followed by \\let, \\def, or \\newcommand")}
if (cs !== "let" && cs !== "def" && cs !== "newcommand") {
TEX.Error(["GlobalNotFollowedBy",
"%1 not followed by \\let, \\def, or \\newcommand",name]);
}
this.stack.env.isGlobal = true;
}

View File

@ -1,3 +1,6 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/extensions/TeX/color.js
@ -112,7 +115,7 @@ MathJax.Extension["TeX/color"] = {
getColor: function (model,def) {
if (!model) {model = "named"}
var fn = this["get_"+model];
if (!fn) {this.TEX.Error("Color model '"+model+"' not defined")}
if (!fn) {this.TEX.Error(["UndefinedColorModel","Color model '%1' not defined",model])}
return fn.call(this,def);
},
@ -121,11 +124,17 @@ MathJax.Extension["TeX/color"] = {
*/
get_rgb: function (rgb) {
rgb = rgb.replace(/^\s+/,"").replace(/\s+$/,"").split(/\s*,\s*/); var RGB = "#";
if (rgb.length !== 3) {this.TEX.Error("rgb colors require 3 decimal numbers")}
if (rgb.length !== 3)
{this.TEX.Error(["ModelArg1","Color values for the %1 model require 3 numbers","rgb"])}
for (var i = 0; i < 3; i++) {
if (!rgb[i].match(/^(\d+(\.\d*)?|\.\d+)$/)) {this.TEX.Error("Invalid decimal number")}
if (!rgb[i].match(/^(\d+(\.\d*)?|\.\d+)$/))
{this.TEX.Error(["InvalidDecimalNumber","Invalid decimal number"])}
var n = parseFloat(rgb[i]);
if (n < 0 || n > 1) {this.TEX.Error("rgb values must be between 0 and 1")}
if (n < 0 || n > 1) {
this.TEX.Error(["ModelArg2",
"Color values for the %1 model must be between %2 and %3",
"rgb",0,1]);
}
n = Math.floor(n*255).toString(16); if (n.length < 2) {n = "0"+n}
RGB += n;
}
@ -137,11 +146,17 @@ MathJax.Extension["TeX/color"] = {
*/
get_RGB: function (rgb) {
rgb = rgb.replace(/^\s+/,"").replace(/\s+$/,"").split(/\s*,\s*/); var RGB = "#";
if (rgb.length !== 3) {this.TEX.Error("RGB colors require 3 numbers")}
if (rgb.length !== 3)
{this.TEX.Error(["ModelArg1","Color values for the %1 model require 3 numbers","RGB"])}
for (var i = 0; i < 3; i++) {
if (!rgb[i].match(/^\d+$/)) {this.TEX.Error("Invalid number")}
if (!rgb[i].match(/^\d+$/))
{this.TEX.Error(["InvalidNumber","Invalid number"])}
var n = parseInt(rgb[i]);
if (n > 255) {this.TEX.Error("RGB values must be between 0 and 255")}
if (n > 255) {
this.TEX.Error(["ModelArg2",
"Color values for the %1 model must be between %2 and %3",
"RGB",0,255]);
}
n = n.toString(16); if (n.length < 2) {n = "0"+n}
RGB += n;
}
@ -152,9 +167,14 @@ MathJax.Extension["TeX/color"] = {
* Get a gray-scale value
*/
get_gray: function (gray) {
if (!gray.match(/^\s*(\d+(\.\d*)?|\.\d+)\s*$/)) {this.TEX.Error("Invalid decimal number")}
if (!gray.match(/^\s*(\d+(\.\d*)?|\.\d+)\s*$/))
{this.TEX.Error(["InvalidDecimalNumber","Invalid decimal number"])}
var n = parseFloat(gray);
if (n < 0 || n > 1) {this.TEX.Error("Grey-scale values must be between 0 and 1")}
if (n < 0 || n > 1) {
this.TEX.Error(["ModelArg2",
"Color values for the %1 model must be between %2 and %3",
"gray",0,1]);
}
n = Math.floor(n*255).toString(16); if (n.length < 2) {n = "0"+n}
return "#"+n+n+n;
},

View File

@ -1,3 +1,6 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/extensions/TeX/extpfeil.js
@ -22,7 +25,7 @@
*/
MathJax.Extension["TeX/extpfeil"] = {
version: "2.1"
version: "2.1.1"
};
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
@ -70,12 +73,24 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
var cs = this.GetArgument(name),
space = this.GetArgument(name),
chr = this.GetArgument(name);
if (!cs.match(/^\\([a-z]+|.)$/i))
{TEX.Error("First argument to "+name+" must be a control sequence name")}
if (!space.match(/^(\d+),(\d+)$/))
{TEX.Error("Second argument to "+name+" must be two integers separated by a comma")}
if (!chr.match(/^(\d+|0x[0-9A-F]+)$/i))
{TEX.Error("Third argument to "+name+" must be a unicode character number")}
if (!cs.match(/^\\([a-z]+|.)$/i)) {
TEX.Error(["NewextarrowArg1",
"First argument to %1 must be a control sequence name",name]);
}
if (!space.match(/^(\d+),(\d+)$/)) {
TEX.Error(
["NewextarrowArg2",
"Second argument to %1 must be two integers separated by a comma",
name]
);
}
if (!chr.match(/^(\d+|0x[0-9A-F]+)$/i)) {
TEX.Error(
["NewextarrowArg3",
"Third argument to %1 must be a unicode character number",
name]
);
}
cs = cs.substr(1); space = space.split(","); chr = parseInt(chr);
TEXDEF.macros[cs] = ['xArrow',chr,parseInt(space[0]),parseInt(space[1])];
}

View File

@ -1,3 +1,6 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/extensions/TeX/mhchem.js
@ -23,7 +26,7 @@
*/
MathJax.Extension["TeX/mhchem"] = {
version: "2.1"
version: "2.1.1"
};
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
@ -350,11 +353,13 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
if (C === "{") {braces++} else
if (C === "}") {
if (braces) {braces--}
else {TEX.Error("Extra close brace or missing open brace")}
else {
TEX.Error(["ExtraCloseMissingOpen","Extra close brace or missing open brace"])
}
}
}
if (braces) {TEX.Error("Missing close brace")};
TEX.Error("Can't find closing "+c);
if (braces) {TEX.Error(["MissingCloseBrace","Missing close brace"])}
TEX.Error(["NoClosingChar","Can't find closing %1",c]);
}
});

View File

@ -1,3 +1,6 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/extensions/TeX/newcommand.js
@ -23,7 +26,7 @@
*/
MathJax.Extension["TeX/newcommand"] = {
version: "2.1"
version: "2.1.1"
};
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
@ -53,10 +56,16 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
opt = this.GetBrackets(name),
def = this.GetArgument(name);
if (cs.charAt(0) === "\\") {cs = cs.substr(1)}
if (!cs.match(/^(.|[a-z]+)$/i)) {TEX.Error("Illegal control sequence name for "+name)}
if (!cs.match(/^(.|[a-z]+)$/i)) {
TEX.Error(["IllegalControlSequenceName",
"Illegal control sequence name for %1",name]);
}
if (n) {
n = this.trimSpaces(n);
if (!n.match(/^[0-9]+$/)) {TEX.Error("Illegal number of parameters specified in "+name)}
if (!n.match(/^[0-9]+$/)) {
TEX.Error(["IllegalParamNumber",
"Illegal number of parameters specified in %1",name]);
}
}
this.setDef(cs,['Macro',def,n,opt]);
},
@ -71,7 +80,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
edef = this.GetArgument(name);
if (n) {
n = this.trimSpaces(n);
if (!n.match(/^[0-9]+$/)) {TEX.Error("Illegal number of parameters specified in "+name)}
if (!n.match(/^[0-9]+$/)) {
TEX.Error(["IllegalParamNumber",
"Illegal number of parameters specified in %1",name]);
}
}
this.setEnv(env,['BeginEnv','EndEnv',bdef,edef,n]);
},
@ -128,7 +140,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
*/
GetCSname: function (cmd) {
var c = this.GetNext();
if (c !== "\\") {TEX.Error("\\ must be followed by a control sequence")}
if (c !== "\\") {
TEX.Error(["DoubleBackSlash",
"\\ must be followed by a control sequence"])
}
var cs = this.trimSpaces(this.GetArgument(cmd));
return cs.substr(1);
},
@ -144,8 +159,14 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
if (c === '#') {
if (i !== this.i) {params[n] = this.string.substr(i,this.i-i)}
c = this.string.charAt(++this.i);
if (!c.match(/^[1-9]$/)) {TEX.Error("Illegal use of # in template for "+cs)}
if (parseInt(c) != ++n) {TEX.Error("Parameters for "+cs+" must be numbered sequentially")}
if (!c.match(/^[1-9]$/)) {
TEX.Error(["CantUseHash2",
"Illegal use of # in template for %1",cs]);
}
if (parseInt(c) != ++n) {
TEX.Error(["SequentialParam",
"Parameters for %1 must be numbered sequentially",cs]);
}
i = this.i+1;
} else if (c === '{') {
if (i !== this.i) {params[n] = this.string.substr(i,this.i-i)}
@ -153,7 +174,8 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
}
this.i++;
}
TEX.Error("Missing replacement string for definition of "+cmd);
TEX.Error(["MissingReplacementString",
"Missing replacement string for definition of %1",cmd]);
},
/*
@ -162,15 +184,20 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
MacroWithTemplate: function (name,text,n,params) {
if (n) {
var args = []; this.GetNext();
if (params[0] && !this.MatchParam(params[0]))
{TEX.Error("Use of "+name+" doesn't match its definition")}
if (params[0] && !this.MatchParam(params[0])) {
TEX.Error(["MismatchUseDef",
"Use of %1 doesn't match its definition",name]);
}
for (var i = 0; i < n; i++) {args.push(this.GetParameter(name,params[i+1]))}
text = this.SubstituteArgs(args,text);
}
this.string = this.AddArgs(text,this.string.slice(this.i));
this.i = 0;
if (++this.macroCount > TEX.config.MAXMACROS)
{TEX.Error("MathJax maximum macro substitution count exceeded; is there a recursive macro call?")}
if (++this.macroCount > TEX.config.MAXMACROS) {
TEX.Error(["MaxMacroSub1",
"MathJax maximum macro substitution count exceeded; " +
"is there a recursive macro call?"]);
}
},
/*
@ -209,7 +236,7 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
this.i++; j++; hasBraces = 0;
}
}
TEX.Error("Runaway argument for "+name+"?");
TEX.Error(["RunawayArgument","Runaway argument for %1?",name]);
},
/*

View File

@ -1,3 +1,6 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/extensions/TeX/verb.js
@ -41,10 +44,10 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
*/
Verb: function (name) {
var c = this.GetNext(); var start = ++this.i;
if (c == "" ) {TEX.Error(name+" requires an argument")}
if (c == "" ) {TEX.Error(["MissingArgFor","Missing argument for %1",name])}
while (this.i < this.string.length && this.string.charAt(this.i) != c) {this.i++}
if (this.i == this.string.length)
{TEX.Error("Can't find closing delimiter for "+name)}
if (this.i == this.string.length)
{TEX.Error(["NoClosingDelim","Can't find closing delimiter for %1", name])}
var text = this.string.slice(start,this.i).replace(/ /g,"\u00A0"); this.i++;
this.Push(MML.mtext(text).With({mathvariant:MML.VARIANT.MONOSPACE}));
}

View File

@ -27,7 +27,7 @@
MathJax.InputJax.AsciiMath = MathJax.InputJax({
id: "AsciiMath",
version: "2.1",
version: "2.1.1",
directory: MathJax.InputJax.directory + "/AsciiMath",
extensionDir: MathJax.InputJax.extensionDir + "/AsciiMath",

View File

@ -1268,7 +1268,7 @@ junk = null;
var MML;
ASCIIMATH.Augment({
sourceMenuTitle: "AsciiMath Input",
sourceMenuTitle: /*_(MathMenu)*/ ["AsciiMathInput","AsciiMath Input"],
prefilterHooks: MathJax.Callback.Hooks(true), // hooks to run before processing AsciiMath
postfilterHooks: MathJax.Callback.Hooks(true), // hooks to run after processing AsciiMath

View File

@ -29,6 +29,11 @@
(function (MATHML,BROWSER) {
var MML;
var _ = function (id) {
return MathJax.Localization._.apply(MathJax.Localization,
[["MathML",id]].concat([].slice.call(arguments,1)))
};
MATHML.Parse = MathJax.Object.Subclass({
Init: function (string) {this.Parse(string)},
@ -40,18 +45,24 @@
var doc;
if (typeof math !== "string") {doc = math.parentNode} else {
doc = MATHML.ParseXML(this.preProcessMath.call(this,math));
if (doc == null) {MATHML.Error("Error parsing MathML")}
if (doc == null) {MATHML.Error(["ErrorParsingMathML","Error parsing MathML"])}
}
var err = doc.getElementsByTagName("parsererror")[0];
if (err) MATHML.Error("Error parsing MathML: "+err.textContent.replace(/This page.*?errors:|XML Parsing Error: |Below is a rendering of the page.*/g,""));
if (doc.childNodes.length !== 1) MATHML.Error("MathML must be formed by a single element");
if (err) MATHML.Error(["ParsingError","Error parsing MathML: %1",
err.textContent.replace(/This page.*?errors:|XML Parsing Error: |Below is a rendering of the page.*/g,"")]);
if (doc.childNodes.length !== 1)
{MATHML.Error(["MathMLSingleElement","MathML must be formed by a single element"])}
if (doc.firstChild.nodeName.toLowerCase() === "html") {
var h1 = doc.getElementsByTagName("h1")[0];
if (h1 && h1.textContent === "XML parsing error" && h1.nextSibling)
MATHML.Error("Error parsing MathML: "+String(h1.nextSibling.nodeValue).replace(/fatal parsing error: /,""));
MATHML.Error(["ParsingError","Error parsing MathML: %1",
String(h1.nextSibling.nodeValue).replace(/fatal parsing error: /,"")]);
}
if (doc.firstChild.nodeName.toLowerCase().replace(/^[a-z]+:/,"") !== "math") {
MATHML.Error(["MathMLRootElement",
"MathML must be formed by a <math> element, not %1",
"<"+doc.firstChild.nodeName+">"]);
}
if (doc.firstChild.nodeName.toLowerCase().replace(/^[a-z]+:/,"") !== "math")
MATHML.Error("MathML must be formed by a <math> element, not <"+doc.firstChild.nodeName+">");
this.mml = this.MakeMML(doc.firstChild);
},
@ -66,7 +77,7 @@
mml = this.TeXAtom(match[2]);
} else if (!(MML[type] && MML[type].isa && MML[type].isa(MML.mbase))) {
MathJax.Hub.signal.Post(["MathML Jax - unknown node type",type]);
return MML.merror("Unknown node type: "+type);
return MML.merror(_("UnknownNodeType","Unknown node type: %1",type));
} else {
mml = MML[type]();
}
@ -142,7 +153,8 @@
var text = child.nodeValue.replace(/&([a-z][a-z0-9]*);/ig,this.replaceEntity);
mml.Append(MML.chars(this.trimSpace(text)));
} else if (child.nodeValue.match(/\S/)) {
MATHML.Error("Unexpected text node: '"+child.nodeValue+"'");
MATHML.Error(["UnexpectedTextNode",
"Unexpected text node: %1","'"+child.nodeValue+"'"]);
}
} else if (mml.type === "annotation-xml") {
mml.Append(MML.xml(child));
@ -172,7 +184,8 @@
// HTML5 removes xmlns: namespaces, so put them back for XML
var match = math.match(/^(<math( ('.*?'|".*?"|[^>])+)>)/i);
if (match && match[2].match(/ (?!xmlns=)[a-z]+=\"http:/i)) {
math = match[1].replace(/ (?!xmlns=)([a-z]+=(['"])http:.*?\2)/ig," xmlns:$1 $1") + math.substr(match[0].length);
math = match[1].replace(/ (?!xmlns=)([a-z]+=(['"])http:.*?\2)/ig," xmlns:$1 $1") +
math.substr(match[0].length);
}
if (math.match(/^<math/i) && !math.match(/^<[^<>]* xmlns=/)) {
// append the MathML namespace
@ -215,7 +228,7 @@
/************************************************************************/
MATHML.Augment({
sourceMenuTitle: "Original MathML",
sourceMenuTitle: /*_(MathMenu)*/ ["OriginalMathML","Original MathML"],
prefilterHooks: MathJax.Callback.Hooks(true), // hooks to run before processing MathML
postfilterHooks: MathJax.Callback.Hooks(true), // hooks to run after processing MathML
@ -249,6 +262,10 @@
return MML.merror(message);
},
Error: function (message) {
//
// Translate message if it is ["id","message",args]
//
if (message instanceof Array) {message = _.apply(_,message)}
throw MathJax.Hub.Insert(Error(message),{mathmlError: true});
},
//
@ -283,12 +300,7 @@
} else if (window.ActiveXObject) {
this.parser = this.createMSParser();
if (!this.parser) {
alert("MathJax can't create an XML parser for MathML. Check that\n"+
"the 'Script ActiveX controls marked safe for scripting' security\n"+
"setting is enabled (use the Internet Options item in the Tools\n"+
"menu, and select the Security panel, then press the Custom Level\n"+
"button to check this).\n\n"+
"MathML equations will not be able to be processed by MathJax.");
MathJax.Localization.Try(this.parserCreationError);
return(this.parseError);
}
this.parser.async = false;
@ -302,6 +314,15 @@
else {document.body.insertBefore(this.div,document.body.firstChild)}
return(this.parseDIV);
},
parserCreationError: function () {
alert(_("CantCreateXMLParser",
"MathJax can't create an XML parser for MathML. Check that\n"+
"the 'Script ActiveX controls marked safe for scripting' security\n"+
"setting is enabled (use the Internet Options item in the Tools\n"+
"menu, and select the Security panel, then press the Custom Level\n"+
"button to check this).\n\n"+
"MathML equations will not be able to be processed by MathJax."));
},
//
// Initialize the parser object (whichever type is used)
//

View File

@ -29,6 +29,11 @@
(function (TEX,HUB,AJAX) {
var MML, NBSP = "\u00A0";
var _ = function (id) {
return MathJax.Localization._.apply(MathJax.Localization,
[["TeX", id]].concat([].slice.call(arguments,1)));
};
var STACK = MathJax.Object.Subclass({
Init: function (env,inner) {
this.global = {isInner: inner};
@ -75,8 +80,8 @@
var STACKITEM = STACK.Item = MathJax.Object.Subclass({
type: "base",
closeError: "Extra close brace or missing open brace",
rightError: "Missing \\left or extra \\right",
closeError: /*_()*/ ["ExtraCloseMissingOpen","Extra close brace or missing open brace"],
rightError: /*_()*/ ["MissingLeftExtraRight","Missing \\left or extra \\right"],
Init: function () {
if (this.isOpen) {this.env = {}}
this.data = [];
@ -93,7 +98,7 @@
if (item.type === "over" && this.isOpen) {item.num = this.mmlData(false); this.data = []}
if (item.type === "cell" && this.isOpen) {
if (item.linebreak) {return false}
TEX.Error("Misplaced "+item.name);
TEX.Error(["Misplaced","Misplaced %1",item.name]);
}
if (item.isClose && this[item.type+"Error"]) {TEX.Error(this[item.type+"Error"])}
if (!item.isNotStack) {return true}
@ -124,10 +129,10 @@
STACKITEM.open = STACKITEM.Subclass({
type: "open", isOpen: true,
stopError: "Extra open brace or missing close brace",
stopError: /*_()*/ ["ExtraOpenMissingClose","Extra open brace or missing close brace"],
checkItem: function (item) {
if (item.type === "close") {
var mml = this.mmlData(); // this.mmlData(true,true); // force row
var mml = this.mmlData();
return STACKITEM.mml(MML.TeXAtom(mml)); // TeXAtom make it an ORD to prevent spacing (FIXME: should be another way)
}
return this.SUPER(arguments).checkItem.call(this,item);
@ -150,9 +155,10 @@
STACKITEM.subsup = STACKITEM.Subclass({
type: "subsup",
stopError: "Missing superscript or subscript argument",
stopError: /*_()*/ ["MissingScript","Missing superscript or subscript argument"],
supError: /*_()*/ ["MissingOpenForSup","Missing open brace for superscript"],
subError: /*_()*/ ["MissingOpenForSup","Missing open brace for subscript"],
checkItem: function (item) {
var script = ["","subscript","superscript"][this.position];
if (item.type === "open" || item.type === "left") {return true}
if (item.type === "mml") {
if (this.primes) {
@ -163,7 +169,7 @@
return STACKITEM.mml(this.data[0]);
}
if (this.SUPER(arguments).checkItem.call(this,item))
{TEX.Error("Missing open brace for "+script)}
{TEX.Error(this[["","subError","supError"][this.position]])}
},
Pop: function () {}
});
@ -171,7 +177,8 @@
STACKITEM.over = STACKITEM.Subclass({
type: "over", isClose: true, name: "\\over",
checkItem: function (item,stack) {
if (item.type === "over") {TEX.Error("Ambiguous use of "+item.name)}
if (item.type === "over")
{TEX.Error(["AmbiguousUseOf","Ambiguous use of %1",item.name])}
if (item.isClose) {
var mml = MML.mfrac(this.num,this.mmlData(false));
if (this.thickness != null) {mml.linethickness = this.thickness}
@ -189,7 +196,7 @@
STACKITEM.left = STACKITEM.Subclass({
type: "left", isOpen: true, delim: '(',
stopError: "Extra \\left or missing \\right",
stopError: /*_()*/ ["ExtraLeftMissingRight", "Extra \\left or missing \\right"],
checkItem: function (item) {
if (item.type === "right")
{return STACKITEM.mml(TEX.mfenced(this.delim,this.mmlData(),item.delim))}
@ -206,11 +213,12 @@
checkItem: function (item) {
if (item.type === "end") {
if (item.name !== this.name)
{TEX.Error("\\begin{"+this.name+"} ended with \\end{"+item.name+"}")}
{TEX.Error(["EnvBadEnd","\\begin{%1} ended with \\end{%2}",this.name,item.name])}
if (!this.end) {return STACKITEM.mml(this.mmlData())}
return this.parse[this.end].call(this.parse,this,this.data);
}
if (item.type === "stop") {TEX.Error("Missing \\end{"+this.name+"}")}
if (item.type === "stop")
{TEX.Error(["EnvMissingEnd","Missing \\end{%1}",this.name])}
return this.SUPER(arguments).checkItem.call(this,item);
}
});
@ -231,7 +239,7 @@
STACKITEM.position = STACKITEM.Subclass({
type: "position",
checkItem: function (item) {
if (item.isClose) {TEX.Error("Missing box for "+this.name)}
if (item.isClose) {TEX.Error(["MissingBoxFor","Missing box for %1",name])}
if (item.isNotStack) {
var mml = item.mmlData();
switch (this.move) {
@ -271,7 +279,7 @@
mml = STACKITEM.mml(mml);
if (this.requireClose) {
if (item.type === 'close') {return mml}
TEX.Error("Missing close brace");
TEX.Error(["MissingCloseBrace","Missing close brace"]);
}
return [mml,item];
}
@ -1116,7 +1124,7 @@
// (overridden in noUndefined extension)
//
csUndefined: function (name) {
TEX.Error("Undefined control sequence "+name);
TEX.Error(["UndefinedControlSequence","Undefined control sequence %1",name]);
},
/*
@ -1161,7 +1169,8 @@
else {base = this.stack.Prev(); if (!base) {base = MML.mi("")}}
if (base.isEmbellishedWrapper) {base = base.data[0].data[0]}
if (base.type === "msubsup") {
if (base.data[base.sup]) {TEX.Error("Double exponent: use braces to clarify")}
if (base.data[base.sup])
{TEX.Error(["DoubleExponent","Double exponent: use braces to clarify"])}
position = base.sup;
} else if (base.movesupsub) {
if (base.type !== "munderover" || base.data[base.over]) {
@ -1183,7 +1192,8 @@
else {base = this.stack.Prev(); if (!base) {base = MML.mi("")}}
if (base.isEmbellishedWrapper) {base = base.data[0].data[0]}
if (base.type === "msubsup") {
if (base.data[base.sub]) {TEX.Error("Double subscripts: use braces to clarify")}
if (base.data[base.sub])
{TEX.Error(["DoubleSubscripts","Double subscripts: use braces to clarify"])}
position = base.sub;
} else if (base.movesupsub) {
if (base.type !== "munderover" || base.data[base.under]) {
@ -1200,8 +1210,10 @@
PRIME: "\u2032", SMARTQUOTE: "\u2019",
Prime: function (c) {
var base = this.stack.Prev(); if (!base) {base = MML.mi()}
if (base.type === "msubsup" && base.data[base.sup])
{TEX.Error("Prime causes double exponent: use braces to clarify")}
if (base.type === "msubsup" && base.data[base.sup]) {
TEX.Error(["DoubleExponentPrime",
"Prime causes double exponent: use braces to clarify"]);
}
var sup = ""; this.i--;
do {sup += this.PRIME; this.i++, c = this.GetNext()}
while (c === "'" || c === this.SMARTQUOTE);
@ -1228,7 +1240,8 @@
* Handle hash marks outside of definitions
*/
Hash: function (c) {
TEX.Error("You can't use 'macro parameter character #' in math mode");
TEX.Error(["CantUseHash1",
"You can't use 'macro parameter character #' in math mode"]);
},
/*
@ -1281,7 +1294,8 @@
Middle: function (name) {
var delim = this.GetDelimiter(name);
if (this.stack.Top().type !== "left") {TEX.Error(name+" must be within \\left and \\right")}
if (this.stack.Top().type !== "left")
{TEX.Error(["MisplacedMiddle","%1 must be within \\left and \\right",name])}
this.Push(MML.mo(delim).With({stretchy:true}));
},
@ -1304,7 +1318,8 @@
},
Limits: function (name,limits) {
var op = this.stack.Prev("nopop");
if (!op || op.texClass !== MML.TEXCLASS.OP) {TEX.Error(name+" is allowed only on operators")}
if (!op || op.texClass !== MML.TEXCLASS.OP)
{TEX.Error(["MisplacedLimits","%1 is allowed only on operators",name])}
op.movesupsub = (limits ? true : false);
op.movablelimits = false;
},
@ -1353,10 +1368,13 @@
return n;
},
MoveRoot: function (name,id) {
if (!this.stack.env.inRoot) TEX.Error(name+" can appear only within a root");
if (this.stack.global[id]) TEX.Error("Multiple use of "+name);
if (!this.stack.env.inRoot)
{TEX.Error(["MisplacedMoveRoot","%1 can appear only within a root",name])}
if (this.stack.global[id])
{TEX.Error(["MultipleMoveRoot","Multiple use of %1",name])}
var n = this.GetArgument(name);
if (!n.match(/-?[0-9]+/)) TEX.Error("The argument to "+name+" must be an integer");
if (!n.match(/-?[0-9]+/))
{TEX.Error(["IntegerArg","The argument to %1 must be an integer",name])}
n = (n/15)+"em";
if (n.substr(0,1) !== "-") {n = "+"+n}
this.stack.global[id] = n;
@ -1411,12 +1429,17 @@
attr = this.GetBrackets(name,"").replace(/^\s+/,""),
data = this.GetArgument(name),
def = {attrNames:[]}, match;
if (!MML[type] || !MML[type].prototype.isToken) {TEX.Error(type+" is not a token element")}
if (!MML[type] || !MML[type].prototype.isToken)
{TEX.Error(["NotMathMLToken","%1 is not a token element",type])}
while (attr !== "") {
match = attr.match(/^([a-z]+)\s*=\s*('[^']*'|"[^"]*"|[^ ]*)\s*/i);
if (!match) {TEX.Error("Invalid MathML attribute: "+attr)}
if (!MML[type].prototype.defaults[match[1]] && !this.MmlTokenAllow[match[1]])
{TEX.Error(match[1]+" is not a recognized attribute for "+type)}
match = attr.match(/^([a-z]+)\s*=\s*(\'[^']*'|"[^"]*"|[^ ]*)\s*/i);
if (!match)
{TEX.Error("InvalidMathMLAttr","Invalid MathML attribute: %1",attr)}
if (!MML[type].prototype.defaults[match[1]] && !this.MmlTokenAllow[match[1]]) {
TEX.Error(["UnknownAttrForElement",
"%1 is not a recognized attribute for %2",
match[1],type]);
}
var value = match[2].replace(/^(['"])(.*)\1$/,"$2");
if (value.toLowerCase() === "true") {value = true}
else if (value.toLowerCase() === "false") {value = false}
@ -1565,12 +1588,17 @@
}
this.string = this.AddArgs(macro,this.string.slice(this.i));
this.i = 0;
if (++this.macroCount > TEX.config.MAXMACROS)
{TEX.Error("MathJax maximum macro substitution count exceeded; is there a recursive macro call?")}
if (++this.macroCount > TEX.config.MAXMACROS) {
TEX.Error(["MaxMacroSub1",
"MathJax maximum macro substitution count exceeded; " +
"is there a recursive macro call?"]);
}
},
Matrix: function (name,open,close,align,spacing,vspacing,style,cases) {
var c = this.GetNext(); if (c === "") {TEX.Error("Missing argument for "+name)}
var c = this.GetNext();
if (c === "")
{TEX.Error(["MissingArgFor","Missing argument for %1",name])}
if (c === "{") {this.i++} else {this.string = c+"}"+this.string.slice(this.i+1); this.i = 0}
var array = STACKITEM.array().With({
requireClose: true,
@ -1595,8 +1623,9 @@
var c = string.charAt(i);
if (c === "{") {braces++; i++}
else if (c === "}") {if (braces === 0) {m = 0} else {braces--; i++}}
else if (c === "&" && braces === 0) {TEX.Error("Extra alignment tab in \\cases text")}
else if (c === "\\") {
else if (c === "&" && braces === 0) {
TEX.Error(["ExtraAlignTab","Extra alignment tab in \\cases text"]);
} else if (c === "\\") {
if (string.substr(i).match(/^((\\cr)[^a-zA-Z]|\\\\)/)) {m = 0} else {i += 2}
} else {i++}
}
@ -1616,8 +1645,11 @@
var n;
if (this.string.charAt(this.i) === "[") {
n = this.GetBrackets(name,"").replace(/ /g,"");
if (n && !n.match(/^((-?(\.\d+|\d+(\.\d*)?))(pt|em|ex|mu|mm|cm|in|pc))$/))
{TEX.Error("Bracket argument to "+name+" must be a dimension")}
if (n &&
!n.match(/^((-?(\.\d+|\d+(\.\d*)?))(pt|em|ex|mu|mm|cm|in|pc))$/)) {
TEX.Error(["BracketMustBeDimension",
"Bracket argument to %1 must be a dimension",name]);
}
}
this.Push(STACKITEM.cell().With({isCR: true, name: name, linebreak: true}));
var top = this.stack.Top();
@ -1656,7 +1688,8 @@
HLine: function (name,style) {
if (style == null) {style = "solid"}
var top = this.stack.Top();
if (!top.isa(STACKITEM.array) || top.data.length) {TEX.Error("Misplaced "+name)}
if (!top.isa(STACKITEM.array) || top.data.length)
{TEX.Error(["Misplaced","Misplaced %1",name])}
if (top.table.length == 0) {
top.frame.push("top");
} else {
@ -1674,10 +1707,16 @@
Begin: function (name) {
var env = this.GetArgument(name);
if (env.match(/[^a-z*]/i)) {TEX.Error('Invalid environment name "'+env+'"')}
var cmd = this.envFindName(env); if (!cmd) {TEX.Error('Unknown environment "'+env+'"')}
if (++this.macroCount > TEX.config.MAXMACROS)
{TEX.Error("MathJax maximum substitution count exceeded; is there a recursive latex environment?")}
if (env.match(/[^a-z*]/i))
{TEX.Error(["InvalidEnv","Invalid environment name '%1'",env])}
var cmd = this.envFindName(env);
if (!cmd)
{TEX.Error(["UnknownEnv","Unknown environment '%1'",env])}
if (++this.macroCount > TEX.config.MAXMACROS) {
TEX.Error(["MaxMacroSub2",
"MathJax maximum substitution count exceeded; " +
"is there a recursive latex environment?"]);
}
if (!(cmd instanceof Array)) {cmd = [cmd]}
var mml = STACKITEM.begin().With({name: env, end: cmd[1], parse:this});
if (cmd[0] && this[cmd[0]]) {mml = this[cmd[0]].apply(this,[mml].concat(cmd.slice(2)))}
@ -1787,10 +1826,13 @@
GetArgument: function (name,noneOK) {
switch (this.GetNext()) {
case "":
if (!noneOK) {TEX.Error("Missing argument for "+name)}
if (!noneOK) {TEX.Error(["MissingArgFor","Missing argument for %1",name])}
return null;
case '}':
if (!noneOK) {TEX.Error("Extra close brace or missing open brace")}
if (!noneOK) {
TEX.Error(["ExtraCloseMissingOpen",
"Extra close brace or missing open brace"]);
}
return null;
case '\\':
this.i++; return "\\"+this.GetCS();
@ -1801,12 +1843,12 @@
case '\\': this.i++; break;
case '{': parens++; break;
case '}':
if (parens == 0) {TEX.Error("Extra close brace")}
if (parens == 0) {TEX.Error(["ExtraClose","Extra close brace"])}
if (--parens == 0) {return this.string.slice(j,this.i-1)}
break;
}
}
TEX.Error("Missing close brace");
TEX.Error(["MissingCloseBrace","Missing close brace"]);
break;
}
return this.string.charAt(this.i++);
@ -1823,14 +1865,18 @@
case '{': parens++; break;
case '\\': this.i++; break;
case '}':
if (parens-- <= 0) {TEX.Error("Extra close brace while looking for ']'")}
if (parens-- <= 0) {
TEX.Error(["ExtraCloseLooking",
"Extra close brace while looking for %1","']'"]);
}
break;
case ']':
if (parens == 0) {return this.string.slice(j,this.i-1)}
break;
}
}
TEX.Error("Couldn't find closing ']' for argument to "+name);
TEX.Error(["MissingCloseBracket",
"Couldn't find closing ']' for argument to %1",name]);
},
/*
@ -1843,7 +1889,8 @@
this.i++; if (c == "\\") {c += this.GetCS(name)}
if (TEXDEF.delimiter[c] != null) {return this.convertDelimiter(c)}
}
TEX.Error("Missing or unrecognized delimiter for "+name);
TEX.Error(["MissingOrUnrecognizedDelim",
"Missing or unrecognized delimiter for %1",name]);
},
/*
@ -1864,7 +1911,8 @@
return match[1].replace(/ /g,"");
}
}
TEX.Error("Missing dimension or its units for "+name);
TEX.Error(["MissingDimOrUnits",
"Missing dimension or its units for %1",name]);
},
/*
@ -1879,13 +1927,17 @@
case '\\': c += this.GetCS(); break;
case '{': parens++; break;
case '}':
if (parens == 0) {TEX.Error("Extra close brace while looking for "+token)}
if (parens == 0) {
TEX.Error(["ExtraCloseLooking",
"Extra close brace while looking for %1",token])
}
parens--;
break;
}
if (parens == 0 && c == token) {return this.string.slice(j,k)}
}
TEX.Error("Couldn't find "+token+" for "+name);
TEX.Error(["TokenNotFoundForCommand",
"Couldn't find %1 for %2",token,name]);
},
/*
@ -1936,7 +1988,8 @@
}
}
}
if (match !== '') {TEX.Error("Math not terminated in text box")}
if (match !== '')
{TEX.Error(["MathNotTerminated","Math not terminated in text box"])}
if (k < text.length) {mml.push(this.InternalText(text.slice(k),def))}
return mml;
},
@ -1956,8 +2009,10 @@
else if (c === '#') {
c = string.charAt(i++);
if (c === '#') {text += c} else {
if (!c.match(/[1-9]/) || c > args.length)
{TEX.Error("Illegal macro parameter reference")}
if (!c.match(/[1-9]/) || c > args.length) {
TEX.Error(["IllegalMacroParam",
"Illegal macro parameter reference"]);
}
newstring = this.AddArgs(this.AddArgs(newstring,text),args[c-1]);
text = '';
}
@ -1972,8 +2027,10 @@
*/
AddArgs: function (s1,s2) {
if (s2.match(/^[a-z]/i) && s1.match(/(^|[^\\])(\\\\)*\\[a-z]+$/i)) {s1 += ' '}
if (s1.length + s2.length > TEX.config.MAXBUFFER)
{TEX.Error("MathJax internal buffer size exceeded; is there a recursive macro call?")}
if (s1.length + s2.length > TEX.config.MAXBUFFER) {
TEX.Error(["MaxBufferSize",
"MathJax internal buffer size exceeded; is there a recursive macro call?"]);
}
return s1+s2;
}
@ -1989,7 +2046,7 @@
MAXBUFFER: 5*1024 // maximum size of TeX string to process
},
sourceMenuTitle: "TeX Commands",
sourceMenuTitle: /*_(MathMenu)*/ ["TeXCommands","TeX Commands"],
prefilterHooks: MathJax.Callback.Hooks(true), // hooks to run before processing TeX
postfilterHooks: MathJax.Callback.Hooks(true), // hooks to run after processing TeX
@ -2045,6 +2102,10 @@
// Produce an error and stop processing this equation
//
Error: function (message) {
//
// Translate message if it is ["id","message",args]
//
if (message instanceof Array) {message = _.apply(_,message)}
throw HUB.Insert(Error(message),{texError: true});
},

View File

@ -1,3 +1,6 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/output/HTML-CSS/autoload/mglyph.js
@ -22,9 +25,10 @@
*/
MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
var VERSION = "2.1";
var VERSION = "2.1.1";
var MML = MathJax.ElementJax.mml,
HTMLCSS = MathJax.OutputJax["HTML-CSS"];
HTMLCSS = MathJax.OutputJax["HTML-CSS"],
LOCALE = MathJax.Localization;
MML.mglyph.Augment({
toHTML: function (span,variant) {
@ -39,7 +43,8 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
if (HTMLCSS.Font.testFont(font)) {
this.HTMLhandleVariant(span,variant,String.fromCharCode(index));
} else {
if (values.alt === "") {values.alt = "Bad font: "+font.family}
if (values.alt === "")
{values.alt = LOCALE._(["MathML","BadMglyphFont"],"Bad font: %1",font.family)}
err = MML.merror(values.alt).With({mathsize:"75%"});
this.Append(err); err.toHTML(span); this.data.pop();
span.bbox = err.HTMLspanElement().bbox;
@ -57,7 +62,9 @@ MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
MathJax.Hub.RestartAfter(img.onload);
}
if (this.img.status !== "OK") {
err = MML.merror("Bad mglyph: "+values.src).With({mathsize:"75%"});
err = MML.merror(
LOCALE._(["MathML","BadMglyph"],"Bad mglyph: %1",values.src)
).With({mathsize:"75%"});
this.Append(err); err.toHTML(span); this.data.pop();
span.bbox = err.HTMLspanElement().bbox;
} else {

View File

@ -1,3 +1,5 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/output/HTML-CSS/config.js
@ -146,7 +148,8 @@ MathJax.Hub.Register.StartupHook("End Config",[function (HUB,HTMLCSS) {
!HUB.Browser.versionAtLeast(CONFIG.minBrowserVersion[HUB.Browser]||0.0)) {
HTMLCSS.Translate = CONFIG.minBrowserTranslate;
HUB.Config({showProcessingMessages: false});
MathJax.Message.Set("Your browser does not support MathJax",null,4000);
MathJax.Message.Set(["MathJaxNotSupported",
"Your browser does not support MathJax"],null,4000);
HUB.Startup.signal.Post("MathJax not supported");
}

View File

@ -1,5 +1,6 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/output/HTML-CSS/jax.js
@ -28,6 +29,12 @@
(function (AJAX,HUB,HTMLCSS) {
var MML, isMobile = HUB.Browser.isMobile;
var MESSAGE = function () {
var data = [].slice.call(arguments,0);
data[0][0] = ["HTML-CSS",data[0][0]];
return MathJax.Message.Set.apply(MathJax.Message,data);
};
var FONTTEST = MathJax.Object.Subclass({
timeout: (isMobile? 15:8)*1000, // timeout for loading web fonts
@ -131,7 +138,7 @@
loadWebFont: function (font) {
HUB.Startup.signal.Post("HTML-CSS Jax - Web-Font "+HTMLCSS.fontInUse+"/"+font.directory);
var n = MathJax.Message.File("Web-Font "+HTMLCSS.fontInUse+"/"+font.directory);
var n = MESSAGE(["LoadWebFont","Loading web-font %1",HTMLCSS.fontInUse+"/"+font.directory]);
var done = MathJax.Callback({}); // called when font is loaded
var callback = MathJax.Callback(["loadComplete",this,font,n,done]);
AJAX.timer.start(AJAX,[this.checkWebFont,font,callback],0,this.timeout);
@ -151,11 +158,11 @@
if (!this.webFontLoaded) {HTMLCSS.loadWebFontError(font,done)} else {done()}
},
loadError: function (font) {
MathJax.Message.Set("Can't load web font "+HTMLCSS.fontInUse+"/"+font.directory,null,2000);
MESSAGE(["CantLoadWebFont","Can't load web font %1",HTMLCSS.fontInUse+"/"+font.directory],null,2000);
HUB.Startup.signal.Post(["HTML-CSS Jax - web font error",HTMLCSS.fontInUse+"/"+font.directory,font]);
},
firefoxFontError: function (font) {
MathJax.Message.Set("Firefox can't load web fonts from a remote host",null,3000);
MESSAGE(["FirefoxCantLoadWebFont","Firefox can't load web fonts from a remote host"],null,3000);
HUB.Startup.signal.Post("HTML-CSS Jax - Firefox web fonts on remote host error");
},
@ -316,12 +323,21 @@
if (this.adjustAvailableFonts) {this.adjustAvailableFonts(this.config.availableFonts)}
if (settings.scale) {this.config.scale = settings.scale}
if (settings.font && settings.font !== "Auto") {
if (settings.font === "TeX (local)")
{this.config.availableFonts = ["TeX"]; this.config.preferredFont = "TeX"; this.config.webFont = "TeX"}
else if (settings.font === "STIX (local)")
{this.config.availableFonts = ["STIX"]; this.config.preferredFont = "STIX"; this.config.webFont = "TeX"}
else if (settings.font === "TeX (web)") {this.config.availableFonts = []; this.config.preferredFont = ""; this.config.webFont = "TeX"}
else if (settings.font === "TeX (image)") {this.config.availableFonts = []; this.config.preferredFont = ""; this.config.webFont = ""}
if (settings.font === "TeX (local)") {
this.config.availableFonts = ["TeX"];
this.config.preferredFont = this.config.webFont = "TeX";
} else if (settings.font === "STIX (local)") {
this.config.availableFonts = ["STIX"];
this.config.preferredFont = "STIX";
this.config.webFont = "TeX";
} else if (settings.font === "TeX (web)") {
this.config.availableFonts = [];
this.config.preferredFont = "";
this.config.webFont = "TeX";
} else if (settings.font === "TeX (image)") {
this.config.availableFonts = [];
this.config.preferredFont = this.config.webFont = "";
}
}
var font = this.Font.findFont(this.config.availableFonts,this.config.preferredFont);
if (!font && this.allowWebFonts) {font = this.config.webFont; if (font) {this.webFonts = true}}
@ -334,7 +350,8 @@
HUB.Startup.signal.Post("HTML-CSS Jax - using image fonts");
}
} else {
MathJax.Message.Set("Can't find a valid font using ["+this.config.availableFonts.join(", ")+"]",null,3000);
MESSAGE(["CantFindFontUsing","Can't find a valid font using %1",
"["+this.config.availableFonts.join(", ")+"]"],null,3000);
this.fontInUse = "generic";
this.FONTDATA = {
TeX_factor: 1, baselineskip: 1.2, lineH: .8, lineD: .2, ffLineH: .8,
@ -1500,7 +1517,7 @@
this.imgFonts = true;
HUB.Startup.signal.Post("HTML-CSS Jax - switch to image fonts");
HUB.Startup.signal.Post("HTML-CSS Jax - using image fonts");
MathJax.Message.Set("Web-Fonts not available -- using image fonts instead",null,3000);
MESSAGE(["WebFontNotAvailable","Web-Fonts not available -- using image fonts instead"],null,3000);
AJAX.Require(this.directory+"/imageFonts.js",done);
} else {
this.allowWebFonts = false;

View File

@ -191,7 +191,8 @@
//
// If that fails, give an alert about security settings
//
alert("MathJax was not able to set up MathPlayer.\n\n"+
alert(MathJax.Localization._(["MathML", "MathPlayer"],
"MathJax was not able to set up MathPlayer.\n\n"+
"If MathPlayer is not installed, you need to install it first.\n"+
"Otherwise, your security settings may be preventing ActiveX \n"+
"controls from running. Use the Internet Options item under\n"+
@ -200,7 +201,7 @@
"'Run ActiveX Controls', and 'Binary and script behaviors'\n"+
"are enabled.\n\n"+
"Currently you will see error messages rather than\n"+
"typeset mathematics.");
"typeset mathematics."));
}
} else {
//

View File

@ -1,3 +1,6 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/output/SVG/autoload/mglyph.js
@ -25,7 +28,8 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
var VERSION = "2.1";
var MML = MathJax.ElementJax.mml,
SVG = MathJax.OutputJax.SVG,
BBOX = SVG.BBOX;
BBOX = SVG.BBOX,
LOCALE = MathJax.Localization;
var XLINKNS = "http://www.w3.org/1999/xlink";
@ -70,7 +74,9 @@ MathJax.Hub.Register.StartupHook("SVG Jax Ready",function () {
MathJax.Hub.RestartAfter(img.onload);
}
if (this.img.status !== "OK") {
err = MML.merror("Bad mglyph: "+values.src).With({mathsize:"75%"});
err = MML.merror(
LOCALE._(["MathML","BadMglyph"],"Bad mglyph: %1",values.src)
).With({mathsize:"75%"});
this.Append(err); svg = err.toSVG(); this.data.pop();
} else {
var mu = this.SVGgetMu(svg);

View File

@ -0,0 +1,63 @@
MathJax.Localization.addTranslation("de","FontWarnings",{
isLoaded: true,
strings: {
webFont:
"MathJax nutz web-basierte Fonts zur Darstellung der Mathematik " +
"auf dieser Seite. Da diese heruntergeladen werden m\u00FCssen, " +
"l\u00E4dt die Seite schneller, wenn Mathe-Fonts auf dem System installiert sind.",
// "MathJax is using web-based fonts to display the mathematics "+
// "on this page. These take time to download, so the page would "+
// "render faster if you installed math fonts directly in your "+
// "system's font folder.",
imageFonts:
"MathJax nutzt Bild-Fonts stall lokaler Fonts oder Webfonts. " +
"Das Laden dauert l\u00E4nger als erwartet und Drucken wird " + // translated "expected" rather than "usual"
"evtl. nicht in bester Qualit\u00E4t m\u00F6glich sein.", // translated 'best quality' rather than 'full resolution'
// "MathJax is using its image fonts rather than local or web-based fonts. "+
// "This will render slower than usual, and the mathematics may not print "+
// "at the full resolution of your printer.",
noFonts:
"MathJax kann keinen Font zur Darstellung der Mathematik finden "+
"und Bild-Fonts sind nicht verf\u00FCgbar. MathJax weicht auf generische "+
"Unicode-Zeichen aus in der Hoffnung, der Browser kann diese darstellen. "+
"Einige oder alle Zeichen k\u00F6nnten nicht korrekt dargestellt werden.",
// "MathJax is unable to locate a font to use to display "+
// "its mathematics, and image fonts are not available, so it "+
// "is falling back on generic unicode characters in hopes that "+
// "your browser will be able to display them. Some characters "+
// "may not show up properly, or possibly not at all.",
webFonts:
"Die meisten modernen Browser k\u00F6nnen Fonts aus dem Web laden. "+
"Um die Qualit\u00E4t der Mathematik auf dieser Seite zu verbessern, "+
"sollten Sie ein Update auf eine aktuelle Version des Browsers vornehmen "+
"(oder einen aktuellen Browser installieren).",
// "Most modern browsers allow for fonts to be downloaded over the web. "+
// "Updating to a more recent version of your browser (or changing "+
// "browsers) could improve the quality of the mathematics on this page.",
fonts:
"MathJax kann [STIX Fonts](%1) oder [MathJax TeX Fonts](%2) verwenden. "+
"Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern.",
// "MathJax can use either the [STIX Fonts](%1) or the [MathJax TeX fonts](%2). " +
// "Download and install one of those fonts to improve your MathJax experience.",
STIXPage:
"Diese Seite ist optimiert fuer [STIX Fonts](%1). " +
"Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern.",
// "This page is designed to use the %1. " +
// "Download and install those fonts to improve your MathJax experience.",
TeXPage:
"Diese Seite ist optimiert fuer [MathJax TeX Fonts](%1). " +
"Herunterladen und installieren dieser Fonts wird Ihre MathJax-Erfahrung verbessern."
// "This page is designed to use the %1. " +
// "Download and install those fonts to improve your MathJax experience."
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/de/FontWarnings.js");

View File

@ -0,0 +1,28 @@
MathJax.Localization.addTranslation("de","HTML-CSS",{
isLoaded: true,
strings: {
LoadWebFont:
"Lade Webfont %1",
// "Loading web-font %1",
CantLoadWebFont:
"Kann Webfont %1 nicht laden",
// "Can't load web font %1",
FirefoxCantLoadWebFont:
"Firefox kann Webfonts nicht von entferntem Computer laden",
// "Firefox can't load web fonts from a remote host",
CantFindFontUsing:
"Kein g\u00FCltiger Font fuer %1 verf\u00FCgbar",
// "Can't find a valid font using %1",
WebFontsNotAvailable:
"Webfonts nicht verf\u00FCgbar -- benutze Bildfont"
// "Web-Fonts not available -- using image fonts instead"
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/de/HTML-CSS.js");

View File

@ -0,0 +1,72 @@
MathJax.Localization.addTranslation("de","HelpDialog",{
isLoaded: true,
strings: {
Help:
"MathJax Hilfe",
// "MathJax Help",
MathJax:
"*MathJax* ist eine JavaScript-Bibliothek, die Autoren erlaubt, " +
"Ihren Webseiten mathematische Inhalte hinzuzuf\u00FCgen. Als Besucher " +
"m\u00FCssen sie nichts zus\u00E4tzliches tun, damit MathJax funktioniert.",
// "*MathJax* is a JavaScript library that allows page authors to include " +
// "mathematics within their web pages. As a reader, you don't need to do " +
// "anything to make that happen.",
Browsers:
"*Browser*: MathJax ist kompatibel zu allen modernen Webbrowsern inklusive " +
"IE6+, Firefox 3+, Chrome 0.2+, Safari 2+, Opera 9.6+ und g\u00E4ngigen mobilen Browsern.",
// "*Browsers*: MathJax works with all modern browsers including IE6+, Firefox 3+, " +
// "Chrome 0.2+, Safari 2+, Opera 9.6+ and most mobile browsers.",
Menu:
"*Mathe Men\u00FC*: MathJax f\u00FCgt ein Kontextmen\u00FC bei allen Formen hinzu. " +
"Es wird mit Rechtsklick oder STRG+Linksklick auf einer Formel aufgerufen.",
// "*Math Menu*: MathJax adds a contextual menu to equations. Right-click or " +
// "CTRL-click on any mathematics to access the menu.",
ShowMath:
"*Zeige Mathe als* erlaubt es, eine Formel im Quellformat anzuzeigen, " + //NOTE needs to match menu item translations!
"um Kopieren und Einf\u00FCgen (als MathML oder im Originalformat) zu erm00F6glichen.",
// "*Show Math As* allows you to view the formula's source markup " +
// "for copy & paste (as MathML or in its origianl format).",
Settings:
"*Einstellungen* erlabut es, das Verhalten von MathJax zu modifizieren, " + //NOTE needs to match menu item translations!
"so z.B. die Gr\u00F6\u00DFe der Mathematik sowie den Ausgabemechanismus.",
// "*Settings* gives you control over features of MathJax, such as the " +
// "size of the mathematics, and the mechanism used to display equations.",
Language:
"*Sprache* erlaubt es, die Sprache zu wechseln, die MathJax im Men\u00FC " + //NOTE needs to match menu item translations!
"und den Warnmeldungen verwendent.",
// "*Language* lets you select the language used by MathJax for its menus " +
// "and warning messages.",
Zoom:
"*Zoom*: Falls das Lesen der Formeln schwer f\u00E4llt, kann MathJax diese " + //NOTE needs to match menu item translations!
"vergr\u00F6\u00DFern, um es zu erleichtern.",
// "*Math Zoom*: If you are having difficulty reading an equation, MathJax can " +
// "enlarge it to help you see it better.",
Accessibilty:
"*Barrierfreiheit*: MathJax arbeite automatisch mit g\u00E4ngigen Screenreadern " +
"zusammen, um Mathematik barrierefrei darzustellen.",
// "*Accessibility*: MathJax will automatically work with screen readers to make " +
// "mathematics accessible to the visually impaired.",
Fonts:
"*Fonts*: MathJax benutzt gewisse mathematische Fonts, falls sie auf dem System" +
"installiert sind; ansonsten verwendet es Webfonts. Obwohl nicht notwendig, " +
"k\u00F6nnen installierte Fonts den Textsatz beschleunigen. Wir empfehlen, " +
"die [STIX fonts](%1) zu installieren."
// "*Fonts*: MathJax will use certain math fonts if they are installed on your " +
// "computer; otherwise, it will use web-based fonts. Although not required, " +
// "locally installed fonts will speed up typesetting. We suggest installing " +
// "the [STIX fonts](%1)."
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/de/HelpDialog.js");

View File

@ -0,0 +1,71 @@
MathJax.Localization.addTranslation("de","MathML",{
isLoaded: true,
strings: {
BadMglyph:
"Schlechter mglpyh: %1",
// "Bad mglyph: %1",
BadMglyphFont:
"Schlechter Font: %1",
// "Bad font: %1",
MathPlayer: //TODO check names of German Windows settings http://support.microsoft.com/
"MathJax konnnte MathPlayer nicht einrichten.\n\n"+
"Falls MathPlayer nicht installiert ist, muss es erst installiert werden.\n"+
"Eventuell blockieren die Sicherheitsoptionen ActiveX; \u00FCberpr\u00FCfen Sie\n"+
"unter 'Internetoptionen' -> 'Sicherheit' -> 'Stufe Anpassen',\n"+
"ob ActiveX aktiviert ist.\n\n"+
"Bei der jetzigen Konfiguration wird MathJax nur Fehlermeldungen anzeigen.",
// "MathJax was not able to set up MathPlayer.\n\n"+
// "If MathPlayer is not installed, you need to install it first.\n"+
// "Otherwise, your security settings may be preventing ActiveX \n"+
// "controls from running. Use the Internet Options item under\n"+
// "the Tools menu and select the Security tab, then press the\n"+
// "Custom Level button. Check that the settings for\n"+
// "'Run ActiveX Controls', and 'Binary and script behaviors'\n"+
// "are enabled.\n\n"+
// "Currently you will see error messages rather than\n"+
// "typeset mathematics.",
CantCreateXMLParser://TODO check name of German Windows settings
"MathJax kann keinen XML-Parser f\u00FC r MathML erzeugen. "+
"\u00DC berpr\u00FC fen Sie die Einstellungen unter\n"+
"'Internetoptionen'-> 'Werkzeuge' -> 'Sicherheit' -> 'Stufe Anpassen'\n"+
"und aktivieren sie ActiveX.\n\n"+
"MathJax kann sonst kein MathML verarbeiten."
// "MathJax can't create an XML parser for MathML. Check that\n"+
// "the 'Script ActiveX controls marked safe for scripting' security\n"+
// "setting is enabled (use the Internet Options item in the Tools\n"+
// "menu, and select the Security panel, then press the Custom Level\n"+
// "button to check this).\n\n"+
// "MathML equations will not be able to be processed by MathJax.",
UnknownNodeType:
"Unbekannter Knotentyp: %1",
// "Unknown node type: %1",
UnexpectedTextNode:
"Unbekannter Textknoten: %1",
// "Unexpected text node: %1",
ErrorParsingMathML:
"Fehler beim Parsen von MathML",
// "Error parsing MathML",
ParsingError:
"Fehler beim Parsen von MathML: %1",
// "Error parsing MathML: %1",
MathMLSingleElement:
"MathML muss ein einzelnes <math> Element sein",
// "MathML must be formed by a single element",
MathMLRootElement:
"MathML muss ein einzelnes <math> Element sein, nicht %1"
// "MathML must be formed by a <math> element, not %1"
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/de/MathML.js");

View File

@ -0,0 +1,169 @@
MathJax.Localization.addTranslation("de","MathMenu",{
isLoaded: true,
strings: {
Show: "Zeige Mathe als", // "Show Math As",
MathMLcode: "MathML Code",
OriginalMathML: "Original MathML",
TeXCommands: "Original TeX", // "TeX Commands",
AsciiMathInput: "Original AsciiMathML", // "AsciiMathML input"
Original: "Originalform", // "Original Form",
ErrorMessage: "Fehlermeldung", // "Error Message",
texHints: "TeX Tipps in MathML", // "Show TeX hints in MathML",
Settings: "Einstellungen", // "Math Settings",
ZoomTrigger: "Zoom ausl\u00F6sen", // "Zoom Trigger",
Hover: "Hover",
Click: "Klick", // "Click",
DoubleClick: "Doppelklick", // "Double-Click",
NoZoom: "Kein Zoom", // "No Zoom",
TriggerRequires: "Ausl\u00F6ser ben\u00F6tigt:", // "Trigger Requires:",
Option: "Option",
Alt: "Alt",
Command: "Command",
Control: "Steuerung", // "Control",
Shift: "Shift",
ZoomFactor: "Zoomfaktor", // "Zoom Factor",
Renderer: "Mathe Renderer", // "Math Renderer",
MPHandles: "An MathPlayer \u00FCbergeben:", // "Let MathPlayer Handle:",
MenuEvents: "Men\u00FC Events", // "Menu Events",
MouseEvents: "Maus Events", // "Mouse Events",
MenuAndMouse: "Maus und Men\u00FC Events", // "Mouse and Menu Events",
FontPrefs: "Font Einstellungen", // "Font Preferences",
ForHTMLCSS: "F\u00FCr HTML-CSS", // "For HTML-CSS:",
Auto: "Auto",
TeXLocal: "TeX (lokal)", // "TeX (local)",
TeXWeb: "TeX (Web)", // "TeX (web)",
TeXImage: "TeX (Bild)", // "TeX (image)",
STIXLocal: "STIX (lokal)", // "STIX (local)",
ContextMenu: "Kontextmen\u00FC ", // "Contextual Menu",
Browser: "Browser",
Scale: "Alle Mathe skalieren ...", // "Scale All Math ...",
Discoverable: "Highlight durch Hovern", // "Highlight on Hover",
Locale: "Sprache", // "Language",
LoadLocale: "Von URL laden ...", // "Load from URL ...",
About: "\u00DCber MathJax", // "About MathJax",
Help: "MathJax Hilfe", // "MathJax Help",
/* About MathJax dialogue */
localTeXfonts: "Lokale TeX-Fonts verwendet", // "using local TeX fonts",
webTeXfonts: "Web TeX-Fonts verwendet", // "using web TeX font",
imagefonts: "Bild-Fonts verwendet", // "using Image fonts",
localSTIXfonts: "Lokale STIX-Fonts verwendet", // "using local STIX fonts",
webSVGfonts: "Web SVG-fonts verwendet", // "using web SVG fonts",
genericfonts: "Generische Unicode-Fonts verwendet", // "using generic unicode fonts",
wofforotffonts: "WOFF- oder OTF-Fonts", // "woff or otf fonts",
eotffonts: "EOT-Fonts", // "eot fonts",
svgfonts: "SVG-Fonts", // "svg fonts",
/* Warnings when switching to MathML mode */
WebkitNativeMMLWarning:
"Ihr Browser scheint MathML nicht zu unterst\u00FCtzen, " +
"so dass ein Wechsel zur MathML-Ausgabe die Mathematik " +
"auf der Seite unlesbar machen k\u00F6nnte.",
// "Your browser doesn't seem to support MathML natively, " +
// "so switching to MathML output may cause the mathematics " +
// "on the page to become unreadable.",
MSIENativeMMLWarning:
"Internet Explorer ben\u00F6tigt das MathPlayer Plugin, " +
"um MathML-Ausgabe darstellen zu k\u00F6nnen.",
// "Internet Explorer requires the MathPlayer plugin " +
// "in order to process MathML output.",
OperaNativeMMLWarning:
"Opera's MathML unterst\u00FCtzung ist beschr\u00E4nkt, so dass beim Wechsel " +
"zur MathML-Ausgabe einige Ausdr\u00FCcke schlecht gerendert werden.",
// "Opera's support for MathML is limited, so switching to " +
// "MathML output may cause some expressions to render poorly.",
SafariNativeMMLWarning:
"Die MathML-Unterst\u00FCtzung Ihres Browsers beherrscht nicht alle " +
"MathJax-Features, so dass einige Ausdr\u00FCcke schlecht gerendert werden.",
// "Your browser's native MathML does not implement all the features " +
// "used by MathJax, so some expressions may not render properly.",
FirefoxNativeMMLWarning:
"Die MathML-Unterst\u00FCtzung Ihres Browsers beherrscht nicht alle " +
"MathJax-Features, so dass einige Ausdr\u00FCcke schlecht gerendert werden.",
// "Your browser's native MathML does not implement all the features " +
// "used by MathJax, so some expressions may not render properly.",
/* Warning when switching to SVG mode */
MSIESVGWarning:
"Internet Explorer unterst\u00FCtzt SVG erst ab IE9 und " +
"nicht im IE8-Emulationsmodus. Beim Wechsel zur " +
"SVG-Ausgabe wird die Mathematik nicht richtig dargestellt.",
// "SVG is not implemented in Internet Explorer prior to " +
// "IE9 or when it is emulating IE8 or below. " +
// "Switching to SVG output will cause the mathematics to "
// "not display properly.",
LoadURL:
"Sprachschema von URL laden:",
// "Load translation data from this URL:",
BadURL:
"URL muss eine JavaScript-Datei f\u00FCr MathJax Sprachschema verlinken. " +
"JavaScript Dateinamen sollten auf '.js' enden.",
// "The URL should be for a javascript file that defines MathJax translation data. " +
// "Javascript file names should end with '.js'",
BadData:
"Fehler beim Laden des Sprachschema von %1",
// "Failed to load translation data from %1",
SwitchAnyway:
"Renderer trotzdem \u00E4ndern?\n\n" +
"(Mit OK wechseln, mit ABBRECHEN den akt\u00FCllen Renderer verwenden)",
// "Switch the renderer anyway?\n\n" +
// "(Press OK to switch, CANCEL to continue with the current renderer)",
ScaleMath:
"Alle Mathematik skalieren (relativ zum umgebenden Text)",
// "Scale all mathematics (compared to surrounding text) by",
NonZeroScale:
"Skalierung darf nicht Null sein",
// "The scale should not be zero",
PercentScale:
"Skalierung muss in Prozent sein (z.B. 120%%)",
// "The scale should be a percentage (e.g., 120%%)",
IE8warning:
"Dies Deaktiviert das MathJax Men\u00FC und den MathJax Zoom. " +
"Alt+Klick auf eine Formel zeigt weiter das MathJax-Men\u00FC.\n\n" +
"Wirklich MathPlayer Einstellungen \u00E4ndern?",
// "This will disable the MathJax menu and zoom features, " +
// "but you can Alt-Click on an expression to obtain the MathJax " +
// "menu instead.\n\nReally change the MathPlayer settings?",
IE9warning:
"Das MathJax Men\u00FC wird deaktiviert und kann nur durch " +
"Alt+Klick auf eine Formel angezeigt werden.",
// "The MathJax contextual menu will be disabled, but you can " +
// "Alt-Click on an expression to obtain the MathJax menu instead.",
NoOriginalForm:
"Keine Originalform verf\u00FCgbar",
// "No original form available",
Close:
"Schliessen",
// "Close",
EqSource:
"Original MathJax Formel"
// "MathJax Equation Source"
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/de/MathMenu.js");

View File

@ -0,0 +1,316 @@
MathJax.Localization.addTranslation("de","TeX",{
isLoaded: true,
strings: {
ExtraOpenMissingClose:
"Zus\u00E4tzliche offene oder fehlende schliessende Klammer", //TODO better alternative for "zusaetzlich"? Maybe a good translation of mismatched braces instead?
// "Extra open brace or missing close brace",
ExtraCloseMissingOpen:
"Zus\u00E4tzliche schliessende oder fehlende offene Klammer",
// "Extra close brace or missing open brace",
MissingLeftExtraRight:
"Fehlendes '\\left' oder zus\u00E4tzliches '\\right'",
// "Missing \\left or extra \\right",
MissingScript:
"Fehlendes Argument im Sub- oder Superskript",
// "Missing superscript or subscript argument",
ExtraLeftMissingRight:
"Zus\u00E4tzliches '\\left' oder fehlendes '\\right'",
// "Extra \\left or missing \\right",
Misplaced:
"%1 falsch plaziert",
// "Misplaced %1",
MissingOpenForSub:
"Fehlende offende Klammer im Subskript",
// "Missing open brace for subscript",
MissingOpenForSup:
"Fehlende offene Klammer im Superskript",
// "Missing open brace for superscript",
AmbiguousUseOf:
"Mehrdeutige Verwendung von %1",
// "Ambiguous use of %1",
EnvBadEnd:
"\\begin{%1} endet mit \\end{%2}",
// "\\begin{%1} ended with \\end{%2}",
EnvMissingEnd:
"\\end{%1} fehlt",
// "Missing \\end{%1}",
MissingBoxFor:
"Fehlende Box: %1",
// "Missing box for %1",
MissingCloseBrace:
"Fehlende geschlossene Klammer",
// "Missing close brace",
UndefinedControlSequence:
"Nicht definierter Befehl: %1",
// "Undefined control sequence %1",
DoubleExponent:
"Doppeltes Superskript: verwende Klammern zum Gruppieren",
// "Double exponent: use braces to clarify",
DoubleSubscripts:
"Doppeltes Subskript: verwende Klammern zum Gruppieren",
// "Double subscripts: use braces to clarify",
DoubleExponentPrime:
"Prime f\u00FChrt zu doppeltem Superskript: verwende Klammern zum Gruppieren ",
// "Prime causes double exponent: use braces to clarify",
CantUseHash1:
"Das Zeichen '#' ist ein Makroparameter und kann nicht im Mathematikmodus verwendet werden.",
// "You can't use 'macro parameter character #' in math mode",
MisplacedMiddle:
"%1 muss zwischen '\\left' und '\\right' stehen",
// "%1 must be within \\left and \\right",
MisplacedLimits:
"%1 ist nur bei Operatoren erlaubt",
// "%1 is allowed only on operators",
MisplacedMoveRoot:
"%1 muss innerhalb einer Wurzel stehen",
// "%1 can appear only within a root",
MultipleCommand:
"Zu viele %1",
// "Multiple %1",
IntegerArg:
"Das Argument in %1 muss ganzzahlig sein",
// "The argument to %1 must be an integer",
NotMathMLToken:
"%1 ist kein Token-Element",
// "%1 is not a token element",
InvalidMathMLAttr:
"Unzul\u00E4ssiges MathML-Attribut: %1",
// "Invalid MathML attribute: %1",
UnknownAttrForElement:
"%1 ist kein zul\u00E4ssiges Attribut f\u00FCr %2",
// "%1 is not a recognized attribute for %2",
MaxMacroSub1:
"Maximale Anzahl an Makros ist erreicht; " +
"wird ein rekursiver Makroaufruf verwendet?",
// "MathJax maximum macro substitution count exceeded; " +
// "is there a recursive macro call?",
MaxMacroSub2:
"Maximale Anzahl an Substitutionen ist erreicht; " +
"wird eine rekursive LaTeX-Umgebung verwendet?",
// "MathJax maximum substitution count exceeded; " +
// "is there a recursive latex environment?",
MissingArgFor:
"Fehlendes Argument in %1",
// "Missing argument for %1",
ExtraAlignTab:
"Zus\u00E4tzliches & im '\\cases' Text",
// "Extra alignment tab in \\cases text",
BracketMustBeDimension:
"Das geklammerte Argument f\u00FCr %1 muss eine Dimension sein",
// "Bracket argument to %1 must be a dimension",
InvalidEnv:
"Ung\u00FCltiger Umgebungsname %1",
// "Invalid environment name '%1'",
UnknownEnv:
"Ung\u00FCltige Umgebung %1",
// "Unknown environment '%1'",
ExtraClose:
"Zus\u00E4tzliche geschlossene Klammer",
// "Extra close brace",
ExtraCloseLooking:
"Zus\u00E4tzliche geschlossene Klammer w\u00E4hrend der Suche nach %1",
// "Extra close brace while looking for %1",
MissingCloseBracket:
"Argument zu %1 wurde nicht mit ']' geschlossen",
// "Couldn't find closing ']' for argument to %1",
MissingOrUnrecognizedDelim:
"Fehlender oder nichterkannter Delimiter bei %1",
// "Missing or unrecognized delimiter for %1",
MissingDimOrUnits:
"Fehlende Dimension oder Einheiten bei %1",
// "Missing dimension or its units for %1",
TokenNotFoundForCommand:
"Konnte %1 nicht f\u00FCr %2 finden",
// "Couldn't find %1 for %2",
MathNotTerminated:
"Formel in Textbox nicht abgeschlossen",
// "Math not terminated in text box",
IllegalMacroParam:
"Ung\u00FC ltiger Makroparameter",
// "Illegal macro parameter reference",
MaxBufferSize:
"Interner Puffergr\u00F6\u00DFe \u00FCberschritten; wird ein rekursiver Makroaufruf verwendet?",
// "MathJax internal buffer size exceeded; is there a recursive macro call?",
/* AMSmath */
CommandNotAllowedInEnv:
"%1 ist nicht in Umgebung %2 erlaubt",
// "%1 not allowed in %2 environment",
MultipleLabel:
"Label '%1' \u00FCberdefiniert",
// "Label '%1' multiply defined",
CommandAtTheBeginingOfLine:
"%1 muss am Zeilenanfang stehen",
// "%1 must come at the beginning of the line",
IllegalAlign:
"Ung\u00FCltige Ausrichtung in %1",
// "Illegal alignment specified in %1", ?
BadMathStyleFor:
"Schlechtes 'math style' Argument: %1",
// "Bad math style for %1",
PositiveIntegerArg:
"Argument bei %1 muss positiv und ganzzahlig sein",
// "Argument to %1 must me a positive integer",
ErroneousNestingEq:
"Fehlerhafte Verschachtelung von Gleichungen",
// "Erroneous nesting of equation structures",
MultlineRowsOneCol:
"Zeilen in multiline Umgebung m\u00FC ssen genau eine Spalte haben",
// "The rows within the %1 environment must have exactly one column"
/* bbox */
MultipleBBoxProperty:
"%1 wurde zweimal in %2 angegeben",
// "%1 specified twice in %2",
InvalidBBoxProperty:
"'%1' scheint keine Farbe, Padding-Dimension oder Stil zu sein",
// "'%1' doesn't look like a color, a padding dimension, or a style",
/* begingroup */
ExtraEndMissingBegin:
"Zus\u00E4tzliches oder Fehlendes \\begingroup"
// "Extra %1 or missing \\begingroup",
GlobalNotFollowedBy:
"%1 nicht von '\\let', '\\def' oder '\\newcommand' gefolgt",
// "%1 not followed by \\let, \\def, or \\newcommand",
/* color */
UndefinedColorModel:
"Farbmodell '%1' nicht definiert",
// "Color model '%1' not defined",
ModelArg1:
"Farbwerte f\u00FCr Farbmodell '%1' ben\u00F6tigen 3 Werte",
// "Color values for the %1 model require 3 numbers", // *NEW*
InvalidDecimalNumber:
"Ung\u00FCltige Dezimalzahl",
// "Invalid decimal number",
ModelArg2:
"Farbwerte f\u00FCr Farbmodell '%1' m\u00FCssen zwischen %2 und %3 liegen",
// Color values for the %1 model must be between %2 and %3", // *NEW*
InvalidNumber:
"Ung\u00FCltige Zahl",
// "Invalid number",
/* extpfeil */
NewextarrowArg1:
"Das erste Argument von %1 muss Name einer Befehlsfolge sein",
// "First argument to %1 must be a control sequence name",
NewextarrowArg2:
"Zweites Argument von %1 m\u00FCssen zwei ganze Zahlen, durch Komma getrennt, sein",
// "Second argument to %1 must be two integers separated by a comma",
NewextarrowArg3:
"Drittes argument von %1 m\u00FCssen Unicode-Nummern sein",
// "Third argument to %1 must be a unicode character number",
/* mhchem */
NoClosingChar:
"Kann geschlossene %1 nicht finden",
// "Can't find closing %1",
/* newcommand */
IllegalControlSequenceName:
"Ung\u00FCltige Befehlsfolge",
// "Illegal control sequence name for %1",
IllegalParamNumber:
"Ung\u00FCltige Anzahl von Parametern in %1",
// "Illegal number of parameters specified in %1",
DoubleBackSlash:
"\\ muss von Befehlsfolge gefolgt werden",
// "\\ must be followed by a control sequence",
CantUseHash2:
"Ung\u00FCltige Verwendung von # im Template von %1",
// "Illegal use of # in template for %1",
SequentialParam:
"Parameter von %1 m\u00FCssen durch nummeriert sein",
// "Parameters for %1 must be numbered sequentially",
MissingReplacementString:
"Ersetzende Zeichenkette f\u00FCr Definition von %1 fehlt",
// "Missing replacement string for definition of %1",
MismatchUseDef:
"Verwendung von %1 passt nicht zur Definition",
// "Use of %1 doesn't match its definition",
RunawayArgument:
"Nichtgeschlossenes Argument f\u00FCr %1?",
// "Runaway argument for %1?"
/* verb */
NoClosingDelim:
"Kein schliessender Delimiter f\u00FCr %1"
// "Can't find closing delimiter for %1"
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/de/TeX.js");

View File

@ -0,0 +1,79 @@
MathJax.Localization.addTranslation("de",null,{
menuTitle: "Deutsch",
isLoaded: true,
domains: {
"_": {
isLoaded: true,
strings: {
CookieConfig:
"MathJax hat eine Cookie mit ausf\u00FChrbaren Code gefunden. " +
"Soll dieser Code ausgef\u00FChrt werden?\n\n" +
"(Klicken Sie 'Abbrechen' falls Sie das Cookie nicht selber akzeptiert haben.)",
// "MathJax has found a user-configuration cookie that includes code to " +
// "be run. Do you want to run it?\n\n" +
// "(You should press Cancel unless you set up the cookie yourself.)",
MathProcessingError:
"Mathe Verarbeitungsfehler",
// "Math Processing Error",
MathError:
"Mathe Fehler",
// "Math Error",
LoadFile:
"Lade %1",
// "Loading %1",
Loading:
"Laden", //TODO could also be "Lade"
// "Loading",
LoadFailed:
"Datei konnte nicht geladen werden: %1",
// "File failed to load: %1",
ProcessMath:
"Mathe Verarbeitung: %1%%",
// "Processing Math: %1%%",
Processing:
"Verarbeiten",
// "Processing",
TypesetMath:
"Mathe wird gesetzt: %1%%",
// "Typesetting Math: %1%%",
Typesetting:
"Setzen",
// "Typesetting",
MathJaxNotSupported:
"Ihr Webbrowser unterst\u00FCtzt MathJax nicht"
// "Your browser does not support MathJax"
}
},
MathMenu: {},
FontWarnings: {},
HelpDialog: {},
TeX: {},
MathML: {},
"HTML-CSS": {}
},
plural: function(n) {
if (n === 1) {return 1} // one
return 2; // other
},
number: function(n) {
return String(n).replace(".", ","); // replace dot by comma
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/de/de.js");

View File

@ -0,0 +1,43 @@
MathJax.Localization.addTranslation("en","FontWarnings",{
isLoaded: true,
strings: {
webFont:
"MathJax is using web-based fonts to display the mathematics "+
"on this page. These take time to download, so the page would "+
"render faster if you installed math fonts directly in your "+
"system's font folder.",
imageFonts:
"MathJax is using its image fonts rather than local or web-based fonts. "+
"This will render slower than usual, and the mathematics may not print "+
"at the full resolution of your printer.",
noFonts:
"MathJax is unable to locate a font to use to display "+
"its mathematics, and image fonts are not available, so it "+
"is falling back on generic unicode characters in hopes that "+
"your browser will be able to display them. Some characters "+
"may not show up properly, or possibly not at all.",
webFonts:
"Most modern browsers allow for fonts to be downloaded over the web. "+
"Updating to a more recent version of your browser (or changing "+
"browsers) could improve the quality of the mathematics on this page.",
fonts:
"MathJax can use either the [STIX fonts](%1) or the [MathJax TeX fonts](%2). " +
"Download and install one of those fonts to improve your MathJax experience.",
STIXPage:
"This page is designed to use the [STIX fonts](%1). " +
"Download and install those fonts to improve your MathJax experience.",
TeXPage:
"This page is designed to use the [MathJax TeX fonts](%1). " +
"Download and install those fonts to improve your MathJax experience."
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/en/FontWarnings.js");

View File

@ -0,0 +1,23 @@
MathJax.Localization.addTranslation("en","HTML-CSS",{
isLoaded: true,
strings: {
LoadWebFont:
"Loading web-font %1", // NOTE: %1 is the name of a webfont file
CantLoadWebFont:
"Can't load web font %1",
FirefoxCantLoadWebFont:
"Firefox can't load web fonts from a remote host",
CantFindFontUsing:
"Can't find a valid font using %1", // Note: %1 is a list of font names
WebFontsNotAvailable:
"Web-Fonts not available -- using image fonts instead"
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/en/HTML-CSS.js");

View File

@ -0,0 +1,50 @@
MathJax.Localization.addTranslation("en","HelpDialog",{
isLoaded: true,
strings: {
Help:
"MathJax Help",
MathJax:
"*MathJax* is a JavaScript library that allows page authors to include " + // NOTE: Markdown syntax *...*
"mathematics within their web pages. As a reader, you don't need to do " +
"anything to make that happen.",
Browsers:
"*Browsers*: MathJax works with all modern browsers including IE6+, Firefox 3+, " +
"Chrome 0.2+, Safari 2+, Opera 9.6+ and most mobile browsers.",
Menu:
"*Math Menu*: MathJax adds a contextual menu to equations. Right-click or " +
"CTRL-click on any mathematics to access the menu.",
ShowMath:
"*Show Math As* allows you to view the formula's source markup " +
"for copy & paste (as MathML or in its original format).",
Settings:
"*Settings* gives you control over features of MathJax, such as the " +
"size of the mathematics, and the mechanism used to display equations.",
Language:
"*Language* lets you select the language used by MathJax for its menus " +
"and warning messages.",
Zoom:
"*Math Zoom*: If you are having difficulty reading an equation, MathJax can " +
"enlarge it to help you see it better.",
Accessibilty:
"*Accessibility*: MathJax will automatically work with screen readers to make " +
"mathematics accessible to the visually impaired.",
Fonts:
"*Fonts*: MathJax will use certain math fonts if they are installed on your " +
"computer; otherwise, it will use web-based fonts. Although not required, " +
"locally installed fonts will speed up typesetting. We suggest installing " +
"the [STIX fonts](%1)." // NOTE: Markdown syntax for links. %1 is a URL to the STIX fonts
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/en/HelpDialog.js");

View File

@ -0,0 +1,52 @@
MathJax.Localization.addTranslation("en","MathML",{
isLoaded: true,
strings: {
BadMglyph: // NOTE: refers to MathML's mglyph element.
"Bad mglyph: %1",
BadMglyphFont:
"Bad font: %1",
MathPlayer:
"MathJax was not able to set up MathPlayer.\n\n"+
"If MathPlayer is not installed, you need to install it first.\n"+
"Otherwise, your security settings may be preventing ActiveX \n"+
"controls from running. Use the Internet Options item under\n"+
"the Tools menu and select the Security tab, then press the\n"+
"Custom Level button. Check that the settings for\n"+
"'Run ActiveX Controls', and 'Binary and script behaviors'\n"+
"are enabled.\n\n"+
"Currently you will see error messages rather than\n"+
"typeset mathematics.",
CantCreateXMLParser:
"MathJax can't create an XML parser for MathML. Check that\n"+
"the 'Script ActiveX controls marked safe for scripting' security\n"+
"setting is enabled (use the Internet Options item in the Tools\n"+
"menu, and select the Security panel, then press the Custom Level\n"+
"button to check this).\n\n"+
"MathML equations will not be able to be processed by MathJax.",
UnknownNodeType:
"Unknown node type: %1", // NOTE: refers to XML nodes
UnexpectedTextNode:
"Unexpected text node: %1",
ErrorParsingMathML:
"Error parsing MathML",
ParsingError:
"Error parsing MathML: %1",
MathMLSingleElement:
"MathML must be formed by a single element",
MathMLRootElement:
"MathML must be formed by a <math> element, not %1"
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/en/MathML.js");

View File

@ -0,0 +1,129 @@
MathJax.Localization.addTranslation("en","MathMenu",{
isLoaded: true,
strings: {
Show: "Show Math As", // NOTE: MathJax uses 'Math' as a distinct UI choice. Please translate it literally whenever possible.
MathMLcode: "MathML Code", // NOTE: This menu item shows the MathML code that MathJax has produced internally (sanitized, indented etc)
OriginalMathML: "Original MathML", // NOTE: This menu item shows the MathML code if that was originally in the page source
TeXCommands: "TeX Commands", // NOTE: This menu item shows the TeX code if that was originally in the page source
AsciiMathInput: "AsciiMathML input", // NOTE: This menu item shows the asciimath code if that was originally in the page source
Original: "Original Form", // NOTE: This menu item shows the code that was originally in the page source but has no registered type. This can happen when extensions add new input formats but fail to provide an adequate format name.
ErrorMessage: "Error Message", // NOTE: This menu item shows the error message if MathJax fails to process the source
texHints: "Show TeX hints in MathML", // NOTE: This menu option adds comments to the code produced by 'MathMLCode'
Settings: "Math Settings",
ZoomTrigger: "Zoom Trigger", // NOTE: This menu determines how MathJax's zoom is triggered
Hover: "Hover",
Click: "Click",
DoubleClick: "Double-Click",
NoZoom: "No Zoom",
TriggerRequires: "Trigger Requires:", // NOTE: This menu item determines if the ZoomTrigger requires additional keys
Option: "Option", // NOTE: refers to Apple-style OPTION key
Alt: "Alt", // NOTE: refers to Windows-style ALT key
Command: "Command", // NOTE: refers to Apple-style COMMAND key
Control: "Control",
Shift: "Shift",
ZoomFactor: "Zoom Factor",
Renderer: "Math Renderer", // NOTE: This menu changes the output processor used by MathJax
MPHandles: "Let MathPlayer Handle:", // NOTE: MathJax recognizes MathPlayer when present. This submenu deals with MathJax/MathPlayer interaction.
MenuEvents: "Menu Events", // NOTE: refers to contextual menu selections
MouseEvents: "Mouse Events", // NOTE: refers to mouse clicks
MenuAndMouse: "Mouse and Menu Events",
FontPrefs: "Font Preferences", // NOTE: This menu item allows selection of the font to use (and is mostly for development purposes)
ForHTMLCSS: "For HTML-CSS:",
Auto: "Auto",
TeXLocal: "TeX (local)", // NOTE: 'TeX' refers to the MathJax fonts
TeXWeb: "TeX (web)",
TeXImage: "TeX (image)",
STIXLocal: "STIX (local)",
ContextMenu: "Contextual Menu",
Browser: "Browser",
Scale: "Scale All Math ...", // NOTE: This menu item allows users to set a scaling factor for the MathJax output (relative to the surrounding content)
Discoverable: "Highlight on Hover",
Locale: "Language",
LoadLocale: "Load from URL ...",
About: "About MathJax",
Help: "MathJax Help",
localTeXfonts: "using local TeX fonts", // NOTE: This section deals with the 'About' overlay popup
webTeXfonts: "using web TeX font",
imagefonts: "using Image fonts",
localSTIXfonts: "using local STIX fonts",
webSVGfonts: "using web SVG fonts",
genericfonts: "using generic unicode fonts",
wofforotffonts: "woff or otf fonts",
eotffonts: "eot fonts",
svgfonts: "svg fonts",
WebkitNativeMMLWarning: // NOTE: This section deals with warnings for when a user changes the rendering output via the MathJax menu but a browser does not support the chosen mechanism
"Your browser doesn't seem to support MathML natively, " +
"so switching to MathML output may cause the mathematics " +
"on the page to become unreadable.",
MSIENativeMMLWarning:
"Internet Explorer requires the MathPlayer plugin " +
"in order to process MathML output.",
OperaNativeMMLWarning:
"Opera's support for MathML is limited, so switching to " +
"MathML output may cause some expressions to render poorly.",
SafariNativeMMLWarning:
"Your browser's native MathML does not implement all the features " +
"used by MathJax, so some expressions may not render properly.",
FirefoxNativeMMLWarning:
"Your browser's native MathML does not implement all the features " +
"used by MathJax, so some expressions may not render properly.",
MSIESVGWarning:
"SVG is not implemented in Internet Explorer prior to " +
"IE9 or when it is emulating IE8 or below. " +
"Switching to SVG output will cause the mathematics to " +
"not display properly.",
LoadURL:
"Load translation data from this URL:",
BadURL:
"The URL should be for a javascript file that defines MathJax translation data. " +
"Javascript file names should end with '.js'",
BadData:
"Failed to load translation data from %1",
SwitchAnyway:
"Switch the renderer anyway?\n\n" +
"(Press OK to switch, CANCEL to continue with the current renderer)",
ScaleMath:
"Scale all mathematics (compared to surrounding text) by", // NOTE: This section deals with 'MathJax menu-> Scale all math'
NonZeroScale:
"The scale should not be zero",
PercentScale:
"The scale should be a percentage (e.g., 120%%)",
IE8warning: // NOTE: This section deals with MathPlayer and menu/mouse event handling
"This will disable the MathJax menu and zoom features, " +
"but you can Alt-Click on an expression to obtain the MathJax " +
"menu instead.\n\nReally change the MathPlayer settings?",
IE9warning:
"The MathJax contextual menu will be disabled, but you can " +
"Alt-Click on an expression to obtain the MathJax menu instead.",
NoOriginalForm:
"No original form available", // NOTE: This refers to missing source formats when using 'MathJax Menu -> show math as"
Close:
"Close", // NOTE: for closing button in the 'MathJax Menu => SHow Math As' window.
EqSource:
"MathJax Equation Source"
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/en/MathMenu.js");

View File

@ -0,0 +1,242 @@
MathJax.Localization.addTranslation("en","TeX",{
isLoaded: true,
strings: {
ExtraOpenMissingClose:
"Extra open brace or missing close brace", // NOTE: TeX commands use braces and brackets as delimiters
ExtraCloseMissingOpen:
"Extra close brace or missing open brace",
MissingLeftExtraRight:
"Missing \\left or extra \\right", // NOTE: do not translate \\left and \\right; they are TeX commands
MissingScript:
"Missing superscript or subscript argument",
ExtraLeftMissingRight:
"Extra \\left or missing \\right", // NOTE: do not translate \\left and \\right; they are TeX commands
Misplaced:
"Misplaced %1",
MissingOpenForSub:
"Missing open brace for subscript",
MissingOpenForSup:
"Missing open brace for superscript",
AmbiguousUseOf:
"Ambiguous use of %1", // NOTE: %1 will be a TeX command
EnvBadEnd:
"\\begin{%1} ended with \\end{%2}", // NOTE: do not translate \\begin{%1} and \\end{%1}; they are TeX commands
EnvMissingEnd:
"Missing \\end{%1}", // NOTE: do not translate \\end
MissingBoxFor:
"Missing box for %1", //NOTE: refers to TeX boxes
MissingCloseBrace:
"Missing close brace",
UndefinedControlSequence:
"Undefined control sequence %1", // NOTE: %1 will be a TeX command
DoubleExponent:
"Double exponent: use braces to clarify", // NOTE: example: x^3^2 should be x^{3^2} or {x^3}^2
DoubleSubscripts:
"Double subscripts: use braces to clarify",
DoubleExponentPrime:
"Prime causes double exponent: use braces to clarify", // NOTE: example: x^a' should be {x^a}' or x^{a'}
CantUseHash1:
"You can't use 'macro parameter character #' in math mode", // NOTE: '#' is used in TeX macros
MisplacedMiddle:
"%1 must be within \\left and \\right", // NOTE: do not translate \\left and \\right; they are TeX commands
MisplacedLimits:
"%1 is allowed only on operators", // NOTE: %1 will be \limits
MisplacedMoveRoot:
"%1 can appear only within a root", // NOTE: %1 will be \uproot or \leftroot
MultipleCommand:
"Multiple %1", // NOTE: happens when a command or token can only be present once, e.g., \tag{}
IntegerArg:
"The argument to %1 must be an integer",
NotMathMLToken:
"%1 is not a token element", // NOTE: MathJax has a non-standard \mmltoken command to insert MathML token elements
InvalidMathMLAttr:
"Invalid MathML attribute: %1", // NOTE: MathJax has non standard MathML and HTML related commands which can contain attributes
UnknownAttrForElement:
"%1 is not a recognized attribute for %2",
MaxMacroSub1:
"MathJax maximum macro substitution count exceeded; " + // NOTE: MathJax limits the number of macro substitutions to prevent infinite loops
"is there a recursive macro call?",
MaxMacroSub2:
"MathJax maximum substitution count exceeded; " + // NOTE: MathJax limits the number of nested environements to prevent infinite loops
"is there a recursive latex environment?",
MissingArgFor:
"Missing argument for %1", // NOTE: %1 will be a macro name
ExtraAlignTab:
"Extra alignment tab in \\cases text", // NOTE: do not translate \\cases; it is a TeX command
BracketMustBeDimension:
"Bracket argument to %1 must be a dimension",
InvalidEnv:
"Invalid environment name '%1'",
UnknownEnv:
"Unknown environment '%1'",
ExtraClose:
"Extra close brace",
ExtraCloseLooking:
"Extra close brace while looking for %1",
MissingCloseBracket:
"Couldn't find closing ']' for argument to %1",
MissingOrUnrecognizedDelim:
"Missing or unrecognized delimiter for %1",
MissingDimOrUnits:
"Missing dimension or its units for %1",
TokenNotFoundForCommand:
"Couldn't find %1 for %2", // NOTE: %1 is a token (e.g.,macro or symbol) and %2 is a macro name
MathNotTerminated:
"Math not terminated in text box",
IllegalMacroParam:
"Illegal macro parameter reference",
MaxBufferSize:
"MathJax internal buffer size exceeded; is there a recursive macro call?",
/* AMSmath */
CommandNotAllowedInEnv:
"%1 not allowed in %2 environment",
MultipleLabel:
"Label '%1' multiply defined",
CommandAtTheBeginingOfLine:
"%1 must come at the beginning of the line", // NOTE: %1 will be a macro name
IllegalAlign:
"Illegal alignment specified in %1", // NOTE: %1 will be an environment name
BadMathStyleFor:
"Bad math style for %1",
PositiveIntegerArg:
"Argument to %1 must me a positive integer",
ErroneousNestingEq:
"Erroneous nesting of equation structures",
MultlineRowsOneCol:
"The rows within the %1 environment must have exactly one column",
/* bbox */
MultipleBBoxProperty:
"%1 specified twice in %2",
InvalidBBoxProperty:
"'%1' doesn't look like a color, a padding dimension, or a style",
/* begingroup */
ExtraEndMissingBegin:
"Extra %1 or missing \\begingroup", // NOTE: do not translate \\begingroup
GlobalNotFollowedBy:
"%1 not followed by \\let, \\def, or \\newcommand", // NOTE: do not translate \\let, \\def, or \\newcommand; they are TeX commands
/* color */
UndefinedColorModel:
"Color model '%1' not defined",
ModelArg1:
"Color values for the %1 model require 3 numbers",
InvalidDecimalNumber:
"Invalid decimal number",
ModelArg2:
"Color values for the %1 model must be between %2 and %3",
InvalidNumber:
"Invalid number",
/* extpfeil */
NewextarrowArg1:
"First argument to %1 must be a control sequence name",
NewextarrowArg2:
"Second argument to %1 must be two integers separated by a comma",
NewextarrowArg3:
"Third argument to %1 must be a unicode character number",
/* mhchem */
NoClosingChar:
"Can't find closing %1", // NOTE: %1 will be ) or } or ]
/* newcommand */
IllegalControlSequenceName:
"Illegal control sequence name for %1",
IllegalParamNumber:
"Illegal number of parameters specified in %1",
DoubleBackSlash:
"\\ must be followed by a control sequence",
CantUseHash2:
"Illegal use of # in template for %1",
SequentialParam:
"Parameters for %1 must be numbered sequentially",
MissingReplacementString:
"Missing replacement string for definition of %1",
MismatchUseDef:
"Use of %1 doesn't match its definition",
RunawayArgument:
"Runaway argument for %1?"
/* verb */
NoClosingDelim:
"Can't find closing delimiter for %1",
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/en/TeX.js");

View File

@ -0,0 +1,65 @@
MathJax.Localization.addTranslation("en",null,{ // NOTE use correct ISO-639-1 two letter code http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
menuTitle: "English", // NOTE language name; will appear in the MathJax submenu for switching locales
isLoaded: true,
domains: {
"_": {
isLoaded: true,
strings: {
CookieConfig:
"MathJax has found a user-configuration cookie that includes code to "+
"be run. Do you want to run it?\n\n"+
"(You should press Cancel unless you set up the cookie yourself.)",
MathProcessingError:
"Math Processing Error", // NOTE: MathJax uses 'Math' as a distinct UI choice. Please translate it literally whenever possible.
MathError:
"Math Error", // Error message used in obsolete Accessible configurations
LoadFile:
"Loading %1",
Loading:
"Loading", // NOTE: followed by growing sequence of dots
LoadFailed:
"File failed to load: %1",
ProcessMath:
"Processing Math: %1%%", // NOTE: appears during the conversion process from an input format (e.g., LaTeX, asciimath) to MathJax's internal format
Processing:
"Processing", // NOTE: followed by growing sequence of dots
TypesetMath:
"Typesetting Math: %1%%", // NOTE: appears during the layout process of converting the internal format to the output format
Typesetting:
"Typesetting", // NOTE: followed by growing sequence of dots
MathJaxNotSupported:
"Your browser does not support MathJax" // NOTE: will load when MathJax determines the browser does not have adequate features
}
},
MathMenu: {},
FontWarnings: {},
HelpDialog: {},
TeX: {},
MathML: {},
"HTML-CSS": {}
},
plural: function(n) {
if (n === 1) {return 1} // one
return 2; // other
},
number: function(n) {
return String(n).replace(".", ","); // replace dot by comma
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/en/en.js");

View File

@ -0,0 +1,52 @@
MathJax.Localization.addTranslation("fr","FontWarnings",{
isLoaded: true,
strings: {
webFont:
"MathJax utilise les polices Web pour afficher les expressions " +
"math\u00E9matiques sur cette page. Celles-ci mettent du temps \u00E0 \u00EAtre "+
"t\u00E9l\u00E9charg\u00E9es et la page serait affich\u00E9e plus rapidement si vous "+
"installiez les polices math\u00E9matiques directement dans le dossier "+
"des polices de votre syst\u00E8me.",
imageFonts:
"MathJax utilise des images de caract\u00E8res plut\u00F4t que les polices "+
"Web ou locales. Ceci rend le rendu plus lent que la normale et "+
"les expressions math\u00E9matiques peuvent ne pas s'imprimer \u00E0 la "+
"r\u00E9solution maximale de votre imprimante",
noFonts:
"MathJax n'est pas parvenu \u00E0 localiser une police pour afficher "+
"les expressions math\u00E9matiques et les images de caract\u00E8res ne "+
"sont pas disponibles. Comme solution de dernier recours, il "+
"utilise des caract\u00E8res Unicode g\u00E9n\u00E9riques en esp\u00E9rant que votre "+
"navigateur sera capable de les afficher. Certains pourront "+
"\u00EAtre rendus de fa\u00E7on incorrect voire pas du tout.",
webFonts:
"La plupart des navigateurs modernes permettent de t\u00E9l\u00E9charger "+
"des polices \u00E0 partir du Web. En mettant \u00E0 jour votre navigateur "+
"vers une version plus r\u00E9cente (ou en changeant de navigateur) "+
"la qualit\u00E9 des expressions math\u00E9matiques sur cette page pourrait "+
"\u00EAtre am\u00E9lior\u00E9e.",
fonts:
"MathJax peut utiliser les [Polices STIX](%1) ou bien les " +
"[Polices TeX de MathJax](%2). T\u00E9l\u00E9chargez et installez " +
"l'une de ces familles de polices pour am\u00E9liorer votre "+
"exp\u00E9rience avec MathJax.",
TeXPage:
"Cette page est con\u00E7ue pour utiliser les [Polices STIX](%1). " +
"T\u00E9l\u00E9chargez et installez ces polices pour am\u00E9liorer votre " +
"exp\u00E9rience avec MathJax",
TeXPage:
"Cette page est con\u00E7ue pour utiliser les [Polices TeX de MathJax](%1). " +
"T\u00E9l\u00E9chargez et installez ces polices pour am\u00E9liorer votre " +
"exp\u00E9rience avec MathJax"
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/fr/FontWarnings.js");

View File

@ -0,0 +1,25 @@
MathJax.Localization.addTranslation("fr","HTML-CSS",{
isLoaded: true,
strings: {
LoadWebFont:
"T\u00E9l\u00E9chargement de la police Web %1",
CantLoadWebFont:
"Impossible de t\u00E9l\u00E9charger la police Web %1",
FirefoxCantLoadWebFont:
"Firefox ne peut t\u00E9l\u00E9charger les polices Web \u00E0 partir d'un h\u00F4te "+
"distant",
CantFindFontUsing:
"Impossible de trouver une police valide en utilisant %1",
WebFontsNotAvailable:
"Polices Web non disponibles -- des images de caract\u00E8res vont \u00EAtre "+
"utilis\u00E9es \u00E0 la place"
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/fr/HTML-CSS.js");

View File

@ -0,0 +1,57 @@
MathJax.Localization.addTranslation("fr","HelpDialog",{
isLoaded: true,
strings: {
Help: "Aide MathJax",
MathJax:
"*MathJax* est une librairie Javascript qui permet aux auteurs " +
"d'inclure des formules math\u00E9matiques au sein de leurs pages Web. " +
"Aucune action suppl\u00E9mentaire n'est n\u00E9cessaire de la part des visiteurs.",
Browsers:
"*Navigateurs*: MathJax fonctionne avec tous les navigateurs modernes " +
"y compris Internet Explorer 6, Firefox 3, " +
"Chrome 0.2, Safari 2, Opera 9.6 et leurs versions sup\u00E9rieures ainsi " +
"que la plupart des navigateurs pour mobiles et tablettes.",
Menu:
"*Menu Math\u00E9matiques*: MathJax ajoute un menu contextuel aux \u00E9quations. "+
"Acc\u00E9dez au menu en effectuant un clic droit ou un Ctrl+clic sur " +
"n'importe quelle formule math\u00E9matique.",
ShowMath:
"Le menu *Afficher sous forme* vous permet de voir le code source de la "+
"formule pour la copier et coller (sous forme MathML ou sous son format "+
"d'origine).",
Settings:
"Le menu *Param\u00E8tres* vous permet de contr\u00F4ler diverses "+
"caract\u00E9ristiques de MathJax, telles que la taille des formules "+
"math\u00E9matiques ou le m\u00E9canisme utilis\u00E9 pour afficher ces formules.",
Language:
"Le menu *Langue* vous permet de s\u00E9lectionnez la langue utilis\u00E9e par "+
"MathJax pour ses menus et messages d'avertissement.",
Zoom:
"*Math Zoom*: si vous rencontrez des difficult\u00E9s pour lire les formules "+
"math\u00E9matiques, MathJax peut les agrandir de fa\u00E7on \u00E0 ce qu'elles soient "+
"plus lisibles.",
Accessibilty:
"*Accessibilit\u00E9*: MathJax fonctionnera automatiquement avec les "+
"lecteurs d'\u00E9cran pour rendre les expressions math\u00E9matiques accessibles "+
"aux personnes malvoyantes.",
Fonts:
"*Polices*: MathJax utilisera certaines polices math\u00E9matiques si elles "+
"sont intall\u00E9es sur votre syst\u00E8me ou bien des polices Web dans le cas "+
"contraire. Bien que non recquises, ces polices install\u00E9es sur votre "+
"syst\u00E8me acc\u00E9lereront le rendu des expressions math\u00E9matiques. Nous "+
"recommandons d'installer les [Polices STIX](%1)."
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/fr/HelpDialog.js");

View File

@ -0,0 +1,47 @@
MathJax.Localization.addTranslation("fr","MathML",{
isLoaded: true,
strings: {
BadMglyph:
"\u00C9lement mglyph incorrect: %1",
BadMglyphFont:
"Police de caract\u00E8re incorrecte: %1",
MathPlayer:
"MathJax n'est pas parvenu \u00E0 configurer MathPlayer.\n\n"+
"Vous devez d'abord installer MathPlayer. Si c'est d\u00E9j\u00E0 le cas,\n"+
"vos param\u00E8tres de s\u00E9curit\u00E9s peuvent emp\u00EAcher l'ex\u00E9cution des\n"+
"contr\u00F4les ActiveX. S\u00E9lectionnez Options Internet dans le menu\n"+
"Outils et s\u00E9lectionnez l'onglet S\u00E9curit\u00E9. Appuyez ensuite sur\n"+
"le menu Niveau Personalis\u00E9. Assurez vous que les param\u00E8tres\n"+
"Ex\u00E9cution des contr\u00F4les ActiveX et Comportements des ex\u00E9cutables\n"+
"et des scripts sont activ\u00E9s.\n\n"+
"Actuellement, vous verrez des messages d'erreur \u00E0 la place des\n"+
"expressions math\u00E9matiques.",
CantCreateXMLParser:
"MathJax ne peut cr\u00E9er un analyseur grammatical XML pour le MathML",
UnknownNodeType:
"Type de noeud inconnu: %1",
UnexpectedTextNode:
"Noeud de texte inattendu: %1",
ErrorParsingMathML:
"Erreur lors de l'analyse grammaticale du code MathML",
ParsingError:
"Erreur lors de l'analyse du code MathML: %1",
MathMLSingleElement:
"Le code MathML doit \u00EAtre form\u00E9 d'un unique \u00E9l\u00E9ment",
MathMLRootElement:
"Le code MathML doit \u00EAtre form\u00E9 d'un \u00E9l\u00E9ment <math> et non d'un \u00E9l\u00E9ment %1"
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/fr/MathML.js");

View File

@ -0,0 +1,129 @@
MathJax.Localization.addTranslation("fr","MathMenu",{
isLoaded: true,
strings: {
Show: "Afficher sous forme",
MathMLcode: "de code MathML",
OriginalMathML: "de code MathML originel",
TeXCommands: "de commandes TeX",
AsciiMathInput: "de code AsciiMathML",
Original: "originelle",
ErrorMessage: "de message d'erreur",
texHints: "Inclure les donn\u00E9es TeX dans le MathML",
Settings: "Param\u00E8tres",
ZoomTrigger: "D\u00E9clenchement du zoom",
Hover: "Survol de la souris",
Click: "Clic de souris",
DoubleClick: "Double-clic",
NoZoom: "Pas de zoom",
TriggerRequires: "Le d\u00E9clenchement n\u00E9cessite la touche",
Option: "Option",
Alt: "Alt",
Command: "Command",
Control: "Control",
Shift: "Shift",
ZoomFactor: "Facteur de zoom",
Renderer: "Mode de rendu",
MPHandles: "Laissez MathPlayer g\u00E9rer les",
MenuEvents: "\u00C9v\u00E8nements du menu",
MouseEvents: "\u00C9v\u00E8nements de la souris",
MenuAndMouse: "\u00C9v\u00E8nements de menu et de la souris",
FontPrefs: "Pr\u00E9f\u00E9rences des polices",
ForHTMLCSS: "Pour le HTML-CSS:",
Auto: "Auto",
TeXLocal: "TeX (locales)",
TeXWeb: "TeX (web)",
TeXImage: "TeX (image)",
STIXLocal: "STIX (locales)",
ContextMenu: "Menu contextuel",
Browser: "Navigateur",
Scale: "Mise \u00E0 l'\u00E9chelle ...",
Discoverable: "Mettez en surbrillance lors du survol",
Locale: "Langue",
LoadLocale: "Charger \u00E0 partir de l'URL...",
About: "\u00C0 propos de MathJax",
Help: "Aide MathJax",
localTeXfonts: "utilisant les polices TeX locales",
webTeXfonts: "utilisant les polices TeX Web",
imagefonts: "utilisant les images de caract\u00E8res",
localSTIXfonts: "utilisant les polices STIX locales",
webSVGfonts: "utilisant les polices SVG Web",
genericfonts: "utilisant les polices locales g\u00E9n\u00E9riques",
wofforotffonts: "les polices woff ou otf",
eotffonts: "les polices eot",
svgfonts: "les polices svg",
WebkitNativeMMLWarning:
"Votre navigateur ne semble pas comporter de support MathML, " +
"changer le mode de rendu pourrait rendre illisibles " +
"les expressions math\u00E9matiques.",
MSIENativeMMLWarning:
"Internet Explorer a besoin du module compl\u00E9mentaire MathPlayer " +
"pour afficher le MathML.",
OperaNativeMMLWarning:
"Le support MathML d'Opera est limit\u00E9, changer le mode de rendu " +
"pourrait entrainer un affichage m\u00E9diocre de certaines expressions.",
SafariNativeMMLWarning:
"Le support MathML natif de votre navigateur ne comporte pas " +
"toutes les fonctionnalit\u00E9s requises par MathJax, certaines " +
"expressions pourront donc ne pas s'afficher correctement.",
FirefoxNativeMMLWarning:
"Le support MathML natif de votre navigateur ne comporte pas " +
"toutes les fonctionnalit\u00E9s requises par MathJax, certaines " +
"expressions pourront donc ne pas s'afficher correctement.",
LoadURL:
"Charger les donn\u00E9es de traduction \u00E0 partir de cette addresse URL:",
BadURL:
"L'adresse URL doit \u00EAtre un fichier Javascript contenant des donn\u00E9es de traduction MathJax." +
"Les noms de fichier Javascript doivent se terminer par '.js'",
BadData:
"\u00C9chec du chargement des donn\u00E9es de traduction \u00E0 partir de %1",
SwitchAnyway:
"\u00CAtes vous certain de vouloir changer le mode de rendu ?\n\n" +
"Appuyez sur OK pour valider ou Annuler pour continuer avec le " +
"mode de rendu actuellement s\u00E9lectionn\u00E9.",
ScaleMath:
"Mise \u00E0 l'\u00E9chelle des expressions math\u00E9matiques (par rapport au " +
"text environnant) de",
NonZeroScale:
"L'\u00E9chelle ne peut \u00EAtre nulle",
PercentScale:
"L'\u00E9chelle doit \u00EAtre un pourcentage (e.g. 120%%)",
IE8warning:
"Ceci d\u00E9sactivera le menu de MathJax et les fonctionalit\u00E9s de " +
"zoom mais vous pourrez toujours obtenir le menu de MathJax " +
"en utilisant la commande Alt+Clic sur une expression.\n\n" +
"\u00CAtes vous certain de vouloir choisir les options de MathPlayer?",
IE9warning:
"Le menu contextuel de MathJax sera d\u00E9sactiv\u00E9, " +
"mais vous pourrez toujours obtenir le menu de MathJax " +
"en utilisant la commande Alt-Clic sur une expression.",
NoOriginalForm:
"Aucune forme originelle disponible.",
Close:
"Fermer",
EqSource:
"Source de l'\u00E9quation MathJax"
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/fr/MathMenu.js");

View File

@ -0,0 +1,242 @@
MathJax.Localization.addTranslation("fr","TeX",{
isLoaded: true,
strings: {
ExtraOpenMissingClose:
"Accolade ouvrante manquante ou accolade fermante non attendue",
ExtraCloseMissingOpen:
"Accolade fermante non attendue ou accolade ouvrante manquante",
MissingLeftExtraRight:
"Commande \\left manquante ou commande \\right non attendue",
MissingScript:
"Argument en exposant ou en indice manquant",
ExtraLeftMissingRight:
"Commande \\left inattendue ou commande \\right manquante",
Misplaced:
"Mauvaise position pour la commande %1",
MissingOpenForSub:
"Accolade ouvrante manquante pour le script en indice",
MissingOpenForSup:
"Accolade ouvrante manquante pour le script en exposant",
AmbiguousUseOf:
"Usage ambigu de la commande %1",
EnvBadEnd:
"\\begin{%1} s'est termin\u00E9 par un \\end{%2}",
EnvMissingEnd:
"\\end{%1} manquant",
MissingBoxFor:
"Boite manquante pour la commande %1",
MissingCloseBrace:
"Accolade fermante manquante",
UndefinedControlSequence:
"Commande %1 non d\u00E9finie",
IllegalControlSequenceName:
"Nom de contr\u00F4le de s\u00E9quence non autoris\u00E9 pour la commande %1",
IllegalParamNumber:
"Nombre de param\u00E8tres incorrect pour la commande %1",
DoubleExponent:
"Double exposant: utilisez des accolades pour clarifier",
DoubleSubscripts:
"Double indice: utilisez des accolades pour clarifier",
DoubleExponentPrime:
"Un prime entraine un double exposant: utilisez "+
"des accolades pour clarifier",
CantUseHash1:
"Vous ne pouvez pas utilisez le caract\u00E8re #, indiquant un "+
"param\u00E8tre de macro, dans le mode math\u00E9matique",
CantUseHash2:
"Usage du caract\u00E8re # non autoris\u00E9 dans le mod\u00E8le pour la s\u00E9quence "+
"de contr\u00F4le %1",
MisplacedMiddle:
"La commande %1 doit \u00EAtre plac\u00E9e \u00E0 l'int\u00E9rieur d'une section "+
"\\left ... \right",
MisplacedLimits:
"La commande %1 n'est autoris\u00E9e que sur les op\u00E9rateurs",
MisplacedMoveRoot:
"La commande %1 n'est autoris\u00E9e qu'\u00E0 l'int\u00E9rieur d'une racine",
MultipleCommand:
"Usage multiple de la commande %1",
IntegerArg:
"L'argument de la commande %1 doit \u00EAtre un entier",
PositiveIntegerArg:
"L'argument de la commande %1 doit \u00EAtre un entier strictement "+
"positif",
NotMathMLToken:
"L'\u00E9l\u00E9ment %1 n'est pas un \u00E9l\u00E9ment MathML \u00E9l\u00E9mentaire",
InvalidMathMLAttr:
"Attribut MathML non valide: %1",
UnknownAttrForElement:
"Attribut %1 inconnu pour l'\u00E9l\u00E9ment %2",
MaxMacroSub1:
"Le nombre maximal de substitution de macro autoris\u00E9 par MathJax "+
"a \u00E9t\u00E9 d\u00E9pass\u00E9. Il y a t'il un appel de macro r\u00E9cursif?",
MaxMacroSub2:
"Le nombre maximal de substitution de macro autoris\u00E9 par MathJax "+
"a \u00E9t\u00E9 d\u00E9pass\u00E9. Il y a t'il un environnement LaTeX r\u00E9cursif?",
MissingArgFor:
"Argument manquant pour la commande %1",
ExtraAlignTab:
"Caract\u00E8re d'alignement '&' non attendue pour le texte de la commande \\cases",
BracketMustBeDimension:
"L'argument entre crochets de la commande %1 doit \u00EAtre une dimension",
InvalidEnv:
"Nom d'environnement '%1' non valide",
UnknownEnv:
"Environnement '%1' inconnu",
ExtraClose:
"Accolade fermante non attendue",
ExtraCloseLooking:
"Accolade fermante non attendue lors de la recherche de %1",
MissingCloseBracket:
"Impossible de trouver le crochet fermant pour l'argument de la commande %1",
MissingOrUnrecognizedDelim:
"D\u00E9limiteur manquant ou non reconnu pour la commande %1",
MissingDimOrUnits:
"Dimension ou unit\u00E9 manquante pour la commande %1",
TokenNotFoundForCommand:
"Impossible de trouver la commande %1 pour la commande %2",
MathNotTerminated:
"Expression math\u00E9matique non termin\u00E9e \u00E0 l'int\u00E9rieur de cette boite "+
"de texte",
IllegalMacroParam:
"Param\u00E8tre de r\u00E9f\u00E9rence de macro non autoris\u00E9",
MaxBufferSize:
"Taille maximale du tampon interne de MathJax d\u00E9pass\u00E9e. " +
"Il y a t'il un appel de macro r\u00E9cursif?",
CommandNotAllowedInEnv:
"La commande %1 n'est pas autoris\u00E9 \u00E0 l'int\u00E9rieur de "+
"l'environnement %2",
MultipleCommand:
"Usage multiple de la commande %1",
MultipleLabel:
"\u00C9tiquette '%1' d\u00E9j\u00E0 d\u00E9finie",
CommandAtTheBeginingOfLine:
"La commande %1 doit \u00EAtre plac\u00E9e en d\u00E9but de ligne",
IllegalAlign:
"Alignement non autoris\u00E9 pour la commande %1",
BadMathStyleFor:
"Style math\u00E9matique non valide pour la commande %1",
ErroneousNestingEq:
"Emboitement incorrect des structures d'\u00E9quation",
MultlineRowsOneCol:
"L'environnement multline doit avoir exactement une colonne",
NoClosingDelim:
"Impossible de trouver le d\u00E9limiteur fermant pour la commande %1",
NoClosingChar:
"Impossible de trouver le d\u00E9limiteur '%1' fermant",
MultipleBBoxProperty:
"La propri\u00E9t\u00E9 %1 de la commande %2 est sp\u00E9cifi\u00E9e deux fois",
InvalidBBoxProperty:
"La valeur '%1' ne semble pas \u00EAtre une couleur, une dimension de "+
"marge int\u00E9rieur ou un style.",
ExtraEndMissingBegin:
"Commande %1 non attendue ou commande \\begingroup manquante",
GlobalNotFollowedBy:
"Commande %1 non suivie d'une commande \\let, \\def ou \newcommand",
NewextarrowArg1:
"Le premier argument de la commande %1 doit \u00EAtre le nom d'une "+
"s\u00E9quence de contr\u00F4le",
NewextarrowArg2:
"Le second argument de la commande %1 doit \u00EAtre deux entiers "+
"s\u00E9par\u00E9s par une virgule",
NewextarrowArg3:
"Le troisi\u00E8me argument de la commande %1 doit \u00EAtre la valeur d'un "+
"caract\u00E8re unicode",
UndefinedColorModel:
"Le mod\u00E8le de couleur '%1' n'est pas d\u00E9fini",
ModelArg1:
"Les valeurs de couleurs pour le mod\u00E8le %1 n\u00E9cessitent 3 nombres",
InvalidDecimalNumber:
"Nombre d\u00E9cimal non valide",
ModelArg2:
"Les valeurs de couleurs pour le mod\u00E8le %1 doivent \u00EAtre comprises entre %2 et %3",
InvalidNumber:
"Nombre non valide",
DoubleBackSlash:
"\\ doit \u00EAtre suivi d'une s\u00E9quence de contr\u00F4le",
SequentialParam:
"Les param\u00E8tres de la s\u00E9quence de contr\u00F4le %1 doivent \u00EAtre "+
"\u00E9num\u00E9r\u00E9s de fa\u00E7on s\u00E9quentielle",
MissingReplacementString:
"Chaine de caract\u00E8re de remplacement manquante pour la d\u00E9finition %1",
MismatchUseDef:
"L'utilisation de la commande %1 ne correspond pas \u00E0 sa d\u00E9finition",
RunawayArgument:
"Argument non termin\u00E9 pour la commande %1?"
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/fr/TeX.js");

View File

@ -0,0 +1,58 @@
MathJax.Localization.addTranslation("fr",null,{
menuTitle: "Fran\u00E7ais",
isLoaded: true,
domains: {
"_": {
isLoaded: true,
strings: {
CookieConfig:
"MathJax a trouv\u00E9 un cookie de configuration utilisateur qui inclut "+
"du code ex\u00E9cutable. Souhaitez vous l'ex\u00E9cuter?\n\n"+
"(Choisissez Annuler sauf si vous avez cr\u00E9\u00E9 ce cookie vous-m\u00EAme)",
MathProcessingError:
"Erreur de traitement de la formule math\u00E9matique",
MathError:
"Erreur dans la formule math\u00E9matique",
LoadFile: "T\u00E9l\u00E9chargement de %1",
Loading: "T\u00E9l\u00E9chargement",
LoadFailed: "\u00C9chec du t\u00E9l\u00E9chargement de %1",
ProcessMath: "Traitement des formules: %1%%",
Processing: "Traitement",
TypesetMath: "Composition des formules: %1%%",
Typesetting: "Composition",
MathJaxNotSupported:
"Votre navigateur ne supporte pas MathJax"
}
},
MathMenu: {},
FontWarnings: {},
HelpDialog: {},
TeX: {},
MathML: {},
"HTML-CSS": {}
},
plural: function(n) {
if (0 <= n && n < 2) {return 1} // one
return 2; // other
},
number: function(n) {
return String(n).replace(".", ","); // replace dot by comma
}
});
MathJax.Ajax.loadComplete("[MathJax]/localization/fr/fr.js");