Merge branch 'develop' into integrate_keyboard_events

Conflicts:
	unpacked/jax/output/CommonHTML/jax.js
This commit is contained in:
zorkow 2015-09-01 18:30:46 +01:00
commit 94b0d7d1ee
116 changed files with 9723 additions and 993 deletions

View File

@ -1975,7 +1975,7 @@ MathJax.Hub = {
getJaxFor: function (element) {
if (typeof(element) === 'string') {element = document.getElementById(element)}
if (element && element.MathJax) {return element.MathJax.elementJax}
if (element && element.isMathJax) {
if (this.isMathJaxNode(element)) {
while (element && !element.jaxID) {element = element.parentNode}
if (element) {return MathJax.OutputJax[element.jaxID].getJaxFromMath(element)}
}
@ -1984,14 +1984,17 @@ MathJax.Hub = {
isJax: function (element) {
if (typeof(element) === 'string') {element = document.getElementById(element)}
if (element && element.isMathJax) {return 1}
if (element && element.tagName != null && element.tagName.toLowerCase() === 'script') {
if (this.isMathJaxNode(element.tagName)) {return 1}
if (element && (element.tagName||"").toLowerCase() === 'script') {
if (element.MathJax)
{return (element.MathJax.state === MathJax.ElementJax.STATE.PROCESSED ? 1 : -1)}
if (element.type && this.inputJax[element.type.replace(/ *;(.|\s)*/,"")]) {return -1}
}
return 0;
},
isMathJaxNode: function (element) {
return !!element && (element.isMathJax || (element.tagName||"").substr(0,4) === "MJX-");
},
setRenderer: function (renderer,type) {
if (!renderer) return;
@ -2172,13 +2175,15 @@ MathJax.Hub = {
if (!script.MathJax.elementJax || script.MathJax.state === STATE.UPDATE) {
this.checkScriptSiblings(script); // remove preJax/postJax etc.
var type = script.type.replace(/ *;(.|\s)*/,""); // the input jax type
jax = this.inputJax[type].Process(script,state); // run the input jax
var input = this.inputJax[type]; // the input jax itself
jax = input.Process(script,state); // run the input jax
if (typeof jax === 'function') { // if a callback was returned
if (jax.called) continue; // go back and call Process() again
this.RestartAfter(jax); // wait for the callback
}
jax.Attach(script,this.inputJax[type].id); // register the jax on the script
jax = jax.Attach(script,input.id); // register the jax on the script
this.saveScript(jax,state,script,STATE); // add script to state
this.postInputHooks.Execute(jax,input.id,script); // run global jax filters
} else if (script.MathJax.state === STATE.OUTPUT) {
this.saveScript(script.MathJax.elementJax,state,script,STATE); // add script to state
}
@ -2198,6 +2203,7 @@ MathJax.Hub = {
state.start = new Date().getTime(); state.i = state.j = 0;
return null;
},
postInputHooks: MathJax.Callback.Hooks(true), // hooks to run after element jax is created
saveScript: function (jax,state,script,STATE) {
//
// Check that output jax exists
@ -2541,8 +2547,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.resetLocale(config.menuSettings.locale)}
var SETTINGS = config.menuSettings;
if (SETTINGS.locale) MathJax.Localization.resetLocale(SETTINGS.locale);
var renderer = config.menuSettings.renderer, jax = config.jax;
if (renderer) {
var name = "output/"+renderer; jax.sort();
@ -2554,8 +2560,12 @@ MathJax.Hub.Startup = {
}
jax.unshift(name);
}
if (config.menuSettings.CHTMLpreview && !MathJax.Extension["CHTML-preview"])
{MathJax.Hub.config.extensions.push("CHTML-preview.js")}
if (SETTINGS.CHTMLpreview != null) {
if (SETTINGS.FHTMLpreview == null) SETTINGS.FHTMLpreview = SETTINGS.CHTMLpreview;
delete SETTINGS.CHTMLpreview;
}
if (SETTINGS.FHTMLpreview && !MathJax.Extension["FHTML-preview"])
MathJax.Hub.config.extensions.push("FHTML-preview.js");
},MathJax.Hub.config],
["Post",this.signal,"End Cookie"]
);
@ -2646,7 +2656,7 @@ MathJax.Hub.Startup = {
}
},
HashCheck: function (target) {
if (target.isMathJax) {
if (this.isMathJaxNode(target)) {
var jax = MathJax.Hub.getJaxFor(target);
if (jax && MathJax.OutputJax[jax.outputJax].hashCheck)
{target = MathJax.OutputJax[jax.outputJax].hashCheck(target)}

View File

@ -18,8 +18,8 @@
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
extensions: ["asciimath2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","CHTML-preview.js"],
jax: ["input/AsciiMath","output/HTML-CSS","output/NativeMML","output/CommonHTML"]
extensions: ["asciimath2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","FHTML-preview.js"],
jax: ["input/AsciiMath","output/HTML-CSS","output/NativeMML","output/FastHTML"]
});
MathJax.Ajax.loadComplete("[MathJax]/config/AM_HTMLorMML-full.js");

View File

@ -18,8 +18,8 @@
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
extensions: ["asciimath2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","CHTML-preview.js"],
jax: ["input/AsciiMath","output/HTML-CSS","output/NativeMML","output/CommonHTML"]
extensions: ["asciimath2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","FHTML-preview.js"],
jax: ["input/AsciiMath","output/HTML-CSS","output/NativeMML","output/FastHTML"]
});
MathJax.Ajax.loadComplete("[MathJax]/config/AM_HTMLorMML.js");

View File

@ -18,8 +18,8 @@
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
extensions: ["tex2jax.js","mml2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","CHTML-preview.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML","output/CommonHTML"],
extensions: ["tex2jax.js","mml2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","FHTML-preview.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML","output/FastHTML"],
menuSettings: {
zoom: "Double-Click",
mpContext: true,

View File

@ -18,8 +18,8 @@
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
extensions: ["tex2jax.js","mml2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","CHTML-preview.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML","output/CommonHTML"],
extensions: ["tex2jax.js","mml2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","FHTML-preview.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML","output/FastHTML"],
menuSettings: {
zoom: "Double-Click",
mpContext: true,

View File

@ -18,7 +18,7 @@
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
extensions: ["mml2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","CHTML-preview.js"],
extensions: ["mml2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","FHTML-preview.js"],
jax: ["input/MathML","output/HTML-CSS","output/NativeMML","output/CommonHTML"]
});

View File

@ -18,8 +18,8 @@
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
extensions: ["mml2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","CHTML-preview.js"],
jax: ["input/MathML","output/HTML-CSS","output/NativeMML","output/CommonHTML"]
extensions: ["mml2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","FHTML-preview.js"],
jax: ["input/MathML","output/HTML-CSS","output/NativeMML","output/FastHTML"]
});
MathJax.Ajax.loadComplete("[MathJax]/config/MML_HTMLorMML.js");

View File

@ -18,8 +18,8 @@
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
extensions: ["tex2jax.js","mml2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","CHTML-preview.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML","output/CommonHTML"]
extensions: ["tex2jax.js","mml2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","FHTML-preview.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML","output/FastHTML"]
});
MathJax.Ajax.loadComplete("[MathJax]/config/TeX-AMS-MML_HTMLorMML-full.js");

View File

@ -18,8 +18,8 @@
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
extensions: ["tex2jax.js","mml2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","CHTML-preview.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML","output/CommonHTML"]
extensions: ["tex2jax.js","mml2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","FHTML-preview.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML","output/FastHTML"]
});
MathJax.Ajax.loadComplete("[MathJax]/config/TeX-AMS-MML_HTMLorMML.js");

View File

@ -17,8 +17,8 @@
*/
MathJax.Hub.Config({
extensions: ["tex2jax.js","mml2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","CHTML-preview.js"],
jax: ["input/TeX","input/MathML","output/SVG","output/CommonHTML"]
extensions: ["tex2jax.js","mml2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","FHTML-preview.js"],
jax: ["input/TeX","input/MathML","output/SVG","output/FastHTML"]
});
MathJax.Ajax.loadComplete("[MathJax]/config/TeX-AMS-MML_SVG-full.js");

View File

@ -17,8 +17,8 @@
*/
MathJax.Hub.Config({
extensions: ["tex2jax.js","mml2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","CHTML-preview.js"],
jax: ["input/TeX","input/MathML","output/SVG","output/CommonHTML"]
extensions: ["tex2jax.js","mml2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","FHTML-preview.js"],
jax: ["input/TeX","input/MathML","output/SVG","output/FastHTML"]
});
MathJax.Ajax.loadComplete("[MathJax]/config/TeX-AMS-MML_SVG.js");

View File

@ -17,8 +17,8 @@
*/
MathJax.Hub.Config({
extensions: ["tex2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","CHTML-preview.js"],
jax: ["input/TeX","output/HTML-CSS","output/CommonHTML"]
extensions: ["tex2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","FHTML-preview.js"],
jax: ["input/TeX","output/HTML-CSS","output/FastHTML"]
});
MathJax.Ajax.loadComplete("[MathJax]/config/TeX-AMS_HTML-full.js");

View File

@ -17,8 +17,8 @@
*/
MathJax.Hub.Config({
extensions: ["tex2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","CHTML-preview.js"],
jax: ["input/TeX","output/HTML-CSS","output/CommonHTML"]
extensions: ["tex2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","FHTML-preview.js"],
jax: ["input/TeX","output/HTML-CSS","output/FastHTML"]
});
MathJax.Ajax.loadComplete("[MathJax]/config/TeX-AMS_HTML.js");

View File

@ -18,8 +18,8 @@
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
extensions: ["tex2jax.js","mml2jax.js","asciimath2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","CHTML-preview.js"],
jax: ["input/TeX","input/MathML","input/AsciiMath","output/HTML-CSS","output/NativeMML","output/CommonHTML"]
extensions: ["tex2jax.js","mml2jax.js","asciimath2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","FHTML-preview.js"],
jax: ["input/TeX","input/MathML","input/AsciiMath","output/HTML-CSS","output/NativeMML","output/FastHTML"]
});
MathJax.Ajax.loadComplete("[MathJax]/config/TeX-MML-AM_HTMLorMML-full.js");

View File

@ -18,8 +18,8 @@
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
extensions: ["tex2jax.js","mml2jax.js","asciimath2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","CHTML-preview.js"],
jax: ["input/TeX","input/MathML","input/AsciiMath","output/HTML-CSS","output/NativeMML","output/CommonHTML"]
extensions: ["tex2jax.js","mml2jax.js","asciimath2jax.js","MathEvents.js","MathZoom.js","MathMenu.js","toMathML.js","TeX/noErrors.js","TeX/noUndefined.js","TeX/AMSmath.js","TeX/AMSsymbols.js","FHTML-preview.js"],
jax: ["input/TeX","input/MathML","input/AsciiMath","output/HTML-CSS","output/NativeMML","output/FastHTML"]
});
MathJax.Ajax.loadComplete("[MathJax]/config/TeX-MML-AM_HTMLorMML.js");

View File

@ -5,9 +5,7 @@
*
* MathJax/extensions/CHTML-preview.js
*
* Implements a fast preview using the Common-HTML output jax
* and then a slower update to the more accurate HTML-CSS output
* (or whatever the user has selected).
* Backward compatibility with old CHTML-preview extension.
*
* ---------------------------------------------------------------------
*
@ -26,111 +24,7 @@
* limitations under the License.
*/
(function (HUB,HTML,BROWSER) {
var SETTINGS = HUB.config.menuSettings;
var CHTMLpreview = MathJax.Extension["CHTML-preview"] = {
version: "2.5.3",
//
// Configuration for the chunking of the main output
// after the previews have been created, and other configuration.
//
config: HUB.CombineConfig("CHTML-preview",{
Chunks: {EqnChunk: 10000, EqnChunkFactor: 1, EqnChunkDelay: 0},
color: "inherit!important",
updateTime: 30, updateDelay: 6,
messageStyle: "none",
disabled: BROWSER.isMSIE && !BROWSER.versionAtLeast("8.0")
}),
//
// Ajust the chunking of the output jax
//
Config: function () {
MathJax.Ajax.Styles({".MathJax_Preview .MJXc-math":{color:this.config.color}});
var update, delay, style, done, saved;
var config = this.config;
if (!config.disabled && SETTINGS.CHTMLpreview == null)
HUB.Config({menuSettings:{CHTMLpreview:true}});
if (SETTINGS.CHTMLpreview) HUB.Config({"HTML-CSS":config.Chunks, SVG:config.Chunks});
HUB.Register.MessageHook("Begin Math Output",function () {
if (!done && SETTINGS.CHTMLpreview && SETTINGS.renderer !== "CommonHTML") {
update = HUB.processUpdateTime; delay = HUB.processUpdateDelay;
style = HUB.config.messageStyle;
HUB.processUpdateTime = config.updateTime;
HUB.processUpdateDelay = config.updateDelay;
HUB.Config({messageStyle: config.messageStyle});
MathJax.Message.Clear(0,0);
saved = true;
}
});
HUB.Register.MessageHook("End Math Output",function () {
if (!done && saved) {
HUB.processUpdateTime = update;
HUB.processUpdateDelay = delay;
HUB.Config({messageStyle: style});
done = true;
}
});
},
//
// Insert a preview span, if there isn't one already,
// and call the CommonHTML output jax to create the preview
//
Preview: function (data) {
if (!SETTINGS.CHTMLpreview || SETTINGS.renderer === "CommonHTML") return;
var preview = data.script.MathJax.preview || data.script.previousSibling;
if (!preview || preview.className !== MathJax.Hub.config.preRemoveClass) {
preview = HTML.Element("span",{className:MathJax.Hub.config.preRemoveClass});
data.script.parentNode.insertBefore(preview,data.script);
data.script.MathJax.preview = preview;
}
preview.innerHTML = ""; preview.style.color = "inherit";
return this.postFilter(preview,data);
},
postFilter: function (preview,data) {
//
// Load the CommonHTML jax if it is not already loaded
//
if (!data.math.root.toCommonHTML) {
var queue = MathJax.Callback.Queue();
queue.Push(
["Require",MathJax.Ajax,"[MathJax]/jax/output/CommonHTML/config.js"],
["Require",MathJax.Ajax,"[MathJax]/jax/output/CommonHTML/jax.js"]
);
HUB.RestartAfter(queue.Push({}));
}
data.math.root.toCommonHTML(preview);
},
//
// Hook into the input jax postFilter to create the previews as
// the input jax are processed.
//
Register: function (name) {
HUB.Register.StartupHook(name+" Jax Require",function () {
var jax = MathJax.InputJax[name];
jax.postfilterHooks.Add(["Preview",MathJax.Extension["CHTML-preview"]],50);
});
}
}
//
// Hook into each input jax
//
CHTMLpreview.Register("TeX");
CHTMLpreview.Register("MathML");
CHTMLpreview.Register("AsciiMath");
HUB.Register.StartupHook("End Config",["Config",CHTMLpreview]);
HUB.Startup.signal.Post("CHTML-preview Ready");
})(MathJax.Hub,MathJax.HTML,MathJax.Hub.Browser);
MathJax.Ajax.loadComplete("[MathJax]/extensions/CHTML-preview.js");
MathJax.Callback.Queue(
["Require",MathJax.Ajax,"[MathJax]/extensions/FHTML-preview.js"],
["loadComplete",MathJax.Ajax,"[MathJax]/extensions/CHTML-preview.js"]
);

View File

@ -0,0 +1,142 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/extensions/FHTML-preview.js
*
* Implements a fast preview using the FastHTML output jax
* and then a slower update to the more accurate HTML-CSS output
* (or whatever the user has selected).
*
* ---------------------------------------------------------------------
*
* Copyright (c) 2014-2015 The MathJax Consortium
*
* 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,BROWSER) {
var SETTINGS = HUB.config.menuSettings;
var msieColorBug = BROWSER.isMSIE && (document.documentMode||0) < 8;
var FHTMLpreview = MathJax.Extension["FHTML-preview"] = {
version: "2.5.3",
//
// Configuration for the chunking of the main output
// after the previews have been created, and other configuration.
//
config: HUB.CombineConfig("FHTML-preview",{
Chunks: {EqnChunk: 10000, EqnChunkFactor: 1, EqnChunkDelay: 0},
color: "inherit!important",
updateTime: 30, updateDelay: 6,
messageStyle: "none",
disabled: BROWSER.isMSIE && !BROWSER.versionAtLeast("8.0")
}),
//
// Ajust the chunking of the output jax
//
Config: function () {
if (HUB.config["CHTML-preview"])
MathJax.Hub.Config({"FHTML-preview": HUB.config["CHTML-preview"]});
var update, delay, style, done, saved;
var config = this.config;
if (!config.disabled && SETTINGS.FHTMLpreview == null)
HUB.Config({menuSettings:{FHTMLpreview:true}});
if (SETTINGS.FHTMLpreview) {
MathJax.Ajax.Styles({".MathJax_Preview .MJXf-math":{color:config.color}});
HUB.Config({"HTML-CSS": config.Chunks, CommonHTML: config.Chunks, SVG: config.Chunks});
}
HUB.Register.MessageHook("Begin Math Output",function () {
if (!done && SETTINGS.FHTMLpreview && SETTINGS.renderer !== "FastHTML") {
update = HUB.processUpdateTime; delay = HUB.processUpdateDelay;
style = HUB.config.messageStyle;
HUB.processUpdateTime = config.updateTime;
HUB.processUpdateDelay = config.updateDelay;
HUB.Config({messageStyle: config.messageStyle});
MathJax.Message.Clear(0,0);
saved = true;
}
});
HUB.Register.MessageHook("End Math Output",function () {
if (!done && saved) {
HUB.processUpdateTime = update;
HUB.processUpdateDelay = delay;
HUB.Config({messageStyle: style});
done = true;
}
});
},
//
// Insert a preview span, if there isn't one already,
// and call the FastHTML output jax to create the preview
//
Preview: function (data) {
if (!SETTINGS.FHTMLpreview || SETTINGS.renderer === "FastHTML") return;
var preview = data.script.MathJax.preview || data.script.previousSibling;
if (!preview || preview.className !== MathJax.Hub.config.preRemoveClass) {
preview = HTML.Element("span",{className:MathJax.Hub.config.preRemoveClass});
data.script.parentNode.insertBefore(preview,data.script);
data.script.MathJax.preview = preview;
}
preview.innerHTML = "";
preview.style.color = (msieColorBug ? "black" : "inherit");
return this.postFilter(preview,data);
},
postFilter: function (preview,data) {
//
// Load the FastHTML jax if it is not already loaded
//
if (!data.math.root.toFastHTML) {
var queue = MathJax.Callback.Queue();
queue.Push(
["Require",MathJax.Ajax,"[MathJax]/jax/output/FastHTML/config.js"],
["Require",MathJax.Ajax,"[MathJax]/jax/output/FastHTML/jax.js"]
);
HUB.RestartAfter(queue.Push({}));
}
data.math.root.toFastHTML(preview);
},
//
// Hook into the input jax postFilter to create the previews as
// the input jax are processed.
//
Register: function (name) {
HUB.Register.StartupHook(name+" Jax Require",function () {
var jax = MathJax.InputJax[name];
jax.postfilterHooks.Add(["Preview",MathJax.Extension["FHTML-preview"]],50);
});
}
}
//
// Hook into each input jax
//
FHTMLpreview.Register("TeX");
FHTMLpreview.Register("MathML");
FHTMLpreview.Register("AsciiMath");
HUB.Register.StartupHook("End Config",["Config",FHTMLpreview]);
HUB.Startup.signal.Post("FHTML-preview Ready");
})(MathJax.Hub,MathJax.HTML,MathJax.Hub.Browser);
MathJax.Ajax.loadComplete("[MathJax]/extensions/FHTML-preview.js");

View File

@ -295,7 +295,7 @@
if (SETTINGS.discoverable || SETTINGS.zoom === "Hover") {
var from = event.fromElement || event.relatedTarget,
to = event.toElement || event.target;
if (from && to && (from.isMathJax != to.isMathJax ||
if (from && to && (HUB.isMathJaxNode(from) !== HUB.isMathJaxNode(to) ||
HUB.getJaxFor(from) !== HUB.getJaxFor(to))) {
var jax = this.getJaxFromMath(math);
if (jax.hover) {HOVER.ReHover(jax)} else {HOVER.HoverTimer(jax,math)}
@ -312,7 +312,7 @@
if (SETTINGS.discoverable || SETTINGS.zoom === "Hover") {
var from = event.fromElement || event.relatedTarget,
to = event.toElement || event.target;
if (from && to && (from.isMathJax != to.isMathJax ||
if (from && to && (HUB.isMathJaxNode(from) !== HUB.isMathJaxNode(to) ||
HUB.getJaxFor(from) !== HUB.getJaxFor(to))) {
var jax = this.getJaxFromMath(math);
if (jax.hover) {HOVER.UnHover(jax)} else {HOVER.ClearHoverTimer()}

View File

@ -1460,12 +1460,13 @@
),
ITEM.RULE(),
ITEM.SUBMENU(["Renderer","Math Renderer"], {hidden:!CONFIG.showRenderer},
ITEM.RADIO("HTML-CSS", "renderer", {action: MENU.Renderer}),
ITEM.RADIO("Fast HTML", "renderer", {action: MENU.Renderer, value:"CommonHTML"}),
ITEM.RADIO("MathML", "renderer", {action: MENU.Renderer, value:"NativeMML"}),
ITEM.RADIO("SVG", "renderer", {action: MENU.Renderer}),
ITEM.RADIO("HTML-CSS", "renderer", {action: MENU.Renderer}),
ITEM.RADIO("Common HTML","renderer", {action: MENU.Renderer, value:"CommonHTML"}),
ITEM.RADIO("Fast HTML", "renderer", {action: MENU.Renderer, value:"FastHTML"}),
ITEM.RADIO("MathML", "renderer", {action: MENU.Renderer, value:"NativeMML"}),
ITEM.RADIO("SVG", "renderer", {action: MENU.Renderer}),
ITEM.RULE(),
ITEM.CHECKBOX("Fast Preview", "CHTMLpreview")
ITEM.CHECKBOX("Fast Preview", "FHTMLpreview")
),
ITEM.SUBMENU("MathPlayer", {hidden:!HUB.Browser.isMSIE || !CONFIG.showMathPlayer,
disabled:!HUB.Browser.hasMathPlayer},

View File

@ -84,12 +84,12 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
this.SVGsaveData(svg);
return svg;
},
toCommonHTML: function (span) {
span = this.CHTMLcreateSpan(span);
this.CHTMLhandleStyle(span);
this.CHTMLhandleColor(span);
this.CHTMLaddChild(span,this.choice(),{});
return span;
toCommonHTML: function (node) {
node = this.CHTMLcreateNode(node);
this.CHTMLhandleStyle(node);
this.CHTMLhandleColor(node);
this.CHTMLaddChild(node,this.choice(),{});
return node;
}
});

View File

@ -303,17 +303,23 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
//
FinishAtom: function (force) {
if (this.sup || this.sub || this.presup || this.presub) {
if (!this.atom && this.tex === "" && !force) {
this.presup = this.sup, this.presub = this.sub; // save for later
this.sub = this.sup = "";
return;
if (!force && !this.atom) {
if (this.tex === "" && !this.sup && !this.sub) return;
if (!this.presup && !this.presub &&
(this.tex === "" || this.tex === "{" ||
(this.tex === "}" && this.TEX.substr(-1) === "{"))) {
this.presup = this.sup, this.presub = this.sub; // save for later
this.sub = this.sup = "";
this.TEX += this.tex; this.tex = "";
return;
}
}
if (this.sub && !this.sup) {this.sup = "\\Space{0pt}{0pt}{.2em}"} // forces subscripts to align properly
if ((this.presup || this.presub) && this.tex !== "{") {
if (!this.presup && !this.sup) {this.presup = "\\Space{0pt}{0pt}{.2em}"}
this.tex = "\\CEprescripts{"+(this.presub||"\\CEnone")+"}{"+(this.presup||"\\CEnone")+"}"
+ "{"+(this.tex !== "}" ? this.tex : "")+"}"
+" {"+(this.sub||"\\CEnone")+"}{"+(this.sup||"\\CEnone")+"}"
+ "{"+(this.sub||"\\CEnone")+"}{"+(this.sup||"\\CEnone")+"}"
+ (this.tex === "}" ? "}" : "");
this.presub = this.presup = "";
} else {

View File

@ -264,6 +264,7 @@ MathJax.ElementJax.mml.Augment({
noInheritAttribute: {
texClass: true
},
getRemoved: {},
linebreakContainer: false,
Init: function () {
@ -312,6 +313,7 @@ MathJax.ElementJax.mml.Augment({
var obj = this.inherit; var root = obj;
while (obj) {
var value = obj[name]; if (value == null && obj.attr) {value = obj.attr[name]}
if (obj.removedStyles && obj.getRemoved[name] && value == null) value = obj.removedStyles[obj.getRemoved[name]];
if (value != null && obj.noInheritAttribute && !obj.noInheritAttribute[name]) {
var noInherit = obj.noInherit[this.type];
if (!(noInherit && noInherit[name])) {return value}
@ -399,6 +401,13 @@ MathJax.ElementJax.mml.Augment({
isEmbellished: function () {return false},
Core: function () {return this},
CoreMO: function () {return this},
childIndex: function(child) {
if (child == null) return;
for (var i = 0, m = this.data.length; i < m; i++) if (child === this.data[i]) return i;
},
CoreIndex: function () {
return (this.inferRow ? this.data[0]||this : this).childIndex(this.Core());
},
hasNewline: function () {
if (this.isEmbellished()) {return this.CoreMO().hasNewline()}
if (this.isToken || this.linebreakContainer) {return false}
@ -915,9 +924,7 @@ MathJax.ElementJax.mml.Augment({
if (level == null) {
level = this.Get("scriptlevel");
} else if (String(level).match(/^ *[-+]/)) {
delete this.scriptlevel;
var LEVEL = this.Get("scriptlevel");
this.scriptlevel = level;
var LEVEL = this.Get("scriptlevel",null,true);
level = LEVEL + parseInt(level);
}
return level;
@ -927,6 +934,7 @@ MathJax.ElementJax.mml.Augment({
mpadded: {width: true, height: true, depth: true, lspace: true, voffset: true},
mtable: {width: true, height: true, depth: true, align: true}
},
getRemoved: {fontfamily:"fontFamily", fontweight:"fontWeight", fontstyle:"fontStyle", fontsize:"fontSize"},
setTeXclass: MML.mbase.setChildTeXclass
});
@ -991,7 +999,7 @@ MathJax.ElementJax.mml.Augment({
//
// Clear flag for using MML spacing even though form is specified
//
this.data.open.useMMLspacing &= ~this.data.open.SPACE_ATTR.form;
this.data.open.useMMLspacing = 0;
}
//
// Create fake nodes for the separators
@ -1000,8 +1008,10 @@ MathJax.ElementJax.mml.Augment({
while (values.separators.length < this.data.length)
{values.separators += values.separators.charAt(values.separators.length-1)}
for (var i = 1, m = this.data.length; i < m; i++) {
if (this.data[i])
{this.SetData("sep"+i,MML.mo(values.separators.charAt(i-1)).With({separator:true}))}
if (this.data[i]) {
this.SetData("sep"+i,MML.mo(values.separators.charAt(i-1)).With({separator:true}))
this.data["sep"+i].useMMLspacing = 0;
}
}
}
//
@ -1014,7 +1024,7 @@ MathJax.ElementJax.mml.Augment({
//
// Clear flag for using MML spacing even though form is specified
//
this.data.close.useMMLspacing &= ~this.data.close.SPACE_ATTR.form;
this.data.close.useMMLspacing = 0;
}
},
texClass: MML.TEXCLASS.OPEN,

View File

@ -0,0 +1,60 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/output/CommonHTML/autoload/annotation-xm;l.js
*
* Implements the CommonHTML output for <annotation-xml> elements.
*
* ---------------------------------------------------------------------
*
* Copyright (c) 2015 The MathJax Consortium
*
* 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.
*/
MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
var VERSION = "2.5.0";
var MML = MathJax.ElementJax.mml,
CHTML = MathJax.OutputJax.CommonHTML;
MML["annotation-xml"].Augment({
toCommonHTML: function (node) {
var encoding = this.Get("encoding");
node = this.CHTMLdefaultNode(node,{childOptions:{encoding:encoding}});
if (this.CHTML.rscale !== 1) this.CHTML.rescale(1/this.CHTML.rscale);
return node;
}
});
MML.xml.Augment({
toCommonHTML: function (node,options) {
var bbox = this.CHTML = CHTML.BBOX.zero();
for (var i = 0, m = this.data.length; i < m; i++)
{node.appendChild(this.data[i].cloneNode(true))}
//
// Warning: causes reflow
//
var w = node.offsetWidth, h = node.offsetHeight;
var strut = CHTML.addElement(node,"mjx-hd-test",{style:{height:h+"px"}});
bbox.d = bbox.b = (node.offsetHeight - h)/CHTML.em;
bbox.w = bbox.r = w/CHTML.em; bbox.h = bbox.t = h/CHTML.em - bbox.d;
node.removeChild(strut);
}
});
MathJax.Hub.Startup.signal.Post("CommonHTML annotation-xml Ready");
MathJax.Ajax.loadComplete(CHTML.autoloadDir+"/annotation-xml.js");
});

View File

@ -0,0 +1,179 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/output/CommonHTML/autoload/maction.js
*
* Implements the CommonHTML output for <maction> elements.
*
* ---------------------------------------------------------------------
*
* Copyright (c) 2015 The MathJax Consortium
*
* 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.
*/
MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
var VERSION = "2.5.1";
var MML = MathJax.ElementJax.mml,
HTML = MathJax.HTML,
CHTML = MathJax.OutputJax.CommonHTML;
var currentTip, hover, clear;
//
// Add configuration for tooltips
//
var CONFIG = CHTML.config.tooltip = MathJax.Hub.Insert({
delayPost: 600, delayClear: 600,
offsetX: 10, offsetY: 5
},CHTML.config.tooltip||{});
MML.maction.Augment({
CHTMLtooltip: CHTML.addElement(document.body,"div",{id:"MathJax_CHTML_Tooltip"}),
toCommonHTML: function (node) {
var selected = this.Get("selection");
node = this.CHTMLcreateNode(node);
this.CHTML = CHTML.BBOX.empty();
this.CHTMLhandleStyle(node);
this.CHTMLhandleScale(node);
this.CHTMLaddChild(node,selected-1,{});
this.CHTML.clean();
this.CHTMLhandleSpace(node);
this.CHTMLhandleBBox(node);
this.CHTMLhandleColor(node);
var type = this.Get("actiontype");
if (this.CHTMLaction[type] && this.CHTMLaction.hasOwnProperty(type))
this.CHTMLaction[type].call(this,node,selected);
return node;
},
CHTMLcoreNode: function (node) {return this.CHTMLchildNode(node,0)},
//
// Implementations for the various actions
//
CHTMLaction: {
toggle: function (node,selection) {
this.selection = selection;
node.onclick = MathJax.Callback(["CHTMLclick",this,CHTML.jax]);
node.style.cursor = "pointer";
},
statusline: function (node,selection) {
node.onmouseover = MathJax.Callback(["CHTMLsetStatus",this]);
node.onmouseout = MathJax.Callback(["CHTMLclearStatus",this]);
node.onmouseover.autoReset = node.onmouseout.autoReset = true;
},
tooltip: function(node,selection) {
if (this.data[1] && this.data[1].isToken) {
node.title = node.alt = this.data[1].data.join("");
} else {
node.onmouseover = MathJax.Callback(["CHTMLtooltipOver",this,CHTML.jax]);
node.onmouseout = MathJax.Callback(["CHTMLtooltipOut",this,CHTML.jax]);
node.onmouseover.autoReset = node.onmouseout.autoReset = true;
}
}
},
//
// Handle a click on the maction element
// (remove the original rendering and rerender)
//
CHTMLclick: function (jax,event) {
this.selection++;
if (this.selection > this.data.length) this.selection = 1;
var hover = !!jax.hover;
jax.Update();
if (hover) {
var span = document.getElementById(jax.inputID+"-Span");
MathJax.Extension.MathEvents.Hover.Hover(jax,span);
}
return MathJax.Extension.MathEvents.Event.False(event);
},
//
// Set/Clear the window status message
//
CHTMLsetStatus: function (event) {
// FIXME: Do something better with non-token elements
this.messageID = MathJax.Message.Set
((this.data[1] && this.data[1].isToken) ?
this.data[1].data.join("") : this.data[1].toString());
},
CHTMLclearStatus: function (event) {
if (this.messageID) MathJax.Message.Clear(this.messageID,0);
delete this.messageID;
},
//
// Handle tooltips
//
CHTMLtooltipOver: function (jax,event) {
if (!event) event = window.event;
if (clear) {clearTimeout(clear); clear = null}
if (hover) clearTimeout(hover);
var x = event.pageX; var y = event.pageY;
if (x == null) {
x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
y = event.clientY + document.body.scrollTop + document.documentElement.scrollTop;
}
var callback = MathJax.Callback(["CHTMLtooltipPost",this,jax,x+CONFIG.offsetX,y+CONFIG.offsetY])
hover = setTimeout(callback,CONFIG.delayPost);
},
CHTMLtooltipOut: function (jax,event) {
if (hover) {clearTimeout(hover); hover = null}
if (clear) clearTimeout(clear);
var callback = MathJax.Callback(["CHTMLtooltipClear",this,80]);
clear = setTimeout(callback,CONFIG.delayClear);
},
CHTMLtooltipPost: function (jax,x,y) {
hover = null; if (clear) {clearTimeout(clear); clear = null}
var tip = this.CHTMLtooltip;
tip.style.display = "block"; tip.style.opacity = "";
// tip.style.filter = CHTML.config.styles["#MathJax_CHTML_Tooltip"].filter;
if (this === currentTip) return;
tip.style.left = x+"px"; tip.style.top = y+"px";
tip.innerHTML = '<mjx-chtml><mjx-math></mjx-math></mjx-chtml>';
CHTML.getMetrics(jax);
try {this.data[1].toCommonHTML(tip.firstChild.firstChild)} catch(err) {
if (!err.restart) throw err;
tip.style.display = "none";
MathJax.Callback.After(["CHTMLtooltipPost",this,jax,x,y],err.restart);
return;
}
currentTip = this;
},
CHTMLtooltipClear: function (n) {
var tip = this.CHTMLtooltip;
if (n <= 0) {
tip.style.display = "none";
tip.style.opacity = tip.style.filter = "";
clear = null;
} else {
tip.style.opacity = n/100;
tip.style.filter = "alpha(opacity="+n+")";
clear = setTimeout(MathJax.Callback(["CHTMLtooltipClear",this,n-20]),50);
}
}
});
MathJax.Hub.Startup.signal.Post("CommonHTML maction Ready");
MathJax.Ajax.loadComplete(CHTML.autoloadDir+"/maction.js");
});

View File

@ -0,0 +1,311 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/output/CommonHTML/autoload/menclose.js
*
* Implements the CommonHTML output for <menclose> elements.
*
* ---------------------------------------------------------------------
*
* Copyright (c) 2015 The MathJax Consortium
*
* 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.
*/
MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
var VERSION = "2.5.0";
var MML = MathJax.ElementJax.mml,
HTML = MathJax.HTML,
CHTML = MathJax.OutputJax.CommonHTML;
var SVGNS = "http://www.w3.org/2000/svg";
var ARROWX = 4, ARROWDX = 1, ARROWY = 2;
MML.menclose.Augment({
toCommonHTML: function (node) {
var values = this.getValues("notation","thickness","padding");
if (values.thickness == null) values.thickness = ".075em";
if (values.padding == null) values.padding = ".2em";
//
// Get DOM nodes
//
node = this.CHTMLdefaultNode(node,{childNodes:"mjx-box", forceChild:true});
var child = node.firstChild, cbox = this.CHTMLbboxFor(0);
//
// Get the padding and rule thickness
//
var p = this.CHTMLlength2em(values.padding,1/CHTML.em); // padding for enclosure
var t = this.CHTMLlength2em(values.thickness,1/CHTML.em); // thickness of lines
t = Math.max(1,Math.round(t*CHTML.em))/CHTML.em;
var SOLID = CHTML.Px(t)+" solid";
var bb = {L:p, R:p, T:p, B:p, H:cbox.h+p, D:cbox.d+p, W:cbox.w+2*p};
child.style.padding = CHTML.Em(p);
//
// Eliminate duplicate notations.
//
var notations = MathJax.Hub.SplitList(values.notation), notation = {};
for (var i = 0, m = notations.length; i < m; i++) notation[notations[i]] = true;
if (notation[MML.NOTATION.UPDIAGONALARROW]) delete notation[MML.NOTATION.UPDIAGONALSTRIKE];
//
// Add the needed notations
//
for (var n in notation) {
if (notation.hasOwnProperty(n)) {
if (this.CHTMLnotation[n] && this.CHTMLnotation.hasOwnProperty(n))
this.CHTMLnotation[n].call(this,child,cbox,bb,p,t,SOLID);
}
}
//
// Adjust the bounding box
//
var BBOX = this.CHTML;
BBOX.w += bb.L + bb.R; BBOX.r += BBOX.L; if (BBOX.w > BBOX.r) BBOX.r = BBOX.w;
BBOX.h += bb.T; if (BBOX.h > BBOX.t) BBOX.t = BBOX.h;
BBOX.d += bb.B; if (BBOX.d > BBOX.b) BBOX.b = BBOX.d;
return node;
},
//
// The various notations and their implementations
//
CHTMLnotation: {
/********************************************************/
box: function (child,cbox,bb,p,t,SOLID) {
p -= t;
child.style.padding = CHTML.Em(p);
child.style.border = SOLID;
},
/********************************************************/
roundedbox: function (child,cbox,bb,p,t,SOLID) {
var r = Math.min(cbox.w,cbox.h+cbox.d+2*p)/4;
CHTML.addElement(child.parentNode,"mjx-box",{
style: {
padding:CHTML.Em(p-t), border:SOLID, "border-radius":CHTML.Em(r),
height:CHTML.Em(cbox.h+cbox.d), "vertical-align":CHTML.Em(-bb.D),
width:CHTML.Em(cbox.w), "margin-left":CHTML.Em(-bb.W)
}
});
},
/********************************************************/
circle: function (child,cbox,bb,p,t,SOLID) {
var H = bb.H, D = bb.D, W = bb.W;
svg = this.CHTMLsvg(child,bb,t);
this.CHTMLsvgElement(svg.firstChild,"ellipse",{
rx:CHTML.Px(W/2-t/2), ry:CHTML.Px((H+D)/2-t/2),
cx:CHTML.Px(W/2), cy:CHTML.Px((H+D)/2)
});
},
/********************************************************/
left: function (child,cbox,bb,p,t,SOLID) {
child.style.borderLeft = SOLID;
child.style.paddingLeft = CHTML.Em(p-t);
},
/********************************************************/
right: function (child,cbox,bb,p,t,SOLID) {
child.style.borderRight = SOLID;
child.style.paddingRight = CHTML.Em(p-t);
},
/********************************************************/
top: function (child,cbox,bb,p,t,SOLID) {
child.style.borderTop = SOLID;
child.style.paddingTop = CHTML.Em(p-t);
},
/********************************************************/
bottom: function (child,cbox,bb,p,t,SOLID) {
child.style.borderBottom = SOLID;
child.style.paddingBottom = CHTML.Em(p-t);
},
/********************************************************/
actuarial: function (child,cbox,bb,p,t,SOLID) {
child.style.borderTop = child.style.borderRight = SOLID;
child.style.paddingTop = child.style.paddingRight = CHTML.Em(p-t);
},
/********************************************************/
madruwb: function (child,cbox,bb,p,t,SOLID) {
child.style.borderBottom = child.style.borderRight = SOLID;
child.style.paddingBottom = child.style.paddingRight = CHTML.Em(p-t);
},
/********************************************************/
verticalstrike: function (child,cbox,bb,p,t,SOLID) {
CHTML.addElement(child.parentNode,"mjx-box",{
style: {
"border-left":SOLID,
height:CHTML.Em(bb.H+bb.D), "vertical-align":CHTML.Em(-bb.D),
width:CHTML.Em(cbox.w/2+p-t/2), "margin-left":CHTML.Em(-cbox.w/2-p-t/2)
}
});
},
/********************************************************/
horizontalstrike: function (child,cbox,bb,p,t,SOLID) {
CHTML.addElement(child.parentNode,"mjx-box",{
style: {
"border-top":SOLID,
height:CHTML.Em((bb.H+bb.D)/2-t/2), "vertical-align":CHTML.Em(-bb.D),
width:CHTML.Em(bb.W), "margin-left":CHTML.Em(-bb.W)
}
});
},
/********************************************************/
updiagonalstrike: function (child,cbox,bb,p,t,SOLID) {
var H = bb.H, D = bb.D, W = bb.W;
svg = this.CHTMLsvg(child,bb,t);
this.CHTMLsvgElement(svg.firstChild,"line",{
x1:CHTML.Px(t/2), y1:CHTML.Px(H+D-t), x2:CHTML.Px(W-t), y2:CHTML.Px(t/2)
});
},
/********************************************************/
downdiagonalstrike: function (child,cbox,bb,p,t,SOLID) {
var H = bb.H, D = bb.D, W = bb.W;
svg = this.CHTMLsvg(child,bb,t);
this.CHTMLsvgElement(svg.firstChild,"line",{
x1:CHTML.Px(t/2), y1:CHTML.Px(t/2), x2:CHTML.Px(W-t), y2:CHTML.Px(H+D-t)
});
},
/********************************************************/
updiagonalarrow: function (child,cbox,bb,p,t,SOLID) {
var H = bb.H + bb.D - t, W = bb.W - t/2;
var a = Math.atan2(H,W)*(-180/Math.PI).toFixed(3);
var R = Math.sqrt(H*H + W*W);
svg = this.CHTMLsvg(child,bb,t);
var g = this.CHTMLsvgElement(svg.firstChild,"g",{
fill:"currentColor",
transform:"translate("+this.CHTMLpx(t/2)+" "+this.CHTMLpx(H+t/2)+") rotate("+a+")"
});
var x = t * ARROWX, dx = t * ARROWDX, y = t * ARROWY;
this.CHTMLsvgElement(g,"line",{
x1:CHTML.Px(t/2), y1:0, x2:CHTML.Px(R-x), y2:0
});
this.CHTMLsvgElement(g,"path",{
d: "M "+this.CHTMLpx(R-x)+",0 " +
"L "+this.CHTMLpx(R-x-dx)+","+this.CHTMLpx(y) +
"L "+this.CHTMLpx(R)+",0 " +
"L "+this.CHTMLpx(R-x-dx)+","+this.CHTMLpx(-y),
stroke:"none"
});
},
/********************************************************/
phasorangle: function (child,cbox,bb,p,t,SOLID) {
var P = p, H = bb.H, D = bb.D, p = (H+D)/2, W = bb.W + p - P; bb.W = W; bb.L = p;
child.style.margin = "0 0 0 "+CHTML.Em(p-P);
svg = this.CHTMLsvg(child,bb,t);
this.CHTMLsvgElement(svg.firstChild,"path",{
d: "M "+this.CHTMLpx(p)+",1 " +
"L 1,"+this.CHTMLpx(H+D-t)+" L "+this.CHTMLpx(W)+","+this.CHTMLpx(H+D-t)
});
},
/********************************************************/
longdiv: function (child,cbox,bb,p,t,SOLID) {
bb.W += 1.5*p; bb.L += 1.5*p;
var H = bb.H, D = bb.D, W = bb.W;
child.style.margin = "0 0 0 "+CHTML.Em(1.5*p);
svg = this.CHTMLsvg(child,bb,t);
this.CHTMLsvgElement(svg.firstChild,"path",{
d: "M "+this.CHTMLpx(W)+",1 L 1,1 "+
"a"+this.CHTMLpx(p)+","+this.CHTMLpx((H+D)/2-t/2)+" 0 0,1 1,"+this.CHTMLpx(H+D-1.5*t)
});
},
/********************************************************/
radical: function (child,cbox,bb,p,t,SOLID) {
bb.W += 1.5*p; bb.L += 1.5*p;
var H = bb.H, D = bb.D, W = bb.W;
child.style.margin = "0 0 0 "+CHTML.Em(1.5*p);
svg = this.CHTMLsvg(child,bb,t);
this.CHTMLsvgElement(svg.firstChild,"path",{
d: "M 1,"+this.CHTMLpx(.6*(H+D)) +
" L "+this.CHTMLpx(p)+","+this.CHTMLpx(H+D) +
" L "+this.CHTMLpx(2*p)+",1 L "+this.CHTMLpx(W)+",1"
});
}
/********************************************************/
},
//
// Pixels with no "px"
//
CHTMLpx: function (m) {
m *= CHTML.em;
if (Math.abs(m) < .1) return "0";
return m.toFixed(1).replace(/\.0$/,"");
},
//
// Create the SVG element and position it over the
// contents
//
CHTMLsvg: function (node,bbox,t) {
if (!svg) {
var svg = document.createElementNS(SVGNS,"svg");
if (svg.style) {
svg.style.width = CHTML.Em(bbox.W);
svg.style.height = CHTML.Em(bbox.H+bbox.D);
svg.style.verticalAlign = CHTML.Em(-bbox.D);
svg.style.marginLeft = CHTML.Em(-bbox.W);
}
this.CHTMLsvgElement(svg,"g",{"stroke-width":CHTML.Px(t)});
node.parentNode.appendChild(svg);
}
return svg;
},
//
// Add an SVG element to the given svg node
//
CHTMLsvgElement: function (svg,type,def) {
var obj = document.createElementNS(SVGNS,type); obj.isMathJax = true;
if (def) {for (var id in def) {if (def.hasOwnProperty(id)) {obj.setAttributeNS(null,id,def[id].toString())}}}
svg.appendChild(obj);
return obj;
}
});
MathJax.Hub.Startup.signal.Post("CommonHTML menclose Ready");
MathJax.Ajax.loadComplete(CHTML.autoloadDir+"/menclose.js");
});

View File

@ -0,0 +1,94 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/output/CommonHTML/autoload/mglyph.js
*
* Implements the CommonHTML output for <mglyph> elements.
*
* ---------------------------------------------------------------------
*
* Copyright (c) 2015 The MathJax Consortium
*
* 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.
*/
MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
var VERSION = "2.5.0";
var MML = MathJax.ElementJax.mml,
CHTML = MathJax.OutputJax.CommonHTML,
LOCALE = MathJax.Localization;
MML.mglyph.Augment({
toCommonHTML: function (node,options) {
var values = this.getValues("src","width","height","valign","alt");
node = this.CHTMLcreateNode(node);
this.CHTMLhandleStyle(node);
this.CHTMLhandleScale(node);
if (values.src === "") {
var index = this.Get("index");
this.CHTMLgetVariant();
if (index && this.CHTMLvariant.style)
this.CHTMLhandleText(node,String.fromCharCode(index),this.CHTMLvariant);
} else {
var bbox = this.CHTML;
if (!bbox.img) bbox.img = MML.mglyph.GLYPH[values.src];
if (!bbox.img) {
bbox.img = MML.mglyph.GLYPH[values.src] = {img: new Image(), status: "pending"};
bbox.img.img.onload = MathJax.Callback(["CHTMLimgLoaded",this]);
bbox.img.img.onerror = MathJax.Callback(["CHTMLimgError",this]);
bbox.img.img.src = values.src;
MathJax.Hub.RestartAfter(bbox.img.img.onload);
}
if (bbox.img.status !== "OK") {
var err = MML.Error(LOCALE._(["MathML","BadMglyph"],"Bad mglyph: %1",values.src));
err.data[0].data[0].mathsize = "75%";
this.Append(err); err.toCommonHTML(node); this.data.pop();
bbox.combine(err.CHTML,0,0,1);
} else {
var img = CHTML.addElement(node,"img",{
isMathJax:true, src:values.src, alt:values.alt, title:values.alt
});
var w = bbox.img.img.width/CHTML.em, h = bbox.img.img.height/CHTML.em;
if (values.width !== "") img.style.width = CHTML.Em(this.CHTMLlength2em(values.width,w));
if (values.height !== "") img.style.height = CHTML.Em(this.CHTMLlength2em(values.height,h));
//
// Warning: causes page reflows
//
bbox.w = bbox.r = img.offsetWidth/CHTML.em; bbox.h = bbox.t = img.offsetHeight/CHTML.em;
if (values.valign) {
bbox.d = bbox.b = -this.CHTMLlength2em(values.valign,h);
img.style.verticalAlign = CHTML.Em(-bbox.d);
bbox.h -= bbox.d; bbox.t = bbox.h;
}
}
}
this.CHTMLhandleSpace(node);
this.CHTMLhandleBBox(node);
this.CHTMLhandleColor(node);
return node;
},
CHTMLimgLoaded: function (event,status) {
if (typeof(event) === "string") status = event;
this.CHTML.img.status = (status || "OK");
},
CHTMLimgError: function () {this.CHTML.img.img.onload("error")}
},{
GLYPH: {} // global list of all loaded glyphs
});
MathJax.Hub.Startup.signal.Post("CommonHTML mglyph Ready");
MathJax.Ajax.loadComplete(CHTML.autoloadDir+"/mglyph.js");
});

View File

@ -0,0 +1,291 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/output/CommonHTML/autoload/mmultiscripts.js
*
* Implements the CommonHTML output for <mmultiscripts> elements.
*
* ---------------------------------------------------------------------
*
* Copyright (c) 2015 The MathJax Consortium
*
* 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.
*/
MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
var VERSION = "2.5.0";
var MML = MathJax.ElementJax.mml,
HTML = MathJax.HTML,
CHTML = MathJax.OutputJax.CommonHTML;
MML.mmultiscripts.Augment({
toCommonHTML: function (node,stretch) {
if (!stretch) {
node = this.CHTMLcreateNode(node);
this.CHTMLhandleStyle(node);
this.CHTMLhandleScale(node);
this.CHTMLgetVariant();
}
CHTML.BBOX.empty(this.CHTML);
//
// Get base node
//
var base, bbox;
if (stretch) {
base = node.getElementsByTagName("mjx-base")[0];
} else {
this.CHTMLaddChild(node,0,{type:"mjx-base", noBBox:true, forceChild:true});
base = node.firstChild;
}
bbox = this.CHTMLbboxFor(0);
if (bbox.ic) {
bbox.R -= bbox.ic; // remove IC (added by mo and mi)
if (!stretch) base.style.marginRight = CHTML.Em(-bbox.ic);
delta = 1.3*bbox.ic + .05; // make faked IC be closer to expeted results
}
//
// Collect scripts into horizontal boxes and add them into the node
//
var BOX = {}, BBOX = {};
this.CHTMLgetScripts(BOX,BBOX,stretch,node);
var sub = BOX.sub, sup = BOX.sup, presub = BOX.presub, presup = BOX.presup;
var sbox = BBOX.sub, Sbox = BBOX.sup, pbox = BBOX.presub, Pbox = BBOX.presup;
if (!stretch) this.CHTMLaddBoxes(node,base,BOX);
//
// Get the initial values for the variables
//
var values = this.getValues("scriptlevel","scriptsizemultiplier");
var sscale = (this.Get("scriptlevel") < 3 ? values.scriptsizemultiplier : 1);
var ex = CHTML.TEX.x_height, s = CHTML.TEX.scriptspace;
var q = CHTML.TEX.sup_drop * sscale, r = CHTML.TEX.sub_drop * sscale;
var u = bbox.h - q, v = bbox.d + r, delta = 0, p;
var bmml = this.data[this.base];
if (bmml && (bmml.type === "mi" || bmml.type === "mo")) {
if (bmml.data.join("").length === 1 && bbox.rscale === 1 && !bbox.sH &&
!bmml.Get("largeop")) {u = v = 0}
}
values = this.getValues("displaystyle","subscriptshift","superscriptshift","texprimestyle");
values.subscriptshift = (values.subscriptshift === "" ? 0 : this.CHTMLlength2em(values.subscriptshift));
values.superscriptshift = (values.superscriptshift === "" ? 0 : this.CHTMLlength2em(values.superscriptshift));
var dx = (presub ? s+pbox.w : presup ? s+Pbox.w-delta : 0);
this.CHTML.combine(bbox,dx,0); var x = this.CHTML.w;
//
// Place the scripts as needed
//
if (!sup && !presup) {
v = Math.max(v,CHTML.TEX.sub1,values.subscriptshift);
if (sub) v = Math.max(v,sbox.h-(4/5)*ex);
if (presub) v = Math.max(v,pbox.h-(4/5)*ex);
if (sub) this.CHTMLplaceSubOnly(sub,sbox,x,v,s);
if (presub) this.CHTMLplacePresubOnly(presub,pbox,v,s);
} else {
if (!sub && !presub) {
p = CHTML.TEX[(values.displaystyle ? "sup1" : (values.texprimestyle ? "sup3" : "sup2"))];
u = Math.max(u,p,values.superscriptshift);
if (sup) u = Math.max(u,Sbox.d+(1/4)*ex);
if (presup) u = Math.max(u,Pbox.d+(1/4)*ex);
if (sup) this.CHTMLplaceSupOnly(sup,Sbox,x,delta,u,s);
if (presup) this.CHTMLplacePresupOnly(presup,Pbox,delta,u,s);
} else {
v = Math.max(v,CHTML.TEX.sub2);
var t = CHTML.TEX.rule_thickness;
var h = (sbox||pbox).h, d = (Sbox||Pbox).d;
if (presub) h = Math.max(h,pbox.h);
if (presup) d = Math.max(d,Pbox.d);
if ((u - d) - (h - v) < 3*t) {
v = 3*t - u + d + h; q = (4/5)*ex - (u - d);
if (q > 0) {u += q; v -= q}
}
u = Math.max(u,values.superscriptshift);
v = Math.max(v,values.subscriptshift);
if (sup) {
if (sub) {this.CHTMLplaceSubSup(sub,sbox,sup,Sbox,x,delta,u,v,s)}
else {this.CHTMLplaceSupOnly(sup,Sbox,x,delta,u,s)}
} else if (sub) {this.CHTMLplaceSubOnly(sub,sbox,x,v,s)}
if (presup) {
if (presub) {this.CHTMLplacePresubPresup(presub,pbox,presup,Pbox,delta,u,v,s)}
else {this.CHTMLplacePresupOnly(presup,Pbox,delta,u,s)}
} else if (presub) {this.CHTMLplacePresubOnly(presub,pbox,v,s)}
}
}
this.CHTML.clean();
this.CHTMLhandleSpace(node);
this.CHTMLhandleBBox(node);
this.CHTMLhandleColor(node);
return node;
},
//
// Get the subscript, superscript, presubscript, and presuperscript
// boxes, with proper spacing, and computer their bounding boxes.
//
CHTMLgetScripts: function (BOX,BBOX,stretch,node) {
if (stretch) {
BOX.sub = node.getElementsByTagName("mjx-sub")[0];
BOX.sup = node.getElementsByTagName("mjx-sup")[0];
BOX.presub = node.getElementsByTagName("mjx-presub")[0];
BOX.presup = node.getElementsByTagName("mjx-presup")[0];
BBOX.sub = this.CHTMLbbox.sub;
BBOX.sup = this.CHTMLbbox.sup;
BBOX.presub = this.CHTMLbbox.presub;
BBOX.presup = this.CHTMLbbox.presup;
return;
}
this.CHTMLbbox = BBOX; // save for when stretched
var state = {i:1, w:0, BOX:BOX, BBOX:BBOX}, m = this.data.length;
var sub = "sub", sup = "sup";
while (state.i < m) {
if ((this.data[state.i]||{}).type === "mprescripts") {
state.i++; state.w = 0;
sub = "presub"; sup = "presup";
} else {
var sbox = this.CHTMLaddScript(sub,state);
var Sbox = this.CHTMLaddScript(sup,state);
var w = Math.max((sbox ? sbox.rscale*sbox.w : 0),(Sbox ? Sbox.rscale*Sbox.w : 0));
this.CHTMLpadScript(sub,w,sbox,state);
this.CHTMLpadScript(sup,w,Sbox,state);
state.w += w;
}
}
if (BBOX.sub) BBOX.sub.clean();
if (BBOX.sup) BBOX.sup.clean();
if (BBOX.presub) BBOX.presub.clean();
if (BBOX.presup) BBOX.presup.clean();
},
//
// Add a script to the proper box, creating the box if needed,
// and padding the box to account for any <none/> elements.
// Return the bounding box for the script for later use.
//
CHTMLaddScript: function (type,state) {
var BOX, BBOX, data = this.data[state.i];
if (data && data.type !== "none" && data.type !== "mprescripts") {
BOX = state.BOX[type];
if (!BOX) {
BOX = state.BOX[type] = CHTML.Element("mjx-"+type);
BBOX = state.BBOX[type] = CHTML.BBOX.empty();
if (state.w) {
BOX.style.paddingLeft = CHTML.Em(state.w);
BBOX.w = BBOX.r = state.w;
}
}
data.toCommonHTML(BOX);
BBOX = data.CHTML;
}
if (data && data.type !== "mprescripts") state.i++;
return BBOX;
},
//
// Add padding to the script box to make match the width of the
// super- or subscript that is above or below it, and adjust the
// bounding box for the script row. If these are pre-scripts,
// right-justify the scripts, otherwise, left-justify them.
//
CHTMLpadScript: function (type,w,bbox,state) {
if (!bbox) bbox = {w:0, fake:1};
var BBOX = state.BBOX[type], dx = 0, dw = 0;
if (BBOX) {
if (bbox.rscale*bbox.w < w) {
var BOX = state.BOX[type]; dw = w-bbox.rscale*bbox.w;
var space = CHTML.Element("mjx-spacer",{style:{width:CHTML.Em(dw)}});
if (type.substr(0,3) === "pre" && !bbox.fake) {
BOX.insertBefore(space,BOX.lastChild);
dx = dw; dw = 0;
} else {
BOX.appendChild(space);
}
}
if (bbox.fake) {BBOX.w += dx} else {BBOX.combine(bbox,BBOX.w+dx,0)}
BBOX.w += dw;
}
},
//
// Add the boxes into the main node, creating stacks when needed
//
CHTMLaddBoxes: function (node,base,BOX) {
var sub = BOX.sub, sup = BOX.sup, presub = BOX.presub, presup = BOX.presup;
if (presub && presup) {
var prestack = CHTML.Element("mjx-prestack"); node.insertBefore(prestack,base);
prestack.appendChild(presup); prestack.appendChild(presub);
} else {
if (presub) node.insertBefore(presub,base);
if (presup) node.insertBefore(presup,base);
}
if (sub && sup) {
var stack = CHTML.addElement(node,"mjx-stack");
stack.appendChild(sup); stack.appendChild(sub);
} else {
if (sub) node.appendChild(sub);
if (sup) node.appendChild(sup);
}
},
//
// Handle positioning the various scripts
//
CHTMLplaceSubOnly: function (sub,sbox,x,v,s) {
sub.style.verticalAlign = CHTML.Em(-v);
sub.style.marginRight = CHTML.Em(s); sbox.w += s;
this.CHTML.combine(sbox,x,-v);
},
CHTMLplaceSupOnly: function (sup,Sbox,x,delta,u,s) {
sup.style.verticalAlign = CHTML.Em(u);
sup.style.paddingLeft = CHTML.Em(delta);
sup.style.paddingRight = CHTML.Em(s); Sbox.w += s;
this.CHTML.combine(Sbox,x+delta,u);
},
CHTMLplaceSubSup: function (sub,sbox,sup,Sbox,x,delta,u,v,s) {
sub.style.paddingRight = CHTML.Em(s); sbox.w += s;
sup.style.paddingBottom = CHTML.Em(u+v-Sbox.d-sbox.h);
sup.style.paddingLeft = CHTML.Em(delta);
sup.style.paddingRight = CHTML.Em(s); Sbox.w += s;
sup.parentNode.style.verticalAlign = CHTML.Em(-v);
this.CHTML.combine(sbox,x,-v);
this.CHTML.combine(Sbox,x+delta,u);
},
CHTMLplacePresubOnly: function (presub,pbox,v,s) {
presub.style.verticalAlign = CHTML.Em(-v);
presub.style.marginLeft = CHTML.Em(s);
this.CHTML.combine(pbox,s,-v);
},
CHTMLplacePresupOnly: function (presup,Pbox,delta,u,s) {
presup.style.verticalAlign = CHTML.Em(u);
presup.style.paddingLeft = CHTML.Em(s);
presup.style.paddingRight = CHTML.Em(-delta);
this.CHTML.combine(Pbox,s,u);
},
CHTMLplacePresubPresup: function (presub,pbox,presup,Pbox,delta,u,v,s) {
presub.style.paddingLeft = CHTML.Em(s);
presup.style.paddingBottom = CHTML.Em(u+v-Pbox.d-pbox.h);
presup.style.paddingLeft = CHTML.Em(delta+s);
presup.style.paddingRight = CHTML.Em(-delta);
presup.parentNode.style.verticalAlign = CHTML.Em(-v);
this.CHTML.combine(pbox,s,-v);
this.CHTML.combine(Pbox,s+delta,u);
},
//
// Handle stretchy bases
//
CHTMLstretchH: MML.mbase.CHTMLstretchH,
CHTMLstretchV: MML.mbase.CHTMLstretchV
});
MathJax.Hub.Startup.signal.Post("CommonHTML mmultiscripts Ready");
MathJax.Ajax.loadComplete(CHTML.autoloadDir+"/mmultiscripts.js");
});

View File

@ -0,0 +1,73 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/output/CommonHTML/autoload/ms.js
*
* Implements the CommonHTML output for <ms> elements.
*
* ---------------------------------------------------------------------
*
* Copyright (c) 2015 The MathJax Consortium
*
* 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.
*/
MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
var VERSION = "2.5.0";
var MML = MathJax.ElementJax.mml,
CHTML = MathJax.OutputJax.CommonHTML;
MML.ms.Augment({
toCommonHTML: function (node) {
//
// Create the node and handle its styles and scaling
// Get the variant and an empty bounding box
//
node = this.CHTMLcreateNode(node);
this.CHTMLhandleStyle(node);
this.CHTMLhandleScale(node);
this.CHTMLgetVariant();
CHTML.BBOX.empty(this.CHTML);
//
// Get the quotes to use
//
var values = this.getValues("lquote","rquote","mathvariant");
if (!this.hasValue("lquote") || values.lquote === '"') values.lquote = "\u201C";
if (!this.hasValue("rquote") || values.rquote === '"') values.rquote = "\u201D";
if (values.lquote === "\u201C" && values.mathvariant === "monospace") values.lquote = '"';
if (values.rquote === "\u201D" && values.mathvariant === "monospace") values.rquote = '"';
//
// Add the left quote, the child nodes, and the right quote
//
var text = values.lquote+this.data.join("")+values.rquote; // FIXME: handle mglyph?
this.CHTMLhandleText(node,text,this.CHTMLvariant);
//
// Finish the bbox, add any needed space and color
//
this.CHTML.clean();
this.CHTMLhandleSpace(node);
this.CHTMLhandleBBox(node);
this.CHTMLhandleColor(node);
//
// Return the completed node
//
return node;
}
});
MathJax.Hub.Startup.signal.Post("CommonHTML ms Ready");
MathJax.Ajax.loadComplete(CHTML.autoloadDir+"/ms.js");
});

View File

@ -0,0 +1,594 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/output/CommonHTML/autoload/mtable.js
*
* Implements the CommonHTML output for <mtable> elements.
*
* ---------------------------------------------------------------------
*
* Copyright (c) 2015 The MathJax Consortium
*
* 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.
*/
MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
var VERSION = "2.5.0";
var MML = MathJax.ElementJax.mml,
HTML = MathJax.HTML, CONFIG = MathJax.Hub.config,
CHTML = MathJax.OutputJax.CommonHTML,
SPLIT = MathJax.Hub.SplitList;
var LABEL = -1,
BIGDIMEN = 1000000;
MML.mtable.Augment({
toCommonHTML: function (node) {
//
// Create the table nodes and put them in a table
// (so that its bottom is on the baseline, rather than aligned on the top row)
//
var state = {rows:[], labels:[], labeled: false};
node = this.CHTMLdefaultNode(node,{noBBox:true, childOptions:state});
var table = CHTML.Element("mjx-table");
while (node.firstChild) table.appendChild(node.firstChild);
node.appendChild(table);
//
// Get the table attributes
//
var values = this.getValues("columnalign","rowalign","columnspacing","rowspacing",
"columnwidth","equalcolumns","equalrows",
"columnlines","rowlines","frame","framespacing",
"align","width","side","minlabelspacing","useHeight");
//
// Create the table
//
this.CHTMLgetBoxSizes(values,state);
this.CHTMLgetAttributes(values,state);
if (values.equalrows) {
state.HD = true;
state.HH = Math.max.apply(Math,state.H);
state.DD = Math.max.apply(Math,state.D);
}
this.CHTMLadjustCells(values,state);
if (values.frame) table.style.border = "1px "+values.frame;
this.CHTMLalignV(values,state,node);
this.CHTMLcolumnWidths(values,state,node);
this.CHTMLstretchCells(values,state);
if (state.labeled) this.CHTMLaddLabels(values,state,node,table);
//
// Set the bounding box (ignores overlapping outside of the table)
//
var BBOX = this.CHTML;
BBOX.w = BBOX.r = state.R;
BBOX.h = BBOX.t = state.T-state.B;
BBOX.d = BBOX.b = state.B;
if (!values.frame && !BBOX.pwidth) {
node.style.padding = "0 "+CHTML.Em(1/6);
BBOX.L = BBOX.R = 1/6;
}
//
// Add any needed space and color
//
this.CHTMLhandleSpace(node);
this.CHTMLhandleBBox(node);
this.CHTMLhandleColor(node);
//
// Return the completed node
//
return node;
},
//
// Get the natural height, depth, and widths of the rows and columns
//
CHTMLgetBoxSizes: function (values,state) {
var LH = CHTML.FONTDATA.lineH * values.useHeight,
LD = CHTML.FONTDATA.lineD * values.useHeight;
var H = [], D = [], W = [], J = -1;
for (var i = 0, m = this.data.length; i < m; i++) {
var row = this.data[i], s = (row.type === "mtr" ? 0 : LABEL);
H[i] = LH; D[i] = LD;
for (var j = s, M = row.data.length + s; j < M; j++) {
if (W[j] == null) {W[j] = -BIGDIMEN; if (j > J) J = j}
var cbox = row.data[j-s].CHTML;
if (cbox.h > H[i]) H[i] = cbox.h;
if (cbox.d > D[i]) D[i] = cbox.d;
if (cbox.w > W[j]) W[j] = cbox.w;
}
}
state.H = H; state.D = D; state.W = W, state.J = J;
},
//
// Pad the spacing and alignment attributes to match the size of the table
//
CHTMLgetAttributes: function (values,state) {
var CSPACE = SPLIT(values.columnspacing),
RSPACE = SPLIT(values.rowspacing),
CALIGN = SPLIT(values.columnalign),
RALIGN = SPLIT(values.rowalign),
CLINES = SPLIT(values.columnlines),
RLINES = SPLIT(values.rowlines),
CWIDTH = SPLIT(values.columnwidth),
RCALIGN = [], i, m, J = state.J, M = state.rows.length-1;
for (i = 0, m = CSPACE.length; i < m; i++) CSPACE[i] = this.CHTMLlength2em(CSPACE[i]);
for (i = 0, m = RSPACE.length; i < m; i++) RSPACE[i] = this.CHTMLlength2em(RSPACE[i]);
while (CSPACE.length < J) CSPACE.push(CSPACE[CSPACE.length-1]);
while (CALIGN.length <= J) CALIGN.push(CALIGN[CALIGN.length-1]);
while (CLINES.length < J) CLINES.push(CLINES[CLINES.length-1]);
while (CWIDTH.length <= J) CWIDTH.push(CWIDTH[CWIDTH.length-1]);
while (RSPACE.length < M) RSPACE.push(RSPACE[RSPACE.length-1]);
while (RALIGN.length <= M) RALIGN.push(RALIGN[RALIGN.length-1]);
while (RLINES.length < M) RLINES.push(RLINES[RLINES.length-1]);
CALIGN[LABEL] = (values.side.substr(0,1) === "l" ? "left" : "right");
//
// Override aligment data based on row-specific attributes
//
for (i = 0; i <= M; i++) {
var row = this.data[i]; RCALIGN[i] = [];
if (row.rowalign) RALIGN[i] = row.rowalign;
if (row.columnalign) {
RCALIGN[i] = SPLIT(row.columnalign);
while (RCALIGN[i].length <= J) RCALIGN[i].push(RCALIGN[i][RCALIGN[i].length-1]);
}
}
//
// Handle framespacing
//
var FSPACE = SPLIT(values.framespacing);
if (FSPACE.length != 2) FSPACE = SPLIT(this.defaults.framespacing);
FSPACE[0] = Math.max(0,this.CHTMLlength2em(FSPACE[0]));
FSPACE[1] = Math.max(0,this.CHTMLlength2em(FSPACE[1]));
if (values.columnlines.replace(/none/g,"").replace(/ /g,"") !== "" ||
values.rowlines.replace(/none/g,"").replace(/ /g,"") !== "") values.fspace = true;
//
// Pad arrays so that final column can be treated as all the others
//
if (values.frame === MML.LINES.NONE) delete values.frame; else values.fspace = true;
if (values.frame) {
FSPACE[0] = Math.max(0,FSPACE[0]);
FSPACE[1] = Math.max(0,FSPACE[1]);
}
if (values.fspace) {
CSPACE[J] = FSPACE[0]; RSPACE[M] = FSPACE[1];
} else {
CSPACE[J] = RSPACE[M] = 0;
}
CLINES[J] = RLINES[M] = MML.LINES.NONE;
//
// Save everything in the state
//
state.CSPACE = CSPACE; state.RSPACE = RSPACE;
state.CALIGN = CALIGN; state.RALIGN = RALIGN;
state.CLINES = CLINES; state.RLINES = RLINES;
state.CWIDTH = CWIDTH; state.RCALIGN = RCALIGN;
state.FSPACE = FSPACE;
},
//
// Add styles to cells to handle borders, spacing, alignment, etc.
//
CHTMLadjustCells: function(values,state) {
var ROWS = state.rows, H = state.H, D = state.D,
CSPACE = state.CSPACE, CLINES = state.CLINES,
RSPACE = state.RSPACE, RLINES = state.RLINES,
CALIGN = state.CALIGN, RALIGN = state.RALIGN,
RCALIGN = state.RCALIGN;
CSPACE[state.J] *= 2; RSPACE[ROWS.length-1] *= 2; // since halved below
var LH = CHTML.FONTDATA.lineH * values.useHeight,
LD = CHTML.FONTDATA.lineD * values.useHeight;
var T = "0", B, R, L, border, HD, cbox, align;
if (values.fspace) T = CHTML.Em(state.FSPACE[1]);
for (var i = 0, m = ROWS.length; i < m; i++) {
var row = ROWS[i], rdata = this.data[i];
//
// Space and borders between rows
//
B = RSPACE[i]/2; border = F = null; L = "0";
if (RLINES[i] !== MML.LINES.NONE) {
border = "1px "+RLINES[i];
B -= 1/CHTML.em/2;
}
B = CHTML.Em(Math.max(0,B));
//
// Frame space for initial cell
//
if (values.fspace) L = CHTML.Em(state.FSPACE[0]);
//
// The cells in the row
//
for (var j = 0, M = row.length; j < M; j++) {
var s = (rdata.type === "mtr" ? 0 : LABEL);
cell = row[j].style; cbox = rdata.data[j-s].CHTML;
//
// Space and borders between columns
//
R = CSPACE[j]/2;
if (CLINES[j] !== MML.LINES.NONE) {
cell.borderRight = "1px "+CLINES[j];
R -= 1/CHTML.em/2;
}
R = CHTML.Em(Math.max(0,R));
cell.padding = T+" "+R+" "+B+" "+L;
if (border) cell.borderBottom = border;
L = R;
//
// Handle vertical and horizontal alignment
//
align = (rdata.data[j-s].rowalign||this.data[i].rowalign||RALIGN[i]);
align = ({top:"top", bottom:"bottom", center:"middle"})[align];
if (align) cell.verticalAlign = align;
align = (rdata.data[j-s].columnalign||RCALIGN[i][j]||CALIGN[j]);
if (align !== MML.ALIGN.CENTER) cell.textAlign = align;
//
// Equal heights forced by adding an element of the proper size
// (setting style.height seems to work very strangely)
//
if (state.HD && j === 0) {
CHTML.addElement(row[j].parentNode,"mjx-mtd",{style:{padding:T+" 0 "+B}},
[["mjx-box",{style:{
height:CHTML.Em(state.HH+state.DD),
"vertical-align":CHTML.Em(-state.DD)
}}]]
);
}
//
// Pad cells that are too short
//
cell = row[j].firstChild.style;
if (cbox.h < LH) cell.marginTop = CHTML.Em(LH-cbox.h);
if (cbox.d < LD) cell.marginBottom = CHTML.Em(LD-cbox.d);
}
T = B;
}
CSPACE[state.J] /= 2; RSPACE[ROWS.length-1] /= 2; // back to normal
},
//
// Align the table vertically according to the align attribute
//
CHTMLalignV: function (values,state,node) {
var n, M = state.rows.length, H = state.H, D = state.D, RSPACE = state.RSPACE;
//
// Get alignment type and row number
//
if (typeof(values.align) !== "string") values.align = String(values.align);
if (values.align.match(/(top|bottom|center|baseline|axis)( +(-?\d+))?/)) {
n = parseInt(RegExp.$3||"0");
values.align = RegExp.$1
if (n < 0) n += state.rows.length + 1;
if (n > M || n <= 0) n = null;
} else {
values.align = this.defaults.align;
}
//
// Get table height and baseline offset
//
var T = 0, B = 0, a = CHTML.TEX.axis_height;
if (values.fspace) T += state.FSPACE[1];
if (values.frame) {T += 2/CHTML.em; B += 1/CHTML.em}
var h = state.HH, d = state.DD;
for (var i = 0; i < M; i++) {
if (!state.HD) {h = H[i]; d = D[i]}
T += h + d + RSPACE[i];
if (n) {
if (i === n-1) {
B += ({top:h+d, bottom:0, center:(h+d)/2,
baseline:d, axis:a+d})[values.align] + RSPACE[i];
}
if (i >= n) B += h + d + RSPACE[i];
}
}
if (!n) B = ({top:T, bottom:0, center:T/2, baseline:T/2, axis:T/2-a})[values.align];
//
// Place the node and save the values
//
if (B) node.style.verticalAlign = CHTML.Em(-B);
state.T = T; state.B = B;
},
//
// Determine column widths and set the styles for the columns
//
CHTMLcolumnWidths: function (values,state,node) {
var CWIDTH = state.CWIDTH, CSPACE = state.CSPACE, J = state.J, j;
var WW = 0, setWidths = false, relWidth = values.width.match(/%$/);
var i, m, w;
//
// Handle equal columns by adjusting the CWIDTH array
//
if (values.width !== "auto" && !relWidth) {
WW = Math.max(0,this.CHTMLlength2em(values.width,state.R));
setWidths = true;
}
if (values.equalcolumns) {
if (relWidth) {
//
// Use percent of total (not perfect, but best we can do)
//
var p = CHTML.Percent(1/(J+1));
for (j = 0; j <= J; j++) CWIDTH[j] = p;
} else {
//
// For width = auto, make all widths equal the widest,
// otherwise, for specific width, remove intercolumn space
// and divide by number of columns to get widest space.
//
w = Math.max.apply(Math,state.W);
if (values.width !== "auto") {
var S = (values.fspace ? state.FSPACE[0] + (values.frame ? 2/CHTML.em : 0) : 0);
for (j = 0; j <= J; j++) S += CSPACE[j];
w = Math.max((WW-S)/(J+1),w);
}
w = CHTML.Em(w);
for (j = 0; j <= J; j++) CWIDTH[j] = w;
}
setWidths = true;
}
//
// Compute natural table width
//
var TW = 0; if (values.fspace) TW = state.FSPACE[0];
var auto = [], fit = [], percent = [], W = [];
var row = state.rows[0];
for (j = 0; j <= J; j++) {
W[j] = state.W[j];
if (CWIDTH[j] === "auto") auto.push(j)
else if (CWIDTH[j] === "fit") fit.push(j)
else if (CWIDTH[j].match(/%$/)) percent.push(j)
else W[j] = this.CHTMLlength2em(CWIDTH[j],W[j]);
TW += W[j] + CSPACE[j];
if (row[j]) row[j].style.width = CHTML.Em(W[j]);
}
if (values.frame) TW += 2/CHTML.em;
var hasFit = (fit.length > 0);
//
// Adjust widths of columns
//
if (setWidths) {
if (relWidth) {
//
// Attach appropriate widths to the columns
//
for (j = 0; j <= J; j++) {
cell = row[j].style;
if (CWIDTH[j] === "auto" && !hasFit) cell.width = "";
else if (CWIDTH[j] === "fit") cell.width = "";
else if (CWIDTH[j].match(/%$/)) cell.width = CWIDTH[j];
else cell.minWidth = cell.maxWidth = cell.width;
}
} else {
//
// Compute percentage widths
//
if (WW > TW) {
var extra = 0;
for (i = 0, m = percent.length; i < m; i++) {
j = percent[i];
w = Math.max(W[j],this.CHTMLlength2em(CWIDTH[j],WW));
extra += w-W[j]; W[j] = w;
row[j].style.width = CHTML.Em(w);
}
TW += extra;
}
//
// Compute "fit" widths
//
if (!hasFit) fit = auto;
if (WW > TW && fit.length) {
var dw = (WW - TW) / fit.length;
for (i = 0, m = fit.length; i < m; i++) {
j = fit[i]; W[j] += dw;
row[j].style.width = CHTML.Em(W[j]);
}
TW = WW;
}
}
}
W[LABEL] = state.W[LABEL];
state.W = W;
state.R = TW;
//
// Set variable width on DOM nodes
//
if (relWidth) {
this.CHTML.pwidth = values.width; this.CHTML.mwidth = CHTML.Em(TW);
node.style.width = node.firstChild.style.width = "100%";
}
},
//
// Stretch any cells that can be stretched
//
CHTMLstretchCells: function (values,state) {
var ROWS = state.rows, H = state.H, D = state.D, W = state.W,
J = state.J, M = ROWS.length-1;
var h = state.HH, d = state.DD;
for (var i = 0; i <= M; i++) {
var row = ROWS[i], rdata = this.data[i];
if (!state.HD) {h = H[i]; d = D[i]}
for (var j = 0; j <= J; j++) {
var cell = row[j], cdata = rdata.data[j];
if (!cdata) continue;
if (cdata.CHTML.stretch === "V") cdata.CHTMLstretchV(h,d);
else if (cdata.CHTML.stretch === "H") cdata.CHTMLstretchH(cell,W[j]);
}
}
},
//
// Add labels to a table
//
CHTMLaddLabels: function (values,state,node,table) {
//
// Get indentation and alignment
//
var indent = this.getValues("indentalignfirst","indentshiftfirst","indentalign","indentshift");
if (indent.indentalignfirst !== MML.INDENTALIGN.INDENTALIGN) indent.indentalign = indent.indentalignfirst;
if (indent.indentalign === MML.INDENTALIGN.AUTO) indent.indentalign = CONFIG.displayAlign;
if (indent.indentshiftfirst !== MML.INDENTSHIFT.INDENTSHIFT) indent.indentshift = indent.indentshiftfirst;
if (indent.indentshift === "auto") indent.indentshift = "0";
var shift = this.CHTMLlength2em(indent.indentshift,CHTML.cwidth);
var labelspace = this.CHTMLlength2em(values.minlabelspacing,.8);
var labelW = labelspace + state.W[LABEL], labelshift = 0, tw = state.R;
var dIndent = this.CHTMLlength2em(CONFIG.displayIndent,CHTML.cwidth);
var s = (state.CALIGN[LABEL] === MML.INDENTALIGN.RIGHT ? -1 : 1);
if (indent.indentalign === MML.INDENTALIGN.CENTER) {
tw += 2 * (labelW - s*(shift + dIndent));
shift += dIndent;
} else if (state.CALIGN[LABEL] === indent.indentalign) {
if (dIndent < 0) {labelshift = s*dIndent; dIndent = 0}
shift += s*dIndent; if (labelW > s*shift) shift = s*labelW; shift += labelshift;
shift *= s; tw += shift;
} else {
tw += labelW - s*shift + dIndent;
shift -= s*dIndent; shift *= -s;
}
//
// Create boxes for table and labels
//
var box = CHTML.addElement(node,"mjx-box",{
style:{width:"100%","text-align":indent.indentalign}
}); box.appendChild(table);
var labels = CHTML.Element("mjx-stack");
table.style.display = "inline-table"; if (!table.style.width) table.style.width = "auto";
labels.style.verticalAlign = "top";
table.style.verticalAlign = CHTML.Em(state.T-state.B-state.H[0]);
node.style.verticalAlign = "";
if (shift) {
if (indent.indentalign === MML.INDENTALIGN.CENTER) {
table.style.marginLeft = CHTML.Em(shift);
table.style.marginRight = CHTML.Em(-shift);
} else {
var margin = "margin" + (indent.indentalign === MML.INDENTALIGN.RIGHT ? "Right" : "Left");
table.style[margin] = CHTML.Em(shift);
}
}
//
// Add labels on correct side
//
if (state.CALIGN[LABEL] === "left") {
node.insertBefore(labels,box);
labels.style.marginRight = CHTML.Em(-state.W[LABEL]-labelshift);
if (labelshift) labels.style.marginLeft = CHTML.Em(labelshift);
} else {
node.appendChild(labels);
labels.style.marginLeft = CHTML.Em(-state.W[LABEL]+labelshift);
}
//
// Vertically align the labels with their rows
//
var LABELS = state.labels, T = 0, H = state.H, D = state.D, RSPACE = state.RSPACE;
if (values.fspace) T = state.FSPACE[0] + (values.frame ? 1/CHTML.em : 0);
var h = state.HH, d = state.DD;
for (var i = 0, m = LABELS.length; i < m; i++) {
if (!state.HD) {h = H[i]; d = D[i]}
if (LABELS[i] && this.data[i].data[0]) {
labels.appendChild(LABELS[i]);
var lbox = this.data[i].data[0].CHTML;
T += h - lbox.h;
if (T) LABELS[i].style.marginTop = CHTML.Em(T);
T = d - lbox.d;
} else {
T += h + d;
}
T += RSPACE[i];
}
//
// Propagate full-width equations, and reserve room for equation plus label
//
node.style.width = this.CHTML.pwidth = "100%";
node.style.minWidth = this.CHTML.mwidth = CHTML.Em(tw);
}
});
MML.mtr.Augment({
toCommonHTML: function (node,options) {
//
// Create the row node
//
node = this.CHTMLcreateNode(node);
this.CHTMLhandleStyle(node);
this.CHTMLhandleScale(node);
//
// Add a new row with no label
//
if (!options) options = {rows:[],labels:[]};
var row = []; options.rows.push(row);
options.labels.push(null);
//
// Add the cells to the row
//
for (var i = 0, m = this.data.length; i < m; i++)
row.push(this.CHTMLaddChild(node,i,options));
//
this.CHTMLhandleColor(node);
return node;
}
});
MML.mlabeledtr.Augment({
toCommonHTML: function (node,options) {
//
// Create the row node
//
node = this.CHTMLcreateNode(node);
this.CHTMLhandleStyle(node);
this.CHTMLhandleScale(node);
//
// Add a new row, and get the label
//
if (!options) options = {rows:[],labels:[]};
var row = []; options.rows.push(row);
var label = CHTML.Element("mjx-label"); options.labels.push(label);
this.CHTMLaddChild(label,0,options);
options.labeled = true;
//
// Add the cells to the row
//
for (var i = 1, m = this.data.length; i < m; i++)
row.push(this.CHTMLaddChild(node,i,options));
//
this.CHTMLhandleColor(node);
return node;
}
});
MML.mtd.Augment({
toCommonHTML: function (node,options) {
node = this.CHTMLdefaultNode(node,options);
//
// Determine if this is stretchy or not
//
if (this.isEmbellished()) {
var mo = this.CoreMO(), BBOX = this.CHTML;
if (mo.CHTMLcanStretch("Vertical")) BBOX.stretch = "V";
else if (mo.CHTMLcanStretch("Horizontal")) BBOX.stretch = "H";
if (BBOX.stretch) {
var min = mo.Get("minsize",true);
if (min) {
if (BBOX.stretch === "V") {
var HD = BBOX.h + BBOX.d;
if (HD) {
var r = this.CHTMLlength2em(min,HD)/HD;
if (r > 1) {BBOX.h *= r; BBOX.d *= r}
}
} else {
BBOX.w = Math.max(BBOX.w,this.CHTMLlength2em(min,BBOX.w));
}
}
}
}
return node;
}
});
MathJax.Hub.Startup.signal.Post("CommonHTML mtable Ready");
MathJax.Ajax.loadComplete(CHTML.autoloadDir+"/mtable.js");
});

View File

@ -0,0 +1,776 @@
/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/output/CommonHTML/autoload/multiline.js
*
* Implements the CommonHTML output for <mrow>'s that contain line breaks.
*
* ---------------------------------------------------------------------
*
* Copyright (c) 2015 The MathJax Consortium
*
* 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.
*/
MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
var VERSION = "2.5.0";
var MML = MathJax.ElementJax.mml,
HTML = MathJax.HTML, CONFIG = MathJax.Hub.config,
CHTML = MathJax.OutputJax.CommonHTML;
//
// Penalties for the various line breaks
//
var PENALTY = {
newline: 0,
nobreak: 1000000,
goodbreak: [-200],
badbreak: [+200],
auto: [0],
toobig: 800,
nestfactor: 400,
spacefactor: -100,
spaceoffset: 2,
spacelimit: 1, // spaces larger than this get a penalty boost
fence: 500,
close: 500
};
var ENDVALUES = {linebreakstyle: "after"};
/**************************************************************************/
MML.mbase.Augment({
CHTMLlinebreakPenalty: PENALTY,
/****************************************************************/
//
// Handle breaking an mrow into separate lines
//
CHTMLmultiline: function (node) {
//
// Find the parent element and mark it as multiline
//
var parent = this;
while (parent.inferred || (parent.parent && parent.parent.type === "mrow" &&
parent.parent.data.length === 1)) {parent = parent.parent}
var isTop = ((parent.type === "math" && parent.Get("display") === "block") ||
parent.type === "mtd");
parent.isMultiline = true;
//
// Default values for the line-breaking parameters
//
var VALUES = this.getValues(
"linebreak","linebreakstyle","lineleading","linebreakmultchar",
"indentalign","indentshift",
"indentalignfirst","indentshiftfirst",
"indentalignlast","indentshiftlast"
);
if (VALUES.linebreakstyle === MML.LINEBREAKSTYLE.INFIXLINEBREAKSTYLE)
VALUES.linebreakstyle = this.Get("infixlinebreakstyle");
VALUES.lineleading = this.CHTMLlength2em(VALUES.lineleading,0.5);
//
// Break the math at its best line breaks
//
CHTML.BBOX.empty(this.CHTML);
var stack = CHTML.addElement(node,"mjx-stack");
var state = {
BBOX: this.CHTML,
n: 0, Y: 0,
scale: (this.CHTML.scale||1),
isTop: isTop,
values: {},
VALUES: VALUES
},
align = this.CHTMLgetAlign(state,{}),
shift = this.CHTMLgetShift(state,{},align),
start = [],
end = {
index:[], penalty:PENALTY.nobreak,
w:0, W:shift, shift:shift, scanW:shift,
nest: 0
},
broken = false;
while (this.CHTMLbetterBreak(end,state) &&
(end.scanW >= CHTML.linebreakWidth || end.penalty === PENALTY.newline)) {
this.CHTMLaddLine(stack,start,end.index,state,end.values,broken);
start = end.index.slice(0); broken = true;
align = this.CHTMLgetAlign(state,end.values);
shift = this.CHTMLgetShift(state,end.values,align);
end.W = end.shift = end.scanW = shift; end.penalty = PENALTY.nobreak;
}
state.isLast = true;
this.CHTMLaddLine(stack,start,[],state,ENDVALUES,broken);
node.style.width = stack.style.width = this.CHTML.pwidth = "100%";
this.CHTML.isMultiline = parent.CHTML.isMultiline = true;
stack.style.verticalAlign = CHTML.Em(state.d - this.CHTML.d);
return node;
},
/****************************************************************/
//
// Locate the next linebreak that is better than the current one
//
CHTMLbetterBreak: function (info,state) {
if (this.isToken) return false; // FIXME: handle breaking of token elements
if (this.isEmbellished()) {
info.embellished = this;
return this.CoreMO().CHTMLbetterBreak(info,state);
}
if (this.linebreakContainer) return false;
//
// Get the current breakpoint position and other data
//
var index = info.index.slice(0), i = info.index.shift(),
m = this.data.length, W, w, scanW, broken = (info.index.length > 0), better = false;
if (i == null) i = -1; if (!broken) {i++; info.W += info.w; info.w = 0}
scanW = info.scanW = info.W; info.nest++;
//
// Look through the line for breakpoints,
// (as long as we are not too far past the breaking width)
//
while (i < m && info.scanW < 1.33*CHTML.linebreakWidth) {
if (this.data[i]) {
if (this.data[i].CHTMLbetterBreak(info,state)) {
better = true; index = [i].concat(info.index); W = info.W; w = info.w;
if (info.penalty === PENALTY.newline) {
info.index = index;
if (info.nest) {info.nest--}
return true;
}
}
scanW = (broken ? info.scanW : this.CHTMLaddWidth(i,info,scanW));
}
info.index = []; i++; broken = false;
}
if (info.nest) {info.nest--}
info.index = index;
if (better) {info.W = W; info.w = w}
return better;
},
CHTMLaddWidth: function (i,info,scanW) {
if (this.data[i]) {
var node = this.data[i].CHTMLnodeElement(), bbox = this.data[i].CHTML;
scanW += bbox.w + (bbox.L||0) + (bbox.R||0);
info.W = info.scanW = scanW; info.w = 0;
}
return scanW;
},
/****************************************************************/
//
// Create a new line and move the required elements into it
// Position it using proper alignment and indenting
//
CHTMLaddLine: function (stack,start,end,state,values,broken) {
//
// Create a box for the line, with empty BBox
// fill it with the proper elements,
// and clean up the bbox
//
var block = CHTML.addElement(stack,"mjx-block",{},[["mjx-box"]]), line = block.firstChild;
var bbox = state.bbox = CHTML.BBOX.empty();
state.first = broken; state.last = true;
this.CHTMLmoveLine(start,end,line,state,values);
bbox.clean();
//
// Get the alignment and shift values
//
var align = this.CHTMLgetAlign(state,values),
shift = this.CHTMLgetShift(state,values,align,true);
//
// Set the Y offset based on previous depth, leading, and current height
//
var dY = 0;
if (state.n > 0) {
var LHD = CHTML.FONTDATA.baselineskip;
var leading = (state.values.lineleading == null ? state.VALUES : state.values).lineleading * state.scale;
var Y = state.Y;
state.Y -= Math.max(LHD,state.d + bbox.h + leading);
dY = Y - state.Y - state.d - bbox.h;
}
//
// Place the new line
//
if (shift) line.style.margin = "0 "+CHTML.Em(-shift)+" 0 "+CHTML.Em(shift);
if (align !== MML.INDENTALIGN.LEFT) block.style.textAlign = align;
if (dY) block.style.paddingTop = CHTML.Em(dY);
state.BBOX.combine(bbox,shift,state.Y);
//
// Save the values needed for the future
//
state.d = state.bbox.d; state.values = values; state.n++;
},
/****************************************************************/
//
// Get alignment and shift values from the given data
//
CHTMLgetAlign: function (state,values) {
var cur = values, prev = state.values, def = state.VALUES, align;
if (state.n === 0) align = cur.indentalignfirst || prev.indentalignfirst || def.indentalignfirst;
else if (state.isLast) align = prev.indentalignlast || def.indentalignlast;
else align = prev.indentalign || def.indentalign;
if (align === MML.INDENTALIGN.INDENTALIGN) align = prev.indentalign || def.indentalign;
if (align === MML.INDENTALIGN.AUTO) align = (state.isTop ? CONFIG.displayAlign : MML.INDENTALIGN.LEFT);
return align;
},
CHTMLgetShift: function (state,values,align,noadjust) {
var cur = values, prev = state.values, def = state.VALUES, shift;
if (state.n === 0) shift = cur.indentshiftfirst || prev.indentshiftfirst || def.indentshiftfirst;
else if (state.isLast) shift = prev.indentshiftlast || def.indentshiftlast;
else shift = prev.indentshift || def.indentshift;
if (shift === MML.INDENTSHIFT.INDENTSHIFT) shift = prev.indentshift || def.indentshift;
if (shift === "auto" || shift === "") shift = "0";
shift = this.CHTMLlength2em(shift,CHTML.cwidth);
if (state.isTop && CONFIG.displayIndent !== "0") {
var indent = this.CHTMLlength2em(CONFIG.displayIndent,CHTML.cwidth);
shift += (align === MML.INDENTALIGN.RIGHT ? -indent : indent);
}
return (align === MML.INDENTALIGN.RIGHT && !noadjust ? -shift : shift);
},
/****************************************************************/
//
// Move the selected elements into the new line's box,
// moving whole items when possible, and parts of ones
// that are split by a line break.
//
CHTMLmoveLine: function (start,end,node,state,values) {
var i = start[0], j = end[0];
if (i == null) i = -1; if (j == null) j = this.data.length-1;
if (i === j && start.length > 1) {
//
// If starting and ending in the same element move the subpiece to the new line
//
this.data[i].CHTMLmoveSlice(start.slice(1),end.slice(1),node,state,values,"marginLeft");
} else {
//
// Otherwise, move the remainder of the initial item
// and any others up to the last one
//
var last = state.last; state.last = false;
while (i < j) {
if (this.data[i]) {
if (start.length <= 1) this.data[i].CHTMLmoveNode(node,state,values);
else this.data[i].CHTMLmoveSlice(start.slice(1),[],node,state,values,"marginLeft");
}
i++; state.first = false; start = [];
}
//
// If the last item is complete, move it,
// otherwise move the first part of it up to the split
//
state.last = last;
if (this.data[i]) {
if (end.length <= 1) this.data[i].CHTMLmoveNode(node,state,values);
else this.data[i].CHTMLmoveSlice([],end.slice(1),node,state,values,"marginRight");
}
}
},
/****************************************************************/
//
// Split an element and copy the selected items into the new part
//
CHTMLmoveSlice: function (start,end,node,state,values,margin) {
//
// Create a new box for the slice of the element
// Move the selected portion into the slice
// If it is the last slice
// Remove the original (now empty) node
// Rename the Continue-0 node with the original name (for CHTMLnodeElement)
//
var slice = this.CHTMLcreateSliceNode(node);
this.CHTMLmoveLine(start,end,slice,state,values);
if (slice.style[margin]) slice.style[margin] = "";
if (this.CHTML.L) {
if (margin !== "marginLeft") state.bbox.w += this.CHTML.L;
else slice.className = slice.className.replace(/ MJXc-space\d/,"");
}
if (this.CHTML.R && margin !== "marginRight") state.bbox.w += this.CHTML.R;
if (end.length === 0) {
node = this.CHTMLnodeElement();
node.parentNode.removeChild(node);
node.nextMathJaxNode.id = node.id;
}
return slice;
},
/****************************************************************/
//
// Create a new node for an element that is split in two
// Clone the original and update its ID.
// Link the old node to the new one so we can find it later
//
CHTMLcreateSliceNode: function (node) {
var NODE = this.CHTMLnodeElement(), n = 0;
var LAST = NODE; while (LAST.nextMathJaxNode) {LAST = LAST.nextMathJaxNode; n++}
var SLICE = NODE.cloneNode(false); LAST.nextMathJaxNode = SLICE; SLICE.nextMathJaxNode = null;
SLICE.id += "-MJX-Continue-"+n;
return node.appendChild(SLICE);
},
/****************************************************************/
//
// Move an element from its original node to its new location in
// a split element or the new line's node
//
CHTMLmoveNode: function (line,state,values) {
// FIXME: handle linebreakstyle === "duplicate"
// FIXME: handle linebreakmultchar
if (!(state.first || state.last) ||
(state.first && state.values.linebreakstyle === MML.LINEBREAKSTYLE.BEFORE) ||
(state.last && values.linebreakstyle === MML.LINEBREAKSTYLE.AFTER)) {
//
// Move node
//
var node = this.CHTMLnodeElement();
line.appendChild(node);
//
// If it is last, remove right margin
// If it is first, remove left margin
//
if (state.last) node.style.marginRight = "";
if (state.first || state.nextIsFirst) {
node.style.marginLeft = ""; this.CHTML.L = 0;
node.className = node.className.replace(/ MJXc-space\d/,"");
}
if (state.first && this.CHTML.w === 0) state.nextIsFirst = true;
else delete state.nextIsFirst;
//
// Update bounding box
//
state.bbox.combine(this.CHTML,state.bbox.w,0);
}
}
});
/**************************************************************************/
MML.mfenced.Augment({
CHTMLbetterBreak: function (info,state) {
//
// Get the current breakpoint position and other data
//
var index = info.index.slice(0), i = info.index.shift(),
m = this.data.length, W, w, scanW, broken = (info.index.length > 0), better = false;
if (i == null) i = -1; if (!broken) {i++; info.W += info.w; info.w = 0}
scanW = info.scanW = info.W; info.nest++;
//
// Create indices that include the delimiters and separators
//
if (!this.dataI) {
this.dataI = [];
if (this.data.open) this.dataI.push("open");
if (m) this.dataI.push(0);
for (var j = 1; j < m; j++) {
if (this.data["sep"+j]) this.dataI.push("sep"+j);
this.dataI.push(j);
}
if (this.data.close) this.dataI.push("close");
}
m = this.dataI.length;
//
// Look through the line for breakpoints, including the open, close, and separators
// (as long as we are not too far past the breaking width)
//
while (i < m && info.scanW < 1.33*CHTML.linebreakWidth) {
var k = this.dataI[i];
if (this.data[k]) {
if (this.data[k].CHTMLbetterBreak(info,state)) {
better = true; index = [i].concat(info.index); W = info.W; w = info.w;
if (info.penalty === PENALTY.newline) {
info.index = index;
if (info.nest) info.nest--;
return true;
}
}
scanW = (broken ? info.scanW : this.CHTMLaddWidth(i,info,scanW));
}
info.index = []; i++; broken = false;
}
if (info.nest) info.nest--;
info.index = index;
if (better) {info.W = W; info.w = w}
return better;
},
CHTMLmoveLine: function (start,end,node,state,values) {
var i = start[0], j = end[0];
if (i == null) i = -1; if (j == null) j = this.dataI.length-1;
if (i === j && start.length > 1) {
//
// If starting and ending in the same element move the subpiece to the new line
//
this.data[this.dataI[i]].CHTMLmoveSlice(start.slice(1),end.slice(1),node,state,values,"marginLeft");
} else {
//
// Otherwise, move the remainder of the initial item
// and any others (including open and separators) up to the last one
//
var last = state.last; state.last = false; var k = this.dataI[i];
while (i < j) {
if (this.data[k]) {
if (start.length <= 1) this.data[k].CHTMLmoveNode(node,state,values);
else this.data[k].CHTMLmoveSlice(start.slice(1),[],node,state,values,"marginLeft");
}
i++; k = this.dataI[i]; state.first = false; start = [];
}
//
// If the last item is complete, move it
//
state.last = last;
if (this.data[k]) {
if (end.length <= 1) this.data[k].CHTMLmoveNode(node,state,values);
else this.data[k].CHTMLmoveSlice([],end.slice(1),node,state,values,"marginRight");
}
}
}
});
/**************************************************************************/
MML.msubsup.Augment({
CHTMLbetterBreak: function (info,state) {
if (!this.data[this.base]) {return false}
//
// Get the current breakpoint position and other data
//
var index = info.index.slice(0), i = info.index.shift(),
W, w, scanW, broken = (info.index.length > 0), better = false;
if (!broken) {info.W += info.w; info.w = 0}
scanW = info.scanW = info.W;
//
// Record the width of the base and the super- and subscripts
//
if (i == null) {
this.CHTML.baseW = this.data[this.base].CHTML.w;
this.CHTML.dw = this.CHTML.w - this.CHTML.baseW;
}
//
// Check if the base can be broken
//
if (this.data[this.base].CHTMLbetterBreak(info,state)) {
better = true; index = [this.base].concat(info.index); W = info.W; w = info.w;
if (info.penalty === PENALTY.newline) better = broken = true;
}
//
// Add in the base if it is unbroken, and add the scripts
//
if (!broken) this.CHTMLaddWidth(this.base,info,scanW);
info.scanW += this.CHTML.dw; info.W = info.scanW;
info.index = []; if (better) {info.W = W; info.w = w; info.index = index}
return better;
},
CHTMLmoveLine: function (start,end,node,state,values) {
//
// Move the proper part of the base
//
if (this.data[this.base]) {
var base = CHTML.addElement(node,"mjx-base");
if (start.length > 1) {
this.data[this.base].CHTMLmoveSlice(start.slice(1),end.slice(1),base,state,values,"marginLeft");
} else {
if (end.length <= 1) this.data[this.base].CHTMLmoveNode(base,state,values);
else this.data[this.base].CHTMLmoveSlice([],end.slice(1),base,state,values,"marginRight");
}
}
//
// If this is the end, check for super and subscripts, and move those
// by moving the elements that contains them. Adjust the bounding box
// to include the super and subscripts.
//
if (end.length === 0) {
var NODE = this.CHTMLnodeElement(),
stack = NODE.getElementsByTagName("mjx-stack")[0],
sup = NODE.getElementsByTagName("mjx-sup")[0],
sub = NODE.getElementsByTagName("mjx-sub")[0];
if (stack) node.appendChild(stack);
else if (sup) node.appendChild(sup);
else if (sub) node.appendChild(sub);
var w = state.bbox.w, bbox;
if (sup) {
bbox = this.data[this.sup].CHTML;
state.bbox.combine(bbox,w,bbox.Y);
}
if (sub) {
bbox = this.data[this.sub].CHTML;
state.bbox.combine(bbox,w,bbox.Y);
}
}
}
});
/**************************************************************************/
MML.mmultiscripts.Augment({
CHTMLbetterBreak: function (info,state) {
if (!this.data[this.base]) return false;
//
// Get the current breakpoint position and other data
//
var index = info.index.slice(0); info.index.shift();
var W, w, scanW, broken = (info.index.length > 0), better = false;
if (!broken) {info.W += info.w; info.w = 0}
info.scanW = info.W;
//
// Get the bounding boxes and the width of the scripts
//
var bbox = this.CHTML, base = this.data[this.base].CHTML;
var dw = bbox.w - base.w - bbox.X;
//
// Add in the width of the prescripts
//
info.scanW += bbox.X; scanW = info.scanW;
//
// Check if the base can be broken
//
if (this.data[this.base].CHTMLbetterBreak(info,state)) {
better = true; index = [this.base].concat(info.index); W = info.W; w = info.w;
if (info.penalty === PENALTY.newline) better = broken = true;
}
//
// Add in the base if it is unbroken, and add the scripts
//
if (!broken) this.CHTMLaddWidth(this.base,info,scanW);
info.scanW += dw; info.W = info.scanW;
info.index = []; if (better) {info.W = W; info.w = w; info.index = index}
return better;
},
CHTMLmoveLine: function (start,end,node,state,values) {
var NODE = this.CHTMLnodeElement(), data = this.CHTML, BOX = this.CHTMLbbox, NODE;
//
// If this is the start, move the prescripts, if any.
//
if (start.length < 1) {
NODE = this.CHTMLnodeElement();
var prestack = NODE.getElementsByTagName("mjx-prestack")[0],
presup = NODE.getElementsByTagName("mjx-presup")[0],
presub = NODE.getElementsByTagName("mjx-presub")[0];
if (prestack) node.appendChild(prestack);
else if (presup) node.appendChild(presup);
else if (presub) node.appendChild(presub);
var w = state.bbox.w, bbox;
if (presup) state.bbox.combine(BOX.presup,w+BOX.presup.X,BOX.presup.Y);
if (presub) state.bbox.combine(BOX.presub,w+BOX.presub.X,BOX.presub.Y);
}
//
// Move the proper part of the base
//
if (this.data[this.base]) {
var base = CHTML.addElement(node,"mjx-base");
if (start.length > 1) {
this.data[this.base].CHTMLmoveSlice(start.slice(1),end.slice(1),base,state,values,"marginLeft");
} else {
if (end.length <= 1) this.data[this.base].CHTMLmoveNode(base,state,values);
else this.data[this.base].CHTMLmoveSlice([],end.slice(1),base,state,values,"marginRight");
}
}
//
// If this is the end, check for super and subscripts, and move those
// by moving the elements that contains them. Adjust the bounding box
// to include the super and subscripts.
//
if (end.length === 0) {
NODE = this.CHTMLnodeElement();
var stack = NODE.getElementsByTagName("mjx-stack")[0],
sup = NODE.getElementsByTagName("mjx-sup")[0],
sub = NODE.getElementsByTagName("mjx-sub")[0];
if (stack) node.appendChild(stack);
else if (sup) node.appendChild(sup);
else if (sub) node.appendChild(sub);
var w = state.bbox.w, bbox;
if (sup) state.bbox.combine(BOX.sup,w,BOX.sup.Y);
if (sub) state.bbox.combine(BOX.sub,w,BOX.sub.Y);
}
}
});
/**************************************************************************/
MML.mo.Augment({
//
// Override the method for checking line breaks to properly handle <mo>
//
CHTMLbetterBreak: function (info,state) {
if (info.values && info.values.id === this.CHTMLnodeID) return false;
var values = this.getValues(
"linebreak","linebreakstyle","lineleading","linebreakmultchar",
"indentalign","indentshift",
"indentalignfirst","indentshiftfirst",
"indentalignlast","indentshiftlast",
"texClass", "fence"
);
if (values.linebreakstyle === MML.LINEBREAKSTYLE.INFIXLINEBREAKSTYLE)
values.linebreakstyle = this.Get("infixlinebreakstyle");
//
// Adjust nesting by TeX class (helps output that does not include
// mrows for nesting, but can leave these unbalanced.
//
if (values.texClass === MML.TEXCLASS.OPEN) info.nest++;
if (values.texClass === MML.TEXCLASS.CLOSE && info.nest) info.nest--;
//
// Get the default penalty for this location
//
var W = info.scanW, mo = (info.embellished||this); delete info.embellished;
var w = this.CHTML.w + (this.CHTML.L||0) + (this.CHTML.R||0);
if (values.linebreakstyle === MML.LINEBREAKSTYLE.AFTER) {W += w; w = 0}
if (W - info.shift === 0 && values.linebreak !== MML.LINEBREAK.NEWLINE)
return false; // don't break at zero width (FIXME?)
var offset = CHTML.linebreakWidth - W;
// Adjust offest for explicit first-line indent and align
if (state.n === 0 && (values.indentshiftfirst !== state.VALUES.indentshiftfirst ||
values.indentalignfirst !== state.VALUES.indentalignfirst)) {
var align = this.CHTMLgetAlign(state,values),
shift = this.CHTMLgetShift(state,values,align);
offset += (info.shift - shift);
}
//
var penalty = Math.floor(offset / CHTML.linebreakWidth * 1000);
if (penalty < 0) penalty = PENALTY.toobig - 3*penalty;
if (values.fence) penalty += PENALTY.fence;
if ((values.linebreakstyle === MML.LINEBREAKSTYLE.AFTER &&
values.texClass === MML.TEXCLASS.OPEN) ||
values.texClass === MML.TEXCLASS.CLOSE) penalty += PENALTY.close;
penalty += info.nest * PENALTY.nestfactor;
//
// Get the penalty for this type of break and
// use it to modify the default penalty
//
var linebreak = PENALTY[values.linebreak||MML.LINEBREAK.AUTO];
if (!(linebreak instanceof Array)) {
// for breaks past the width, don't modify penalty
if (offset >= 0) {penalty = linebreak * info.nest}
} else {penalty = Math.max(1,penalty + linebreak[0] * info.nest)}
//
// If the penalty is no better than the current one, return false
// Otherwise save the data for this breakpoint and return true
//
if (penalty >= info.penalty) return false;
info.penalty = penalty; info.values = values; info.W = W; info.w = w;
values.lineleading = this.CHTMLlength2em(values.lineleading,state.VALUES.lineleading);
values.id = this.CHTMLnodeID;
return true;
}
});
/**************************************************************************/
MML.mspace.Augment({
//
// Override the method for checking line breaks to properly handle <mspace>
//
CHTMLbetterBreak: function (info,state) {
if (info.values && info.values.id === this.CHTMLnodeID) return false;
var values = this.getValues("linebreak");
var linebreakValue = values.linebreak;
if (!linebreakValue || this.hasDimAttr()) {
// The MathML spec says that the linebreak attribute should be ignored
// if any dimensional attribute is set.
linebreakValue = MML.LINEBREAK.AUTO;
}
//
// Get the default penalty for this location
//
var W = info.scanW, w = this.CHTML.w + (this.CHTML.L||0) + (this.CHTML.R||0);
if (W - info.shift === 0) return false; // don't break at zero width (FIXME?)
var offset = CHTML.linebreakWidth - W;
//
var penalty = Math.floor(offset / CHTML.linebreakWidth * 1000);
if (penalty < 0) penalty = PENALTY.toobig - 3*penalty;
penalty += info.nest * PENALTY.nestfactor;
//
// Get the penalty for this type of break and
// use it to modify the default penalty
//
var linebreak = PENALTY[linebreakValue];
if (linebreakValue === MML.LINEBREAK.AUTO && w >= PENALTY.spacelimit &&
!this.mathbackground && !this.background)
linebreak = [(w+PENALTY.spaceoffset)*PENALTY.spacefactor];
if (!(linebreak instanceof Array)) {
// for breaks past the width, don't modify penalty
if (offset >= 0) {penalty = linebreak * info.nest}
} else {penalty = Math.max(1,penalty + linebreak[0] * info.nest)}
//
// If the penalty is no better than the current one, return false
// Otherwise save the data for this breakpoint and return true
//
if (penalty >= info.penalty) return false;
info.penalty = penalty; info.values = values; info.W = W; info.w = w;
values.lineleading = state.VALUES.lineleading;
values.linebreakstyle = "before"; values.id = this.CHTMLnodeID;
return true;
}
});
//
// Hook into the mathchoice extension
//
MathJax.Hub.Register.StartupHook("TeX mathchoice Ready",function () {
MML.TeXmathchoice.Augment({
CHTMLbetterBreak: function (info,state) {
return this.Core().CHTMLbetterBreak(info,state);
},
CHTMLmoveLine: function (start,end,node,state,values) {
return this.Core().CHTMLmoveSlice(start,end,node,state,values);
}
});
});
//
// Have maction process only the selected item
//
MML.maction.Augment({
CHTMLbetterBreak: function (info,state) {
return this.Core().CHTMLbetterBreak(info,state);
},
CHTMLmoveLine: function (start,end,node,state,values) {
return this.Core().CHTMLmoveSlice(start,end,node,state,values);
}
});
//
// Have semantics only do the first element
// (FIXME: do we need to do anything special about annotation-xml?)
//
MML.semantics.Augment({
CHTMLbetterBreak: function (info,state) {
return (this.data[0] ? this.data[0].CHTMLbetterBreak(info,state) : false);
},
CHTMLmoveLine: function (start,end,node,state,values) {
return (this.data[0] ? this.data[0].CHTMLmoveSlice(start,end,node,state,values) : null);
}
});
/**************************************************************************/
MathJax.Hub.Startup.signal.Post("CommonHTML multiline Ready");
MathJax.Ajax.loadComplete(CHTML.autoloadDir+"/multiline.js");
});

View File

@ -30,10 +30,21 @@ MathJax.OutputJax.CommonHTML = MathJax.OutputJax({
version: "2.5.0",
directory: MathJax.OutputJax.directory + "/CommonHTML",
extensionDir: MathJax.OutputJax.extensionDir + "/CommonHTML",
autoloadDir: MathJax.OutputJax.directory + "/CommonHTML/autoload",
fontDir: MathJax.OutputJax.directory + "/CommonHTML/fonts", // fontname added later
webfontDir: MathJax.OutputJax.fontDir + "/HTML-CSS", // fontname added later
config: {
matchFontHeight: true, // try to match math font height to surrounding font?
scale: 100, minScaleAdjust: 50, // global math scaling factor, and minimum adjusted scale factor
mtextFontInherit: false, // to make <mtext> be in page font rather than MathJax font
undefinedFamily: "STIXGeneral,'Cambria Math','Arial Unicode MS',serif",
EqnChunk: (MathJax.Hub.Browser.isMobile ? 20: 100),
// number of equations to process before showing them
EqnChunkFactor: 1.5, // chunk size is multiplied by this after each chunk
EqnChunkDelay: 100, // milliseconds to delay between chunks (to let browser
// respond to other events)
linebreaks: {
automatic: false, // when false, only process linebreak="newline",

View File

@ -0,0 +1,289 @@
/*************************************************************
*
* MathJax/jax/output/CommonHTML/fonts/TeX/AMS-Regular.js
*
* Copyright (c) 2015 The MathJax Consortium
*
* 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 (CHTML) {
var font = 'MathJax_AMS';
CHTML.FONTDATA.FONTS[font] = {
className: CHTML.FONTDATA.familyName(font),
centerline: 270, ascent: 1003, descent: 463,
0x20: [0,0,250,0,0], // SPACE
0x41: [701,1,722,17,703], // LATIN CAPITAL LETTER A
0x42: [683,1,667,11,620], // LATIN CAPITAL LETTER B
0x43: [702,19,722,39,684], // LATIN CAPITAL LETTER C
0x44: [683,1,722,16,688], // LATIN CAPITAL LETTER D
0x45: [683,1,667,12,640], // LATIN CAPITAL LETTER E
0x46: [683,1,611,12,584], // LATIN CAPITAL LETTER F
0x47: [702,19,778,39,749], // LATIN CAPITAL LETTER G
0x48: [683,1,778,14,762], // LATIN CAPITAL LETTER H
0x49: [683,1,389,20,369], // LATIN CAPITAL LETTER I
0x4A: [683,77,500,6,478], // LATIN CAPITAL LETTER J
0x4B: [683,1,778,22,768], // LATIN CAPITAL LETTER K
0x4C: [683,1,667,12,640], // LATIN CAPITAL LETTER L
0x4D: [683,1,944,17,926], // LATIN CAPITAL LETTER M
0x4E: [683,20,722,20,702], // LATIN CAPITAL LETTER N
0x4F: [701,19,778,34,742], // LATIN CAPITAL LETTER O
0x50: [683,1,611,16,597], // LATIN CAPITAL LETTER P
0x51: [701,181,778,34,742], // LATIN CAPITAL LETTER Q
0x52: [683,1,722,16,705], // LATIN CAPITAL LETTER R
0x53: [702,12,556,28,528], // LATIN CAPITAL LETTER S
0x54: [683,1,667,33,635], // LATIN CAPITAL LETTER T
0x55: [683,19,722,16,709], // LATIN CAPITAL LETTER U
0x56: [683,20,722,0,719], // LATIN CAPITAL LETTER V
0x57: [683,19,1000,5,994], // LATIN CAPITAL LETTER W
0x58: [683,1,722,16,705], // LATIN CAPITAL LETTER X
0x59: [683,1,722,16,704], // LATIN CAPITAL LETTER Y
0x5A: [683,1,667,29,635], // LATIN CAPITAL LETTER Z
0x6B: [683,1,556,17,534], // LATIN SMALL LETTER K
0xA0: [0,0,250,0,0], // NO-BREAK SPACE
0xA5: [683,0,750,11,738], // YEN SIGN
0xAE: [709,175,947,32,915], // REGISTERED SIGN
0xF0: [749,21,556,42,509], // LATIN SMALL LETTER ETH
0x127: [695,13,540,42,562], // LATIN SMALL LETTER H WITH STROKE
0x2C6: [845,-561,2333,-14,2346], // MODIFIER LETTER CIRCUMFLEX ACCENT
0x2DC: [899,-628,2333,1,2330], // SMALL TILDE
0x302: [845,-561,0,-2347,13], // COMBINING CIRCUMFLEX ACCENT
0x303: [899,-628,0,-2332,-3], // COMBINING TILDE
0x3DD: [605,85,778,55,719], // GREEK SMALL LETTER DIGAMMA
0x3F0: [434,6,667,37,734], // GREEK KAPPA SYMBOL
0x2035: [560,-43,275,12,244], // REVERSED PRIME
0x210F: [695,13,540,42,562], // stix-/hbar - Planck's over 2pi
0x2127: [684,22,722,44,675], // INVERTED OHM SIGN
0x2132: [695,1,556,55,497], // TURNED CAPITAL F
0x2136: [763,21,667,-22,687], // BET SYMBOL
0x2137: [764,43,444,-22,421], // GIMEL SYMBOL
0x2138: [764,43,667,54,640], // DALET SYMBOL
0x2141: [705,23,639,37,577], // TURNED SANS-SERIF CAPITAL G
0x2190: [437,-64,500,64,422], // LEFTWARDS ARROW
0x2192: [437,-64,500,58,417], // RIGHTWARDS ARROW
0x219A: [437,-60,1000,56,942], // LEFTWARDS ARROW WITH STROKE
0x219B: [437,-60,1000,54,942], // RIGHTWARDS ARROW WITH STROKE
0x219E: [417,-83,1000,56,944], // LEFTWARDS TWO HEADED ARROW
0x21A0: [417,-83,1000,55,943], // RIGHTWARDS TWO HEADED ARROW
0x21A2: [417,-83,1111,56,1031], // LEFTWARDS ARROW WITH TAIL
0x21A3: [417,-83,1111,79,1054], // RIGHTWARDS ARROW WITH TAIL
0x21AB: [575,41,1000,56,964], // LEFTWARDS ARROW WITH LOOP
0x21AC: [575,41,1000,35,943], // RIGHTWARDS ARROW WITH LOOP
0x21AD: [417,-83,1389,57,1331], // LEFT RIGHT WAVE ARROW
0x21AE: [437,-60,1000,56,942], // LEFT RIGHT ARROW WITH STROKE
0x21B0: [722,0,500,56,444], // UPWARDS ARROW WITH TIP LEFTWARDS
0x21B1: [722,0,500,55,443], // UPWARDS ARROW WITH TIP RIGHTWARDS
0x21B6: [461,1,1000,17,950], // ANTICLOCKWISE TOP SEMICIRCLE ARROW
0x21B7: [460,1,1000,46,982], // CLOCKWISE TOP SEMICIRCLE ARROW
0x21BA: [650,83,778,56,722], // ANTICLOCKWISE OPEN CIRCLE ARROW
0x21BB: [650,83,778,56,721], // CLOCKWISE OPEN CIRCLE ARROW
0x21BE: [694,194,417,188,375], // UPWARDS HARPOON WITH BARB RIGHTWARDS
0x21BF: [694,194,417,41,228], // UPWARDS HARPOON WITH BARB LEFTWARDS
0x21C2: [694,194,417,188,375], // DOWNWARDS HARPOON WITH BARB RIGHTWARDS
0x21C3: [694,194,417,41,228], // DOWNWARDS HARPOON WITH BARB LEFTWARDS
0x21C4: [667,0,1000,55,944], // RIGHTWARDS ARROW OVER LEFTWARDS ARROW
0x21C6: [667,0,1000,55,944], // LEFTWARDS ARROW OVER RIGHTWARDS ARROW
0x21C7: [583,83,1000,55,944], // LEFTWARDS PAIRED ARROWS
0x21C8: [694,193,833,83,749], // UPWARDS PAIRED ARROWS
0x21C9: [583,83,1000,55,944], // RIGHTWARDS PAIRED ARROWS
0x21CA: [694,194,833,83,749], // DOWNWARDS PAIRED ARROWS
0x21CB: [514,14,1000,55,944], // LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON
0x21CC: [514,14,1000,55,944], // RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON
0x21CD: [534,35,1000,54,942], // LEFTWARDS DOUBLE ARROW WITH STROKE
0x21CE: [534,37,1000,32,965], // LEFT RIGHT DOUBLE ARROW WITH STROKE
0x21CF: [534,35,1000,55,943], // RIGHTWARDS DOUBLE ARROW WITH STROKE
0x21DA: [611,111,1000,76,944], // LEFTWARDS TRIPLE ARROW
0x21DB: [611,111,1000,55,923], // RIGHTWARDS TRIPLE ARROW
0x21DD: [417,-83,1000,56,943], // RIGHTWARDS SQUIGGLE ARROW
0x21E0: [437,-64,1334,64,1251], // LEFTWARDS DASHED ARROW
0x21E2: [437,-64,1334,84,1251], // RIGHTWARDS DASHED ARROW
0x2201: [846,21,500,56,444], // COMPLEMENT
0x2204: [860,166,556,55,497], // THERE DOES NOT EXIST
0x2205: [587,3,778,54,720], // EMPTY SET
0x220D: [440,1,429,102,456], // SMALL CONTAINS AS MEMBER
0x2212: [270,-230,500,84,417], // MINUS SIGN
0x2214: [766,93,778,57,722], // DOT PLUS
0x2216: [430,23,778,91,685], // SET MINUS
0x221D: [472,-28,778,56,722], // PROPORTIONAL TO
0x2220: [694,0,722,55,666], // ANGLE
0x2221: [714,20,722,55,666], // MEASURED ANGLE
0x2222: [551,51,722,55,666], // SPHERICAL ANGLE
0x2223: [430,23,222,91,131], // DIVIDES
0x2224: [750,252,278,-21,297], // DOES NOT DIVIDE
0x2225: [431,23,389,55,331], // PARALLEL TO
0x2226: [750,250,500,-20,518], // NOT PARALLEL TO
0x2234: [471,82,667,24,643], // THEREFORE
0x2235: [471,82,667,23,643], // BECAUSE
0x223C: [365,-132,778,55,719], // TILDE OPERATOR
0x223D: [367,-133,778,56,722], // REVERSED TILDE
0x2241: [467,-32,778,55,719], // stix-not, vert, similar
0x2242: [463,-34,778,55,720], // MINUS TILDE
0x2246: [652,155,778,54,720], // APPROXIMATELY BUT NOT ACTUALLY EQUAL TO
0x2248: [481,-50,778,55,719], // ALMOST EQUAL TO
0x224A: [579,39,778,51,725], // ALMOST EQUAL OR EQUAL TO
0x224E: [492,-8,778,56,722], // GEOMETRICALLY EQUIVALENT TO
0x224F: [492,-133,778,56,722], // DIFFERENCE BETWEEN
0x2251: [609,108,778,56,722], // GEOMETRICALLY EQUAL TO
0x2252: [601,101,778,15,762], // APPROXIMATELY EQUAL TO OR THE IMAGE OF
0x2253: [601,102,778,14,762], // IMAGE OF OR APPROXIMATELY EQUAL TO
0x2256: [367,-133,778,56,722], // RING IN EQUAL TO
0x2257: [721,-133,778,56,722], // RING EQUAL TO
0x225C: [859,-133,778,56,723], // DELTA EQUAL TO
0x2266: [753,175,778,83,694], // LESS-THAN OVER EQUAL TO
0x2267: [753,175,778,83,694], // GREATER-THAN OVER EQUAL TO
0x2268: [752,286,778,82,693], // stix-less, vert, not double equals
0x2269: [752,286,778,82,693], // stix-gt, vert, not double equals
0x226C: [750,250,500,74,425], // BETWEEN
0x226E: [708,209,778,82,693], // stix-not, vert, less-than
0x226F: [708,209,778,82,693], // stix-not, vert, greater-than
0x2270: [801,303,778,82,694], // stix-not, vert, less-than-or-equal
0x2271: [801,303,778,82,694], // stix-not, vert, greater-than-or-equal
0x2272: [732,228,778,56,722], // stix-less-than or (contour) similar
0x2273: [732,228,778,56,722], // stix-greater-than or (contour) similar
0x2276: [681,253,778,44,734], // LESS-THAN OR GREATER-THAN
0x2277: [681,253,778,83,694], // GREATER-THAN OR LESS-THAN
0x227C: [580,153,778,83,694], // PRECEDES OR EQUAL TO
0x227D: [580,154,778,82,694], // SUCCEEDS OR EQUAL TO
0x227E: [732,228,778,56,722], // PRECEDES OR EQUIVALENT TO
0x227F: [732,228,778,56,722], // SUCCEEDS OR EQUIVALENT TO
0x2280: [705,208,778,82,693], // DOES NOT PRECEDE
0x2281: [705,208,778,82,693], // stix-not (vert) succeeds
0x2288: [801,303,778,83,693], // stix-/nsubseteq N: not (vert) subset, equals
0x2289: [801,303,778,82,691], // stix-/nsupseteq N: not (vert) superset, equals
0x228A: [635,241,778,84,693], // stix-subset, not equals, variant
0x228B: [635,241,778,82,691], // stix-superset, not equals, variant
0x228F: [539,41,778,83,694], // SQUARE IMAGE OF
0x2290: [539,41,778,64,714], // SQUARE ORIGINAL OF
0x229A: [582,82,778,57,721], // CIRCLED RING OPERATOR
0x229B: [582,82,778,57,721], // CIRCLED ASTERISK OPERATOR
0x229D: [582,82,778,57,721], // CIRCLED DASH
0x229E: [689,0,778,55,722], // SQUARED PLUS
0x229F: [689,0,778,55,722], // SQUARED MINUS
0x22A0: [689,0,778,55,722], // SQUARED TIMES
0x22A1: [689,0,778,55,722], // SQUARED DOT OPERATOR
0x22A8: [694,0,611,55,555], // TRUE
0x22A9: [694,0,722,55,666], // FORCES
0x22AA: [694,0,889,55,833], // TRIPLE VERTICAL BAR RIGHT TURNSTILE
0x22AC: [695,1,611,-55,554], // DOES NOT PROVE
0x22AD: [695,1,611,-55,554], // NOT TRUE
0x22AE: [695,1,722,-55,665], // DOES NOT FORCE
0x22AF: [695,1,722,-55,665], // NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
0x22B2: [539,41,778,83,694], // NORMAL SUBGROUP OF
0x22B3: [539,41,778,83,694], // CONTAINS AS NORMAL SUBGROUP
0x22B4: [636,138,778,83,694], // NORMAL SUBGROUP OF OR EQUAL TO
0x22B5: [636,138,778,83,694], // CONTAINS AS NORMAL SUBGROUP OR EQUAL TO
0x22B8: [408,-92,1111,55,1055], // MULTIMAP
0x22BA: [431,212,556,57,500], // INTERCALATE
0x22BB: [716,0,611,55,555], // XOR
0x22BC: [716,0,611,55,555], // NAND
0x22C5: [189,0,278,55,222], // DOT OPERATOR
0x22C7: [545,44,778,55,720], // DIVISION TIMES
0x22C9: [492,-8,778,146,628], // LEFT NORMAL FACTOR SEMIDIRECT PRODUCT
0x22CA: [492,-8,778,146,628], // RIGHT NORMAL FACTOR SEMIDIRECT PRODUCT
0x22CB: [694,22,778,55,722], // LEFT SEMIDIRECT PRODUCT
0x22CC: [694,22,778,55,722], // RIGHT SEMIDIRECT PRODUCT
0x22CD: [464,-36,778,56,722], // REVERSED TILDE EQUALS
0x22CE: [578,21,760,83,676], // CURLY LOGICAL OR
0x22CF: [578,22,760,83,676], // CURLY LOGICAL AND
0x22D0: [540,40,778,84,694], // DOUBLE SUBSET
0x22D1: [540,40,778,83,693], // DOUBLE SUPERSET
0x22D2: [598,22,667,55,611], // DOUBLE INTERSECTION
0x22D3: [598,22,667,55,611], // DOUBLE UNION
0x22D4: [736,22,667,56,611], // PITCHFORK
0x22D6: [541,41,778,82,693], // LESS-THAN WITH DOT
0x22D7: [541,41,778,82,693], // GREATER-THAN WITH DOT
0x22D8: [568,67,1333,56,1277], // VERY MUCH LESS-THAN
0x22D9: [568,67,1333,55,1277], // VERY MUCH GREATER-THAN
0x22DA: [886,386,778,83,674], // stix-less, equal, slanted, greater
0x22DB: [886,386,778,83,674], // stix-greater, equal, slanted, less
0x22DE: [734,0,778,83,694], // EQUAL TO OR PRECEDES
0x22DF: [734,0,778,82,694], // EQUAL TO OR SUCCEEDS
0x22E0: [801,303,778,82,693], // stix-not (vert) precedes or contour equals
0x22E1: [801,303,778,82,694], // stix-not (vert) succeeds or contour equals
0x22E6: [730,359,778,55,719], // LESS-THAN BUT NOT EQUIVALENT TO
0x22E7: [730,359,778,55,719], // GREATER-THAN BUT NOT EQUIVALENT TO
0x22E8: [730,359,778,55,719], // PRECEDES BUT NOT EQUIVALENT TO
0x22E9: [730,359,778,55,719], // SUCCEEDS BUT NOT EQUIVALENT TO
0x22EA: [706,208,778,82,693], // NOT NORMAL SUBGROUP OF
0x22EB: [706,208,778,82,693], // DOES NOT CONTAIN AS NORMAL SUBGROUP
0x22EC: [802,303,778,82,693], // stix-not, vert, left triangle, equals
0x22ED: [801,303,778,82,693], // stix-not, vert, right triangle, equals
0x2322: [378,-122,778,55,722], // stix-small down curve
0x2323: [378,-143,778,55,722], // stix-small up curve
0x24C8: [709,175,902,8,894], // CIRCLED LATIN CAPITAL LETTER S
0x250C: [694,-306,500,55,444], // BOX DRAWINGS LIGHT DOWN AND RIGHT
0x2510: [694,-306,500,55,444], // BOX DRAWINGS LIGHT DOWN AND LEFT
0x2514: [366,22,500,55,444], // BOX DRAWINGS LIGHT UP AND RIGHT
0x2518: [366,22,500,55,444], // BOX DRAWINGS LIGHT UP AND LEFT
0x2571: [694,195,889,0,860], // BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT
0x2572: [694,195,889,0,860], // BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT
0x25A0: [689,0,778,55,722], // BLACK SQUARE
0x25A1: [689,0,778,55,722], // WHITE SQUARE
0x25B2: [575,20,722,84,637], // BLACK UP-POINTING TRIANGLE
0x25B3: [575,20,722,84,637], // WHITE UP-POINTING TRIANGLE
0x25B6: [539,41,778,83,694], // BLACK RIGHT-POINTING TRIANGLE
0x25BC: [576,19,722,84,637], // BLACK DOWN-POINTING TRIANGLE
0x25BD: [576,19,722,84,637], // WHITE DOWN-POINTING TRIANGLE
0x25C0: [539,41,778,83,694], // BLACK LEFT-POINTING TRIANGLE
0x25CA: [716,132,667,56,611], // LOZENGE
0x2605: [694,111,944,49,895], // BLACK STAR
0x2713: [706,34,833,84,749], // CHECK MARK
0x2720: [716,22,833,48,786], // MALTESE CROSS
0x29EB: [716,132,667,56,611], // BLACK LOZENGE
0x2A5E: [813,97,611,55,555], // LOGICAL AND WITH DOUBLE OVERBAR
0x2A7D: [636,138,778,83,694], // LESS-THAN OR SLANTED EQUAL TO
0x2A7E: [636,138,778,83,694], // GREATER-THAN OR SLANTED EQUAL TO
0x2A85: [762,290,778,55,722], // LESS-THAN OR APPROXIMATE
0x2A86: [762,290,778,55,722], // GREATER-THAN OR APPROXIMATE
0x2A87: [635,241,778,82,693], // LESS-THAN AND SINGLE-LINE NOT EQUAL TO
0x2A88: [635,241,778,82,693], // GREATER-THAN AND SINGLE-LINE NOT EQUAL TO
0x2A89: [761,387,778,57,718], // LESS-THAN AND NOT APPROXIMATE
0x2A8A: [761,387,778,57,718], // GREATER-THAN AND NOT APPROXIMATE
0x2A8B: [1003,463,778,83,694], // LESS-THAN ABOVE DOUBLE-LINE EQUAL ABOVE GREATER-THAN
0x2A8C: [1003,463,778,83,694], // GREATER-THAN ABOVE DOUBLE-LINE EQUAL ABOVE LESS-THAN
0x2A95: [636,138,778,83,694], // SLANTED EQUAL TO OR LESS-THAN
0x2A96: [636,138,778,83,694], // SLANTED EQUAL TO OR GREATER-THAN
0x2AB5: [752,286,778,82,693], // PRECEDES ABOVE NOT EQUAL TO
0x2AB6: [752,286,778,82,693], // SUCCEEDS ABOVE NOT EQUAL TO
0x2AB7: [761,294,778,57,717], // PRECEDES ABOVE ALMOST EQUAL TO
0x2AB8: [761,294,778,57,717], // SUCCEEDS ABOVE ALMOST EQUAL TO
0x2AB9: [761,337,778,57,718], // PRECEDES ABOVE NOT ALMOST EQUAL TO
0x2ABA: [761,337,778,57,718], // SUCCEEDS ABOVE NOT ALMOST EQUAL TO
0x2AC5: [753,215,778,84,694], // SUBSET OF ABOVE EQUALS SIGN
0x2AC6: [753,215,778,83,694], // SUPERSET OF ABOVE EQUALS SIGN
0x2ACB: [783,385,778,82,693], // stix-subset not double equals, variant
0x2ACC: [783,385,778,82,693], // SUPERSET OF ABOVE NOT EQUAL TO
0xE006: [430,23,222,-20,240], // ??
0xE007: [431,24,389,-20,407], // ??
0xE008: [605,85,778,55,719], // ??
0xE009: [434,6,667,37,734], // ??
0xE00C: [752,284,778,82,693], // ??
0xE00D: [752,284,778,82,693], // ??
0xE00E: [919,421,778,82,694], // stix-not greater, double equals
0xE00F: [801,303,778,82,694], // stix-not greater-or-equal, slanted
0xE010: [801,303,778,82,694], // stix-not less-or-equal, slanted
0xE011: [919,421,778,82,694], // stix-not less, double equals
0xE016: [828,330,778,82,694], // stix-not subset, double equals
0xE017: [752,332,778,82,694], // ??
0xE018: [828,330,778,82,694], // stix-not superset, double equals
0xE019: [752,333,778,82,693], // ??
0xE01A: [634,255,778,84,693], // ??
0xE01B: [634,254,778,82,691] // ??
};
CHTML.fontLoaded("TeX/"+font.substr(8));
})(MathJax.OutputJax.CommonHTML);

View File

@ -0,0 +1,99 @@
/*************************************************************
*
* MathJax/jax/output/CommonHTML/fonts/TeX/Caligraphic-Bold.js
*
* Copyright (c) 2015 The MathJax Consortium
*
* 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 (CHTML) {
var font = 'MathJax_Caligraphic-Bold';
CHTML.FONTDATA.FONTS[font] = {
className: CHTML.FONTDATA.familyName(font),
centerline: 315, ascent: 840, descent: 211,
weight: 'bold',
skew: {
0x41: 0.224,
0x42: 0.16,
0x43: 0.16,
0x44: 0.0958,
0x45: 0.128,
0x46: 0.128,
0x47: 0.128,
0x48: 0.128,
0x49: 0.0319,
0x4A: 0.192,
0x4B: 0.0639,
0x4C: 0.16,
0x4D: 0.16,
0x4E: 0.0958,
0x4F: 0.128,
0x50: 0.0958,
0x51: 0.128,
0x52: 0.0958,
0x53: 0.16,
0x54: 0.0319,
0x55: 0.0958,
0x56: 0.0319,
0x57: 0.0958,
0x58: 0.16,
0x59: 0.0958,
0x5A: 0.16
},
0x20: [0,0,250,0,0], // SPACE
0x30: [460,17,575,46,528], // DIGIT ZERO
0x31: [461,0,575,80,494], // DIGIT ONE
0x32: [460,0,575,51,517], // DIGIT TWO
0x33: [461,211,575,48,525], // DIGIT THREE
0x34: [469,194,575,32,542], // DIGIT FOUR
0x35: [461,211,575,57,517], // DIGIT FIVE
0x36: [660,17,575,48,526], // DIGIT SIX
0x37: [476,211,575,64,558], // DIGIT SEVEN
0x38: [661,17,575,48,526], // DIGIT EIGHT
0x39: [461,210,575,48,526], // DIGIT NINE
0x41: [751,49,921,39,989], // LATIN CAPITAL LETTER A
0x42: [705,17,748,40,740], // LATIN CAPITAL LETTER B
0x43: [703,20,613,20,599], // LATIN CAPITAL LETTER C
0x44: [686,0,892,20,885], // LATIN CAPITAL LETTER D
0x45: [703,16,607,37,627], // LATIN CAPITAL LETTER E
0x46: [686,30,814,17,930], // LATIN CAPITAL LETTER F
0x47: [703,113,682,50,671], // LATIN CAPITAL LETTER G
0x48: [686,48,987,20,946], // LATIN CAPITAL LETTER H
0x49: [686,0,642,-27,746], // LATIN CAPITAL LETTER I
0x4A: [686,114,779,53,937], // LATIN CAPITAL LETTER J
0x4B: [703,17,871,40,834], // LATIN CAPITAL LETTER K
0x4C: [703,17,788,41,751], // LATIN CAPITAL LETTER L
0x4D: [703,49,1378,38,1353], // LATIN CAPITAL LETTER M
0x4E: [840,49,937,-24,1105], // LATIN CAPITAL LETTER N
0x4F: [703,17,906,63,882], // LATIN CAPITAL LETTER O
0x50: [686,67,810,20,846], // LATIN CAPITAL LETTER P
0x51: [703,146,939,120,905], // LATIN CAPITAL LETTER Q
0x52: [686,17,990,20,981], // LATIN CAPITAL LETTER R
0x53: [703,16,696,25,721], // LATIN CAPITAL LETTER S
0x54: [720,69,644,38,947], // LATIN CAPITAL LETTER T
0x55: [686,24,715,-10,771], // LATIN CAPITAL LETTER U
0x56: [686,77,737,25,774], // LATIN CAPITAL LETTER V
0x57: [686,77,1169,25,1206], // LATIN CAPITAL LETTER W
0x58: [686,-1,817,56,906], // LATIN CAPITAL LETTER X
0x59: [686,164,759,36,797], // LATIN CAPITAL LETTER Y
0x5A: [686,0,818,46,853], // LATIN CAPITAL LETTER Z
0xA0: [0,0,250,0,0] // NO-BREAK SPACE
};
CHTML.fontLoaded("TeX/"+font.substr(8));
})(MathJax.OutputJax.CommonHTML);

View File

@ -0,0 +1,125 @@
/*************************************************************
*
* MathJax/jax/output/CommonHTML/fonts/TeX/Fraktur-Regular.js
*
* Copyright (c) 2015 The MathJax Consortium
*
* 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 (CHTML) {
var font = 'MathJax_Fraktur-Bold';
CHTML.FONTDATA.FONTS[font] = {
className: CHTML.FONTDATA.familyName(font),
centerline: 259, ascent: 740, descent: 223,
weight: 'bold',
0x20: [0,0,250,0,0], // SPACE
0x21: [689,12,349,107,241], // EXCLAMATION MARK
0x22: [695,-432,254,10,231], // QUOTATION MARK
0x26: [696,16,871,44,839], // AMPERSAND
0x27: [695,-436,250,80,158], // APOSTROPHE
0x28: [737,186,459,134,347], // LEFT PARENTHESIS
0x29: [735,187,459,105,326], // RIGHT PARENTHESIS
0x2A: [692,-449,328,40,277], // ASTERISK
0x2B: [598,82,893,56,837], // PLUS SIGN
0x2C: [107,191,328,118,253], // COMMA
0x2D: [275,-236,893,54,833], // HYPHEN-MINUS
0x2E: [102,15,328,103,237], // FULL STOP
0x2F: [721,182,593,41,550], // SOLIDUS
0x30: [501,12,593,42,533], // DIGIT ZERO
0x31: [489,0,593,54,548], // DIGIT ONE
0x32: [491,-2,593,44,563], // DIGIT TWO
0x33: [487,193,593,31,523], // DIGIT THREE
0x34: [495,196,593,13,565], // DIGIT FOUR
0x35: [481,190,593,19,518], // DIGIT FIVE
0x36: [704,12,593,48,547], // DIGIT SIX
0x37: [479,197,593,54,591], // DIGIT SEVEN
0x38: [714,5,593,45,542], // DIGIT EIGHT
0x39: [487,195,593,29,549], // DIGIT NINE
0x3A: [457,12,255,57,197], // COLON
0x3B: [458,190,255,56,211], // SEMICOLON
0x3D: [343,-168,582,22,559], // EQUALS SIGN
0x3F: [697,14,428,40,422], // QUESTION MARK
0x41: [686,31,847,29,827], // LATIN CAPITAL LETTER A
0x42: [684,31,1044,57,965], // LATIN CAPITAL LETTER B
0x43: [676,32,723,72,726], // LATIN CAPITAL LETTER C
0x44: [683,29,982,31,896], // LATIN CAPITAL LETTER D
0x45: [686,29,783,74,728], // LATIN CAPITAL LETTER E
0x46: [684,146,722,17,727], // LATIN CAPITAL LETTER F
0x47: [687,29,927,74,844], // LATIN CAPITAL LETTER G
0x48: [683,126,851,6,752], // LATIN CAPITAL LETTER H
0x49: [681,25,655,32,623], // LATIN CAPITAL LETTER I
0x4A: [680,141,652,-8,616], // LATIN CAPITAL LETTER J
0x4B: [681,26,789,20,806], // LATIN CAPITAL LETTER K
0x4C: [683,28,786,30,764], // LATIN CAPITAL LETTER L
0x4D: [683,32,1239,27,1232], // LATIN CAPITAL LETTER M
0x4E: [679,30,983,26,973], // LATIN CAPITAL LETTER N
0x4F: [726,30,976,12,881], // LATIN CAPITAL LETTER O
0x50: [688,223,977,33,943], // LATIN CAPITAL LETTER P
0x51: [726,83,976,12,918], // LATIN CAPITAL LETTER Q
0x52: [688,28,978,31,978], // LATIN CAPITAL LETTER R
0x53: [685,31,978,82,905], // LATIN CAPITAL LETTER S
0x54: [686,30,790,31,802], // LATIN CAPITAL LETTER T
0x55: [688,39,851,18,871], // LATIN CAPITAL LETTER U
0x56: [685,29,982,25,966], // LATIN CAPITAL LETTER V
0x57: [683,30,1235,26,1240], // LATIN CAPITAL LETTER W
0x58: [681,35,849,32,835], // LATIN CAPITAL LETTER X
0x59: [688,214,984,34,878], // LATIN CAPITAL LETTER Y
0x5A: [677,148,711,-4,624], // LATIN CAPITAL LETTER Z
0x5B: [740,130,257,36,226], // LEFT SQUARE BRACKET
0x5D: [738,132,257,14,208], // RIGHT SQUARE BRACKET
0x5E: [734,-452,590,1,584], // CIRCUMFLEX ACCENT
0x61: [472,32,603,80,586], // LATIN SMALL LETTER A
0x62: [690,32,590,86,504], // LATIN SMALL LETTER B
0x63: [473,26,464,87,424], // LATIN SMALL LETTER C
0x64: [632,28,589,-1,511], // LATIN SMALL LETTER D
0x65: [471,27,472,81,428], // LATIN SMALL LETTER E
0x66: [687,222,388,35,372], // LATIN SMALL LETTER F
0x67: [472,208,595,17,541], // LATIN SMALL LETTER G
0x68: [687,207,615,89,507], // LATIN SMALL LETTER H
0x69: [686,25,331,3,327], // LATIN SMALL LETTER I
0x6A: [682,203,332,-19,238], // LATIN SMALL LETTER J
0x6B: [682,25,464,34,432], // LATIN SMALL LETTER K
0x6C: [681,24,337,100,312], // LATIN SMALL LETTER L
0x6D: [476,31,921,16,900], // LATIN SMALL LETTER M
0x6E: [473,28,654,5,608], // LATIN SMALL LETTER N
0x6F: [482,34,609,107,515], // LATIN SMALL LETTER O
0x70: [557,207,604,-1,519], // LATIN SMALL LETTER P
0x71: [485,211,596,87,515], // LATIN SMALL LETTER Q
0x72: [472,26,460,13,453], // LATIN SMALL LETTER R
0x73: [479,34,523,-23,481], // LATIN SMALL LETTER S
0x74: [648,27,393,43,407], // LATIN SMALL LETTER T
0x75: [472,32,589,9,603], // LATIN SMALL LETTER U
0x76: [546,27,604,56,507], // LATIN SMALL LETTER V
0x77: [549,32,918,55,815], // LATIN SMALL LETTER W
0x78: [471,188,459,8,441], // LATIN SMALL LETTER X
0x79: [557,221,589,60,512], // LATIN SMALL LETTER Y
0x7A: [471,214,461,-7,378], // LATIN SMALL LETTER Z
0xA0: [0,0,250,0,0], // NO-BREAK SPACE
0x2018: [708,-411,254,53,187], // LEFT SINGLE QUOTATION MARK
0x2019: [692,-394,254,58,193], // RIGHT SINGLE QUOTATION MARK
0xE301: [630,27,587,64,512], // stix-MATHEMATICAL BOLD CAPITAL GAMMA SLASHED
0xE302: [693,212,394,37,408], // stix-capital Delta, Greek slashed
0xE303: [681,219,387,36,384], // stix-MATHEMATICAL BOLD CAPITAL DELTA SLASHED
0xE304: [473,212,593,67,531], // stix-capital Epsilon, Greek slashed
0xE305: [684,27,393,33,387], // stix-MATHEMATICAL BOLD CAPITAL EPSILON SLASHED
0xE308: [679,220,981,32,875], // stix-capital Eta, Greek slashed
0xE309: [717,137,727,17,633] // stix-MATHEMATICAL BOLD CAPITAL ETA SLASHED
};
CHTML.fontLoaded("TeX/"+font.substr(8));
})(MathJax.OutputJax.CommonHTML);

View File

@ -0,0 +1,125 @@
/*************************************************************
*
* MathJax/jax/output/CommonHTML/fonts/TeX/Fraktur-Regular.js
*
* Copyright (c) 2015 The MathJax Consortium
*
* 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 (CHTML) {
var font = 'MathJax_Fraktur';
CHTML.FONTDATA.FONTS[font] = {
className: CHTML.FONTDATA.familyName(font),
centerline: 258, ascent: 740, descent: 224,
0x20: [0,0,250,0,0], // SPACE
0x21: [689,12,296,91,204], // EXCLAMATION MARK
0x22: [695,-432,215,8,196], // QUOTATION MARK
0x26: [698,11,738,49,733], // AMPERSAND
0x27: [695,-436,212,69,134], // APOSTROPHE
0x28: [737,186,389,114,293], // LEFT PARENTHESIS
0x29: [735,187,389,89,276], // RIGHT PARENTHESIS
0x2A: [692,-449,278,33,234], // ASTERISK
0x2B: [598,82,756,47,709], // PLUS SIGN
0x2C: [107,191,278,99,213], // COMMA
0x2D: [275,-236,756,46,706], // HYPHEN-MINUS
0x2E: [102,15,278,87,200], // FULL STOP
0x2F: [721,182,502,34,466], // SOLIDUS
0x30: [492,13,502,42,456], // DIGIT ZERO
0x31: [468,2,502,47,460], // DIGIT ONE
0x32: [474,-1,502,60,484], // DIGIT TWO
0x33: [473,182,502,39,429], // DIGIT THREE
0x34: [476,191,502,10,481], // DIGIT FOUR
0x35: [458,184,502,47,440], // DIGIT FIVE
0x36: [700,13,502,45,471], // DIGIT SIX
0x37: [468,181,502,37,498], // DIGIT SEVEN
0x38: [705,10,502,40,461], // DIGIT EIGHT
0x39: [469,182,502,28,466], // DIGIT NINE
0x3A: [457,12,216,50,168], // COLON
0x3B: [458,189,216,47,179], // SEMICOLON
0x3D: [368,-132,756,54,725], // EQUALS SIGN
0x3F: [693,11,362,46,357], // QUESTION MARK
0x41: [696,26,718,22,708], // LATIN CAPITAL LETTER A
0x42: [691,27,884,48,820], // LATIN CAPITAL LETTER B
0x43: [685,24,613,59,607], // LATIN CAPITAL LETTER C
0x44: [685,27,832,27,745], // LATIN CAPITAL LETTER D
0x45: [685,24,663,86,634], // LATIN CAPITAL LETTER E
0x46: [686,153,611,11,612], // LATIN CAPITAL LETTER F
0x47: [690,26,785,66,710], // LATIN CAPITAL LETTER G
0x48: [666,133,720,1,644], // LATIN CAPITAL LETTER H
0x49: [686,26,554,30,532], // LATIN CAPITAL LETTER I
0x4A: [686,139,552,-10,522], // LATIN CAPITAL LETTER J
0x4B: [680,27,668,17,682], // LATIN CAPITAL LETTER K
0x4C: [686,26,666,33,644], // LATIN CAPITAL LETTER L
0x4D: [692,27,1050,27,1048], // LATIN CAPITAL LETTER M
0x4E: [686,25,832,27,825], // LATIN CAPITAL LETTER N
0x4F: [729,27,827,12,744], // LATIN CAPITAL LETTER O
0x50: [692,218,828,28,804], // LATIN CAPITAL LETTER P
0x51: [729,69,827,11,782], // LATIN CAPITAL LETTER Q
0x52: [686,26,828,27,824], // LATIN CAPITAL LETTER R
0x53: [692,27,829,66,756], // LATIN CAPITAL LETTER S
0x54: [701,27,669,34,676], // LATIN CAPITAL LETTER T
0x55: [697,27,646,-25,665], // LATIN CAPITAL LETTER U
0x56: [686,26,831,26,825], // LATIN CAPITAL LETTER V
0x57: [686,27,1046,32,1054], // LATIN CAPITAL LETTER W
0x58: [688,27,719,28,709], // LATIN CAPITAL LETTER X
0x59: [686,218,833,27,740], // LATIN CAPITAL LETTER Y
0x5A: [729,139,602,11,532], // LATIN CAPITAL LETTER Z
0x5B: [740,130,278,117,278], // LEFT SQUARE BRACKET
0x5D: [738,131,278,-4,160], // RIGHT SQUARE BRACKET
0x5E: [734,-452,500,0,495], // CIRCUMFLEX ACCENT
0x61: [470,35,500,66,497], // LATIN SMALL LETTER A
0x62: [685,31,513,87,442], // LATIN SMALL LETTER B
0x63: [466,29,389,72,359], // LATIN SMALL LETTER C
0x64: [609,33,499,13,428], // LATIN SMALL LETTER D
0x65: [467,30,401,70,364], // LATIN SMALL LETTER E
0x66: [681,221,326,30,323], // LATIN SMALL LETTER F
0x67: [470,209,504,17,455], // LATIN SMALL LETTER G
0x68: [688,205,521,77,434], // LATIN SMALL LETTER H
0x69: [673,20,279,14,267], // LATIN SMALL LETTER I
0x6A: [672,208,281,-9,196], // LATIN SMALL LETTER J
0x6B: [689,25,389,24,362], // LATIN SMALL LETTER K
0x6C: [685,20,280,98,276], // LATIN SMALL LETTER L
0x6D: [475,26,767,8,753], // LATIN SMALL LETTER M
0x6E: [475,22,527,20,514], // LATIN SMALL LETTER N
0x6F: [480,28,489,67,412], // LATIN SMALL LETTER O
0x70: [541,212,500,12,430], // LATIN SMALL LETTER P
0x71: [479,219,489,60,419], // LATIN SMALL LETTER Q
0x72: [474,21,389,17,387], // LATIN SMALL LETTER R
0x73: [478,29,443,-18,406], // LATIN SMALL LETTER S
0x74: [640,20,333,27,348], // LATIN SMALL LETTER T
0x75: [474,23,517,9,513], // LATIN SMALL LETTER U
0x76: [530,28,512,55,434], // LATIN SMALL LETTER V
0x77: [532,28,774,45,688], // LATIN SMALL LETTER W
0x78: [472,188,389,10,363], // LATIN SMALL LETTER X
0x79: [528,218,499,45,431], // LATIN SMALL LETTER Y
0x7A: [471,214,391,-7,314], // LATIN SMALL LETTER Z
0xA0: [0,0,250,0,0], // NO-BREAK SPACE
0x2018: [708,-410,215,45,158], // LEFT SINGLE QUOTATION MARK
0x2019: [692,-395,215,49,163], // RIGHT SINGLE QUOTATION MARK
0xE300: [683,32,497,75,430], // stix-capital Gamma, Greek slashed
0xE301: [616,30,498,35,432], // stix-MATHEMATICAL BOLD CAPITAL GAMMA SLASHED
0xE302: [680,215,333,29,339], // stix-capital Delta, Greek slashed
0xE303: [679,224,329,28,318], // stix-MATHEMATICAL BOLD CAPITAL DELTA SLASHED
0xE304: [471,214,503,52,449], // stix-capital Epsilon, Greek slashed
0xE305: [686,20,333,26,315], // stix-MATHEMATICAL BOLD CAPITAL EPSILON SLASHED
0xE306: [577,21,334,29,347], // stix-capital Zeta, Greek slashed
0xE307: [475,22,501,10,514] // stix-MATHEMATICAL BOLD CAPITAL ZETA SLASHED
};
CHTML.fontLoaded("TeX/"+font.substr(8));
})(MathJax.OutputJax.CommonHTML);

View File

@ -0,0 +1,208 @@
/*************************************************************
*
* MathJax/jax/output/CommonHTML/fonts/TeX/Main-Bold.js
*
* Copyright (c) 2015 The MathJax Consortium
*
* 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 (CHTML) {
var font = 'MathJax_Main-Bold';
MathJax.Hub.Insert(CHTML.FONTDATA.FONTS[font],{
0xA0: [0,0,250,0,0], // NO-BREAK SPACE
0xA8: [695,-535,575,96,478], // DIAERESIS
0xAC: [371,-61,767,64,702], // NOT SIGN
0xAF: [607,-540,575,80,494], // MACRON
0xB0: [702,-536,575,160,414], // DEGREE SIGN
0xB1: [728,35,894,64,829], // PLUS-MINUS SIGN
0xB4: [706,-503,575,236,460], // ACUTE ACCENT
0xD7: [530,28,894,168,726], // MULTIPLICATION SIGN
0xF7: [597,96,894,64,828], // DIVISION SIGN
0x131: [452,8,394,24,367], // LATIN SMALL LETTER DOTLESS I
0x237: [451,201,439,-12,420], // LATIN SMALL LETTER DOTLESS J
0x2C6: [694,-520,575,126,448], // MODIFIER LETTER CIRCUMFLEX ACCENT
0x2C7: [660,-515,575,130,444], // CARON
0x2C9: [607,-540,575,80,494], // MODIFIER LETTER MACRON
0x2CA: [706,-503,575,236,460], // MODIFIER LETTER ACUTE ACCENT
0x2CB: [706,-503,575,114,338], // MODIFIER LETTER GRAVE ACCENT
0x2D8: [694,-500,575,102,472], // BREVE
0x2D9: [695,-525,575,202,372], // DOT ABOVE
0x2DA: [702,-536,575,160,414], // RING ABOVE
0x2DC: [694,-552,575,96,478], // SMALL TILDE
0x300: [706,-503,0,-461,-237], // COMBINING GRAVE ACCENT
0x301: [706,-503,0,-339,-115], // COMBINING ACUTE ACCENT
0x302: [694,-520,0,-449,-127], // COMBINING CIRCUMFLEX ACCENT
0x303: [694,-552,0,-479,-97], // COMBINING TILDE
0x304: [607,-540,0,-495,-81], // COMBINING MACRON
0x306: [694,-500,0,-473,-103], // COMBINING BREVE
0x307: [695,-525,0,-373,-203], // COMBINING DOT ABOVE
0x308: [695,-535,0,-479,-97], // COMBINING DIAERESIS
0x30A: [702,-536,0,-415,-161], // COMBINING RING ABOVE
0x30B: [714,-511,0,-442,-82], // COMBINING DOUBLE ACUTE ACCENT
0x30C: [660,-515,0,-445,-131], // COMBINING CARON
0x338: [711,210,0,-734,-161], // COMBINING LONG SOLIDUS OVERLAY
0x2002: [0,0,500,0,0], // ??
0x2003: [0,0,999,0,0], // ??
0x2004: [0,0,333,0,0], // ??
0x2005: [0,0,250,0,0], // ??
0x2006: [0,0,167,0,0], // ??
0x2009: [0,0,167,0,0], // ??
0x200A: [0,0,83,0,0], // ??
0x2013: [300,-249,575,0,574], // EN DASH
0x2014: [300,-249,1150,0,1149], // EM DASH
0x2018: [694,-329,319,58,245], // LEFT SINGLE QUOTATION MARK
0x2019: [694,-329,319,74,261], // RIGHT SINGLE QUOTATION MARK
0x201C: [694,-329,603,110,564], // LEFT DOUBLE QUOTATION MARK
0x201D: [694,-329,603,38,492], // RIGHT DOUBLE QUOTATION MARK
0x2020: [702,211,511,64,446], // DAGGER
0x2021: [702,202,511,64,446], // DOUBLE DAGGER
0x2026: [171,-1,1295,74,1221], // HORIZONTAL ELLIPSIS
0x2032: [563,-33,344,35,331], // PRIME
0x20D7: [723,-513,0,-542,-33], // COMBINING RIGHT ARROW ABOVE
0x210F: [694,8,668,45,642], // stix-/hbar - Planck's over 2pi
0x2111: [702,8,831,64,798], // BLACK-LETTER CAPITAL I
0x2113: [702,19,474,-1,446], // SCRIPT SMALL L
0x2118: [461,210,740,72,726], // SCRIPT CAPITAL P
0x211C: [711,16,831,42,824], // BLACK-LETTER CAPITAL R
0x2135: [694,0,703,64,638], // ALEF SYMBOL
0x2190: [518,17,1150,64,1084], // LEFTWARDS ARROW
0x2191: [694,193,575,14,561], // UPWARDS ARROW
0x2192: [518,17,1150,65,1085], // RIGHTWARDS ARROW
0x2193: [694,194,575,14,561], // DOWNWARDS ARROW
0x2194: [518,17,1150,64,1085], // LEFT RIGHT ARROW
0x2195: [767,267,575,14,561], // UP DOWN ARROW
0x2196: [724,194,1150,64,1084], // NORTH WEST ARROW
0x2197: [724,193,1150,64,1085], // NORTH EAST ARROW
0x2198: [694,224,1150,65,1085], // SOUTH EAST ARROW
0x2199: [694,224,1150,64,1085], // SOUTH WEST ARROW
0x21A6: [518,17,1150,65,1085], // RIGHTWARDS ARROW FROM BAR
0x21A9: [518,17,1282,64,1218], // LEFTWARDS ARROW WITH HOOK
0x21AA: [518,17,1282,65,1217], // RIGHTWARDS ARROW WITH HOOK
0x21BC: [518,-220,1150,64,1084], // LEFTWARDS HARPOON WITH BARB UPWARDS
0x21BD: [281,17,1150,64,1084], // LEFTWARDS HARPOON WITH BARB DOWNWARDS
0x21C0: [518,-220,1150,65,1085], // RIGHTWARDS HARPOON WITH BARB UPWARDS
0x21C1: [281,17,1150,64,1085], // RIGHTWARDS HARPOON WITH BARB DOWNWARDS
0x21CC: [718,17,1150,64,1085], // RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON
0x21D0: [547,46,1150,64,1085], // LEFTWARDS DOUBLE ARROW
0x21D1: [694,193,703,30,672], // UPWARDS DOUBLE ARROW
0x21D2: [547,46,1150,64,1084], // RIGHTWARDS DOUBLE ARROW
0x21D3: [694,194,703,30,672], // DOWNWARDS DOUBLE ARROW
0x21D4: [547,46,1150,47,1102], // LEFT RIGHT DOUBLE ARROW
0x21D5: [767,267,703,30,672], // UP DOWN DOUBLE ARROW
0x2200: [694,16,639,1,640], // FOR ALL
0x2202: [710,17,628,60,657], // PARTIAL DIFFERENTIAL
0x2203: [694,-1,639,64,574], // THERE EXISTS
0x2205: [767,73,575,46,528], // EMPTY SET
0x2207: [686,24,958,56,901], // NABLA
0x2208: [587,86,767,97,670], // ELEMENT OF
0x2209: [711,210,767,97,670], // stix-negated (vert) set membership, variant
0x220B: [587,86,767,96,670], // CONTAINS AS MEMBER
0x2212: [281,-221,894,96,797], // MINUS SIGN
0x2213: [537,227,894,64,829], // MINUS-OR-PLUS SIGN
0x2215: [750,250,575,63,511], // DIVISION SLASH
0x2216: [750,250,575,63,511], // SET MINUS
0x2217: [472,-28,575,73,501], // ASTERISK OPERATOR
0x2218: [474,-28,575,64,510], // RING OPERATOR
0x2219: [474,-28,575,64,510], // BULLET OPERATOR
0x221A: [820,180,958,78,988], // SQUARE ROOT
0x221D: [451,8,894,65,830], // PROPORTIONAL TO
0x221E: [452,8,1150,65,1084], // INFINITY
0x2220: [714,0,722,55,676], // ANGLE
0x2223: [750,249,319,129,190], // DIVIDES
0x2225: [750,248,575,145,430], // PARALLEL TO
0x2227: [604,17,767,64,702], // LOGICAL AND
0x2228: [604,16,767,64,702], // LOGICAL OR
0x2229: [603,16,767,64,702], // stix-intersection, serifs
0x222A: [604,16,767,64,702], // stix-union, serifs
0x222B: [711,211,569,64,632], // INTEGRAL
0x223C: [391,-109,894,64,828], // TILDE OPERATOR
0x2240: [583,82,319,64,254], // WREATH PRODUCT
0x2243: [502,3,894,64,829], // ASYMPTOTICALLY EQUAL TO
0x2245: [638,27,1000,64,829], // APPROXIMATELY EQUAL TO
0x2248: [524,-32,894,64,829], // ALMOST EQUAL TO
0x224D: [533,32,894,64,829], // EQUIVALENT TO
0x2250: [721,-109,894,64,829], // APPROACHES THE LIMIT
0x2260: [711,210,894,64,829], // stix-not (vert) equals
0x2261: [505,3,894,64,829], // IDENTICAL TO
0x2264: [697,199,894,96,797], // LESS-THAN OR EQUAL TO
0x2265: [697,199,894,96,797], // GREATER-THAN OR EQUAL TO
0x226A: [617,116,1150,64,1085], // MUCH LESS-THAN
0x226B: [618,116,1150,64,1085], // MUCH GREATER-THAN
0x227A: [585,86,894,96,797], // PRECEDES
0x227B: [586,86,894,96,797], // SUCCEEDS
0x2282: [587,85,894,96,797], // SUBSET OF
0x2283: [587,86,894,96,796], // SUPERSET OF
0x2286: [697,199,894,96,797], // SUBSET OF OR EQUAL TO
0x2287: [697,199,894,96,796], // SUPERSET OF OR EQUAL TO
0x228E: [604,16,767,64,702], // MULTISET UNION
0x2291: [697,199,894,96,828], // SQUARE IMAGE OF OR EQUAL TO
0x2292: [697,199,894,66,797], // SQUARE ORIGINAL OF OR EQUAL TO
0x2293: [604,-1,767,70,696], // stix-square intersection, serifs
0x2294: [604,-1,767,70,696], // stix-square union, serifs
0x2295: [632,132,894,64,828], // stix-circled plus (with rim)
0x2296: [632,132,894,64,828], // CIRCLED MINUS
0x2297: [632,132,894,64,828], // stix-circled times (with rim)
0x2298: [632,132,894,64,828], // CIRCLED DIVISION SLASH
0x2299: [632,132,894,64,828], // CIRCLED DOT OPERATOR
0x22A2: [693,-1,703,65,637], // RIGHT TACK
0x22A3: [693,-1,703,64,638], // LEFT TACK
0x22A4: [694,-1,894,64,829], // DOWN TACK
0x22A5: [693,-1,894,65,829], // UP TACK
0x22A8: [750,249,974,129,918], // TRUE
0x22C4: [523,21,575,15,560], // DIAMOND OPERATOR
0x22C5: [336,-166,319,74,245], // DOT OPERATOR
0x22C6: [502,0,575,24,550], // STAR OPERATOR
0x22C8: [540,39,1000,33,967], // BOWTIE
0x22EE: [951,29,319,74,245], // VERTICAL ELLIPSIS
0x22EF: [336,-166,1295,74,1221], // MIDLINE HORIZONTAL ELLIPSIS
0x22F1: [871,-101,1323,129,1194], // DOWN RIGHT DIAGONAL ELLIPSIS
0x2308: [750,248,511,194,493], // LEFT CEILING
0x2309: [750,248,511,17,317], // RIGHT CEILING
0x230A: [749,248,511,194,493], // LEFT FLOOR
0x230B: [749,248,511,17,317], // RIGHT FLOOR
0x2322: [405,-108,1150,65,1084], // stix-small down curve
0x2323: [392,-126,1150,64,1085], // stix-small up curve
0x25B3: [711,-1,1022,69,953], // WHITE UP-POINTING TRIANGLE
0x25B9: [540,39,575,33,542], // WHITE RIGHT-POINTING SMALL TRIANGLE
0x25BD: [500,210,1022,68,953], // WHITE DOWN-POINTING TRIANGLE
0x25C3: [539,38,575,33,542], // WHITE LEFT-POINTING SMALL TRIANGLE
0x25EF: [711,211,1150,65,1084], // LARGE CIRCLE
0x2660: [719,129,894,64,829], // BLACK SPADE SUIT
0x2661: [711,24,894,65,828], // WHITE HEART SUIT
0x2662: [719,154,894,64,828], // WHITE DIAMOND SUIT
0x2663: [719,129,894,32,861], // BLACK CLUB SUIT
0x266D: [750,17,447,64,381], // MUSIC FLAT SIGN
0x266E: [741,223,447,57,389], // MUSIC NATURAL SIGN
0x266F: [724,224,447,63,382], // MUSIC SHARP SIGN
0x27E8: [750,249,447,127,382], // MATHEMATICAL LEFT ANGLE BRACKET
0x27E9: [750,249,447,64,319], // MATHEMATICAL RIGHT ANGLE BRACKET
0x27F5: [518,17,1805,64,1741], // LONG LEFTWARDS ARROW
0x27F6: [518,17,1833,96,1773], // LONG RIGHTWARDS ARROW
0x27F7: [518,17,2126,64,2061], // LONG LEFT RIGHT ARROW
0x27F8: [547,46,1868,64,1804], // LONG LEFTWARDS DOUBLE ARROW
0x27F9: [547,46,1870,64,1804], // LONG RIGHTWARDS DOUBLE ARROW
0x27FA: [547,46,2126,64,2060], // LONG LEFT RIGHT DOUBLE ARROW
0x27FC: [518,17,1833,65,1773], // LONG RIGHTWARDS ARROW FROM BAR
0x2A3F: [686,0,900,39,860], // AMALGAMATION OR COPRODUCT
0x2AAF: [696,199,894,96,797], // PRECEDES ABOVE SINGLE-LINE EQUALS SIGN
0x2AB0: [697,199,894,96,797] // SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN
});
CHTML.fontLoaded("TeX/"+font.substr(8));
})(MathJax.OutputJax.CommonHTML);

View File

@ -0,0 +1,208 @@
/*************************************************************
*
* MathJax/jax/output/HTML-CSS/fonts/TeX/Math/BoldItalic/Main.js
*
* Copyright (c) 2009-2015 The MathJax Consortium
*
* 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 (CHTML) {
var font = 'MathJax_Math-BoldItalic';
CHTML.FONTDATA.FONTS[font] = {
className: CHTML.FONTDATA.familyName(font),
centerline: 255, ascent: 725, descent: 216,
weight: 'bold',
style: 'italic',
skew: {
0x41: 0.16,
0x42: 0.0958,
0x43: 0.0958,
0x44: 0.0639,
0x45: 0.0958,
0x46: 0.0958,
0x47: 0.0958,
0x48: 0.0639,
0x49: 0.128,
0x4A: 0.192,
0x4B: 0.0639,
0x4C: 0.0319,
0x4D: 0.0958,
0x4E: 0.0958,
0x4F: 0.0958,
0x50: 0.0958,
0x51: 0.0958,
0x52: 0.0958,
0x53: 0.0958,
0x54: 0.0958,
0x55: 0.0319,
0x58: 0.0958,
0x5A: 0.0958,
0x63: 0.0639,
0x64: 0.192,
0x65: 0.0639,
0x66: 0.192,
0x67: 0.0319,
0x68: -0.0319,
0x6C: 0.0958,
0x6F: 0.0639,
0x70: 0.0958,
0x71: 0.0958,
0x72: 0.0639,
0x73: 0.0639,
0x74: 0.0958,
0x75: 0.0319,
0x76: 0.0319,
0x77: 0.0958,
0x78: 0.0319,
0x79: 0.0639,
0x7A: 0.0639,
0x393: 0.0958,
0x394: 0.192,
0x398: 0.0958,
0x39B: 0.192,
0x39E: 0.0958,
0x3A0: 0.0639,
0x3A3: 0.0958,
0x3A5: 0.0639,
0x3A6: 0.0958,
0x3A8: 0.0639,
0x3A9: 0.0958,
0x3B1: 0.0319,
0x3B2: 0.0958,
0x3B4: 0.0639,
0x3B5: 0.0958,
0x3B6: 0.0958,
0x3B7: 0.0639,
0x3B8: 0.0958,
0x3B9: 0.0639,
0x3BC: 0.0319,
0x3BD: 0.0319,
0x3BE: 0.128,
0x3BF: 0.0639,
0x3C1: 0.0958,
0x3C2: 0.0958,
0x3C4: 0.0319,
0x3C5: 0.0319,
0x3C6: 0.0958,
0x3C7: 0.0639,
0x3C8: 0.128,
0x3D1: 0.0958,
0x3D5: 0.0958,
0x3F1: 0.0958,
0x3F5: 0.0639
},
0x20: [0,0,250,0,0], // SPACE
0x2F: [711,210,894,160,733], // SOLIDUS
0x41: [711,0,869,45,839], // LATIN CAPITAL LETTER A
0x42: [686,0,866,43,853], // LATIN CAPITAL LETTER B
0x43: [703,17,817,55,855], // LATIN CAPITAL LETTER C
0x44: [686,0,938,43,914], // LATIN CAPITAL LETTER D
0x45: [680,0,810,43,825], // LATIN CAPITAL LETTER E
0x46: [680,0,689,43,809], // LATIN CAPITAL LETTER F
0x47: [703,16,887,56,854], // LATIN CAPITAL LETTER G
0x48: [686,0,982,43,1027], // LATIN CAPITAL LETTER H
0x49: [686,0,511,30,573], // LATIN CAPITAL LETTER I
0x4A: [686,17,631,42,694], // LATIN CAPITAL LETTER J
0x4B: [686,0,971,43,1003], // LATIN CAPITAL LETTER K
0x4C: [686,0,756,43,711], // LATIN CAPITAL LETTER L
0x4D: [686,0,1142,43,1219], // LATIN CAPITAL LETTER M
0x4E: [686,0,950,43,1027], // LATIN CAPITAL LETTER N
0x4F: [703,17,837,53,815], // LATIN CAPITAL LETTER O
0x50: [686,0,723,43,847], // LATIN CAPITAL LETTER P
0x51: [703,194,869,53,815], // LATIN CAPITAL LETTER Q
0x52: [686,17,872,43,881], // LATIN CAPITAL LETTER R
0x53: [703,17,693,63,714], // LATIN CAPITAL LETTER S
0x54: [675,0,637,22,772], // LATIN CAPITAL LETTER T
0x55: [686,16,800,63,877], // LATIN CAPITAL LETTER U
0x56: [686,16,678,62,886], // LATIN CAPITAL LETTER V
0x57: [686,17,1093,61,1207], // LATIN CAPITAL LETTER W
0x58: [686,0,947,38,953], // LATIN CAPITAL LETTER X
0x59: [686,0,675,40,876], // LATIN CAPITAL LETTER Y
0x5A: [686,0,773,68,805], // LATIN CAPITAL LETTER Z
0x61: [452,8,633,38,607], // LATIN SMALL LETTER A
0x62: [694,8,521,45,513], // LATIN SMALL LETTER B
0x63: [451,8,513,40,509], // LATIN SMALL LETTER C
0x64: [694,8,610,38,612], // LATIN SMALL LETTER D
0x65: [452,8,554,42,509], // LATIN SMALL LETTER E
0x66: [701,201,568,64,624], // LATIN SMALL LETTER F
0x67: [452,202,545,0,540], // LATIN SMALL LETTER G
0x68: [694,8,668,45,642], // LATIN SMALL LETTER H
0x69: [694,8,405,24,367], // LATIN SMALL LETTER I
0x6A: [694,202,471,-12,456], // LATIN SMALL LETTER J
0x6B: [694,8,604,45,578], // LATIN SMALL LETTER K
0x6C: [694,8,348,27,296], // LATIN SMALL LETTER L
0x6D: [452,8,1032,24,1006], // LATIN SMALL LETTER M
0x6E: [452,8,713,24,687], // LATIN SMALL LETTER N
0x6F: [452,8,585,39,576], // LATIN SMALL LETTER O
0x70: [452,194,601,-23,593], // LATIN SMALL LETTER P
0x71: [452,194,542,38,550], // LATIN SMALL LETTER Q
0x72: [452,8,529,24,500], // LATIN SMALL LETTER R
0x73: [451,8,531,57,476], // LATIN SMALL LETTER S
0x74: [643,7,415,21,387], // LATIN SMALL LETTER T
0x75: [452,8,681,24,655], // LATIN SMALL LETTER U
0x76: [453,8,567,24,540], // LATIN SMALL LETTER V
0x77: [453,8,831,24,796], // LATIN SMALL LETTER W
0x78: [452,8,659,43,599], // LATIN SMALL LETTER X
0x79: [452,202,590,24,587], // LATIN SMALL LETTER Y
0x7A: [452,8,555,34,539], // LATIN SMALL LETTER Z
0xA0: [0,0,250,0,0], // NO-BREAK SPACE
0x393: [680,0,657,43,777], // GREEK CAPITAL LETTER GAMMA
0x394: [711,0,958,59,904], // GREEK CAPITAL LETTER DELTA
0x398: [702,17,867,54,844], // GREEK CAPITAL LETTER THETA
0x39B: [711,0,806,44,776], // GREEK CAPITAL LETTER LAMDA
0x39E: [675,0,841,62,867], // GREEK CAPITAL LETTER XI
0x3A0: [680,0,982,43,1026], // GREEK CAPITAL LETTER PI
0x3A3: [686,0,885,69,902], // GREEK CAPITAL LETTER SIGMA
0x3A5: [703,0,671,32,802], // GREEK CAPITAL LETTER UPSILON
0x3A6: [686,0,767,29,737], // GREEK CAPITAL LETTER PHI
0x3A8: [686,0,714,22,790], // GREEK CAPITAL LETTER PSI
0x3A9: [703,0,879,93,886], // GREEK CAPITAL LETTER OMEGA
0x3B1: [452,8,761,39,712], // GREEK SMALL LETTER ALPHA
0x3B2: [701,194,660,28,637], // GREEK SMALL LETTER BETA
0x3B3: [451,211,590,5,617], // GREEK SMALL LETTER GAMMA
0x3B4: [725,8,522,39,513], // GREEK SMALL LETTER DELTA
0x3B5: [461,17,529,36,481], // GREEK SMALL LETTER EPSILON
0x3B6: [711,202,508,48,521], // GREEK SMALL LETTER ZETA
0x3B7: [452,211,600,24,600], // GREEK SMALL LETTER ETA
0x3B8: [702,8,562,40,554], // GREEK SMALL LETTER THETA
0x3B9: [452,8,412,38,386], // GREEK SMALL LETTER IOTA
0x3BA: [452,8,668,45,642], // GREEK SMALL LETTER KAPPA
0x3BB: [694,13,671,40,652], // GREEK SMALL LETTER LAMDA
0x3BC: [452,211,708,33,682], // GREEK SMALL LETTER MU
0x3BD: [452,2,577,38,608], // GREEK SMALL LETTER NU
0x3BE: [711,201,508,23,490], // GREEK SMALL LETTER XI
0x3BF: [452,8,585,39,576], // GREEK SMALL LETTER OMICRON
0x3C0: [444,8,682,23,674], // GREEK SMALL LETTER PI
0x3C1: [451,211,612,34,603], // GREEK SMALL LETTER RHO
0x3C2: [451,105,424,33,457], // GREEK SMALL LETTER FINAL SIGMA
0x3C3: [444,8,686,35,677], // GREEK SMALL LETTER SIGMA
0x3C4: [444,13,521,23,610], // GREEK SMALL LETTER TAU
0x3C5: [453,8,631,24,604], // GREEK SMALL LETTER UPSILON
0x3C6: [452,216,747,53,703], // GREEK SMALL LETTER PHI
0x3C7: [452,201,718,32,685], // GREEK SMALL LETTER CHI
0x3C8: [694,202,758,24,732], // GREEK SMALL LETTER PSI
0x3C9: [453,8,718,24,691], // GREEK SMALL LETTER OMEGA
0x3D1: [701,8,692,24,656], // GREEK THETA SYMBOL
0x3D5: [694,202,712,51,693], // GREEK PHI SYMBOL
0x3D6: [444,8,975,23,961], // GREEK PI SYMBOL
0x3F1: [451,194,612,75,603], // GREEK RHO SYMBOL
0x3F5: [444,7,483,44,450] // GREEK LUNATE EPSILON SYMBOL
};
CHTML.fontLoaded("TeX/"+font.substr(8));
})(MathJax.OutputJax.CommonHTML);

Some files were not shown because too many files have changed in this diff Show More