diff --git a/modules/MathJax/MathJax.js b/modules/MathJax/MathJax.js new file mode 100644 index 0000000..922746f --- /dev/null +++ b/modules/MathJax/MathJax.js @@ -0,0 +1,3379 @@ +/* + * /MathJax.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. + */ + +if (document.getElementById && document.childNodes && document.createElement) { + if (!(window.MathJax && MathJax.Hub)) { + if (window.MathJax) { + window.MathJax = { + AuthorConfig: window.MathJax + } + } else { + window.MathJax = {} + } + MathJax.isPacked = true; + MathJax.version = "2.6.1"; + MathJax.fileversion = "2.6.1"; + MathJax.cdnVersion = "2.6.1"; + MathJax.cdnFileVersions = {}; + (function(d) { + var b = window[d]; + if (!b) { + b = window[d] = {} + } + var e = []; + var c = function(f) { + var g = f.constructor; + if (!g) { + g = function() {} + } + for (var h in f) { + if (h !== "constructor" && f.hasOwnProperty(h)) { + g[h] = f[h] + } + } + return g + }; + var a = function() { + return function() { + return arguments.callee.Init.call(this, arguments) + } + }; + b.Object = c({ + constructor: a(), + Subclass: function(f, h) { + var g = a(); + g.SUPER = this; + g.Init = this.Init; + g.Subclass = this.Subclass; + g.Augment = this.Augment; + g.protoFunction = this.protoFunction; + g.can = this.can; + g.has = this.has; + g.isa = this.isa; + g.prototype = new this(e); + g.prototype.constructor = g; + g.Augment(f, h); + return g + }, + Init: function(f) { + var g = this; + if (f.length === 1 && f[0] === e) { + return g + } + if (!(g instanceof f.callee)) { + g = new f.callee(e) + } + return g.Init.apply(g, f) || g + }, + Augment: function(f, g) { + var h; + if (f != null) { + for (h in f) { + if (f.hasOwnProperty(h)) { + this.protoFunction(h, f[h]) + } + } + if (f.toString !== this.prototype.toString && f.toString !== {}.toString) { + this.protoFunction("toString", f.toString) + } + } + if (g != null) { + for (h in g) { + if (g.hasOwnProperty(h)) { + this[h] = g[h] + } + } + } + return this + }, + protoFunction: function(g, f) { + this.prototype[g] = f; + if (typeof f === "function") { + f.SUPER = this.SUPER.prototype + } + }, + prototype: { + Init: function() {}, + SUPER: function(f) { + return f.callee.SUPER + }, + can: function(f) { + return typeof(this[f]) === "function" + }, + has: function(f) { + return typeof(this[f]) !== "undefined" + }, + isa: function(f) { + return (f instanceof Object) && (this instanceof f) + } + }, + can: function(f) { + return this.prototype.can.call(this, f) + }, + has: function(f) { + return this.prototype.has.call(this, f) + }, + isa: function(g) { + var f = this; + while (f) { + if (f === g) { + return true + } else { + f = f.SUPER + } + } + return false + }, + SimpleSUPER: c({ + constructor: function(f) { + return this.SimpleSUPER.define(f) + }, + define: function(f) { + var h = {}; + if (f != null) { + for (var g in f) { + if (f.hasOwnProperty(g)) { + h[g] = this.wrap(g, f[g]) + } + } + if (f.toString !== this.prototype.toString && f.toString !== {}.toString) { + h.toString = this.wrap("toString", f.toString) + } + } + return h + }, + wrap: function(i, h) { + if (typeof(h) !== "function" || !h.toString().match(/\.\s*SUPER\s*\(/)) { + return h + } + var g = function() { + this.SUPER = g.SUPER[i]; + try { + var f = h.apply(this, arguments) + } catch (j) { + delete this.SUPER; + throw j + } + delete this.SUPER; + return f + }; + g.toString = function() { + return h.toString.apply(h, arguments) + }; + return g + } + }) + }) + })("MathJax"); + (function(BASENAME) { + var BASE = window[BASENAME]; + if (!BASE) { + BASE = window[BASENAME] = {} + } + var CALLBACK = function(data) { + var cb = function() { + return arguments.callee.execute.apply(arguments.callee, arguments) + }; + for (var id in CALLBACK.prototype) { + if (CALLBACK.prototype.hasOwnProperty(id)) { + if (typeof(data[id]) !== "undefined") { + cb[id] = data[id] + } else { + cb[id] = CALLBACK.prototype[id] + } + } + } + cb.toString = CALLBACK.prototype.toString; + return cb + }; + CALLBACK.prototype = { + isCallback: true, + hook: function() {}, + data: [], + object: window, + execute: function() { + if (!this.called || this.autoReset) { + this.called = !this.autoReset; + return this.hook.apply(this.object, this.data.concat([].slice.call(arguments, 0))) + } + }, + reset: function() { + delete this.called + }, + toString: function() { + return this.hook.toString.apply(this.hook, arguments) + } + }; + var ISCALLBACK = function(f) { + return (typeof(f) === "function" && f.isCallback) + }; + var EVAL = function(code) { + return eval.call(window, code) + }; + var TESTEVAL = function() { + EVAL("var __TeSt_VaR__ = 1"); + if (window.__TeSt_VaR__) { + try { + delete window.__TeSt_VaR__ + } catch (error) { + window.__TeSt_VaR__ = null + } + } else { + if (window.execScript) { + EVAL = function(code) { + BASE.__code = code; + code = "try {" + BASENAME + ".__result = eval(" + BASENAME + ".__code)} catch(err) {" + BASENAME + ".__result = err}"; + window.execScript(code); + var result = BASE.__result; + delete BASE.__result; + delete BASE.__code; + if (result instanceof Error) { + throw result + } + return result + } + } else { + EVAL = function(code) { + BASE.__code = code; + code = "try {" + BASENAME + ".__result = eval(" + BASENAME + ".__code)} catch(err) {" + BASENAME + ".__result = err}"; + var head = (document.getElementsByTagName("head"))[0]; + if (!head) { + head = document.body + } + var script = document.createElement("script"); + script.appendChild(document.createTextNode(code)); + head.appendChild(script); + head.removeChild(script); + var result = BASE.__result; + delete BASE.__result; + delete BASE.__code; + if (result instanceof Error) { + throw result + } + return result + } + } + } + TESTEVAL = null + }; + var USING = function(args, i) { + if (arguments.length > 1) { + if (arguments.length === 2 && !(typeof arguments[0] === "function") && arguments[0] instanceof Object && typeof arguments[1] === "number") { + args = [].slice.call(args, i) + } else { + args = [].slice.call(arguments, 0) + } + } + if (args instanceof Array && args.length === 1) { + args = args[0] + } + if (typeof args === "function") { + if (args.execute === CALLBACK.prototype.execute) { + return args + } + return CALLBACK({ + hook: args + }) + } else { + if (args instanceof Array) { + if (typeof(args[0]) === "string" && args[1] instanceof Object && typeof args[1][args[0]] === "function") { + return CALLBACK({ + hook: args[1][args[0]], + object: args[1], + data: args.slice(2) + }) + } else { + if (typeof args[0] === "function") { + return CALLBACK({ + hook: args[0], + data: args.slice(1) + }) + } else { + if (typeof args[1] === "function") { + return CALLBACK({ + hook: args[1], + object: args[0], + data: args.slice(2) + }) + } + } + } + } else { + if (typeof(args) === "string") { + if (TESTEVAL) { + TESTEVAL() + } + return CALLBACK({ + hook: EVAL, + data: [args] + }) + } else { + if (args instanceof Object) { + return CALLBACK(args) + } else { + if (typeof(args) === "undefined") { + return CALLBACK({}) + } + } + } + } + } + throw Error("Can't make callback from given data") + }; + var DELAY = function(time, callback) { + callback = USING(callback); + callback.timeout = setTimeout(callback, time); + return callback + }; + var WAITFOR = function(callback, signal) { + callback = USING(callback); + if (!callback.called) { + WAITSIGNAL(callback, signal); + signal.pending++ + } + }; + var WAITEXECUTE = function() { + var signals = this.signal; + delete this.signal; + this.execute = this.oldExecute; + delete this.oldExecute; + var result = this.execute.apply(this, arguments); + if (ISCALLBACK(result) && !result.called) { + WAITSIGNAL(result, signals) + } else { + for (var i = 0, m = signals.length; i < m; i++) { + signals[i].pending--; + if (signals[i].pending <= 0) { + signals[i].call() + } + } + } + }; + var WAITSIGNAL = function(callback, signals) { + if (!(signals instanceof Array)) { + signals = [signals] + } + if (!callback.signal) { + callback.oldExecute = callback.execute; + callback.execute = WAITEXECUTE; + callback.signal = signals + } else { + if (signals.length === 1) { + callback.signal.push(signals[0]) + } else { + callback.signal = callback.signal.concat(signals) + } + } + }; + var AFTER = function(callback) { + callback = USING(callback); + callback.pending = 0; + for (var i = 1, m = arguments.length; i < m; i++) { + if (arguments[i]) { + WAITFOR(arguments[i], callback) + } + } + if (callback.pending === 0) { + var result = callback(); + if (ISCALLBACK(result)) { + callback = result + } + } + return callback + }; + var HOOKS = MathJax.Object.Subclass({ + Init: function(reset) { + this.hooks = []; + this.remove = []; + this.reset = reset; + this.running = false + }, + Add: function(hook, priority) { + if (priority == null) { + priority = 10 + } + if (!ISCALLBACK(hook)) { + hook = USING(hook) + } + hook.priority = priority; + var i = this.hooks.length; + while (i > 0 && priority < this.hooks[i - 1].priority) { + i-- + } + this.hooks.splice(i, 0, hook); + return hook + }, + Remove: function(hook) { + for (var i = 0, m = this.hooks.length; i < m; i++) { + if (this.hooks[i] === hook) { + if (this.running) { + this.remove.push(i) + } else { + this.hooks.splice(i, 1) + } + return + } + } + }, + Execute: function() { + var callbacks = [{}]; + this.running = true; + for (var i = 0, m = this.hooks.length; i < m; i++) { + if (this.reset) { + this.hooks[i].reset() + } + var result = this.hooks[i].apply(window, arguments); + if (ISCALLBACK(result) && !result.called) { + callbacks.push(result) + } + } + this.running = false; + if (this.remove.length) { + this.RemovePending() + } + if (callbacks.length === 1) { + return null + } + if (callbacks.length === 2) { + return callbacks[1] + } + return AFTER.apply({}, callbacks) + }, + RemovePending: function() { + this.remove = this.remove.sort(); + for (var i = this.remove.length - 1; i >= 0; i--) { + this.hooks.splice(i, 1) + } + this.remove = [] + } + }); + var EXECUTEHOOKS = function(hooks, data, reset) { + if (!hooks) { + return null + } + if (!(hooks instanceof Array)) { + hooks = [hooks] + } + if (!(data instanceof Array)) { + data = (data == null ? [] : [data]) + } + var handler = HOOKS(reset); + for (var i = 0, m = hooks.length; i < m; i++) { + handler.Add(hooks[i]) + } + return handler.Execute.apply(handler, data) + }; + var QUEUE = BASE.Object.Subclass({ + Init: function() { + this.pending = this.running = 0; + this.queue = []; + this.Push.apply(this, arguments) + }, + Push: function() { + var callback; + for (var i = 0, m = arguments.length; i < m; i++) { + callback = USING(arguments[i]); + if (callback === arguments[i] && !callback.called) { + callback = USING(["wait", this, callback]) + } + this.queue.push(callback) + } + if (!this.running && !this.pending) { + this.Process() + } + return callback + }, + Process: function(queue) { + while (!this.running && !this.pending && this.queue.length) { + var callback = this.queue[0]; + queue = this.queue.slice(1); + this.queue = []; + this.Suspend(); + var result = callback(); + this.Resume(); + if (queue.length) { + this.queue = queue.concat(this.queue) + } + if (ISCALLBACK(result) && !result.called) { + WAITFOR(result, this) + } + } + }, + Suspend: function() { + this.running++ + }, + Resume: function() { + if (this.running) { + this.running-- + } + }, + call: function() { + this.Process.apply(this, arguments) + }, + wait: function(callback) { + return callback + } + }); + var SIGNAL = QUEUE.Subclass({ + Init: function(name) { + QUEUE.prototype.Init.call(this); + this.name = name; + this.posted = []; + this.listeners = HOOKS(true); + this.posting = false; + this.callback = null + }, + Post: function(message, callback, forget) { + callback = USING(callback); + if (this.posting || this.pending) { + this.Push(["Post", this, message, callback, forget]) + } else { + this.callback = callback; + callback.reset(); + if (!forget) { + this.posted.push(message) + } + this.Suspend(); + this.posting = true; + var result = this.listeners.Execute(message); + if (ISCALLBACK(result) && !result.called) { + WAITFOR(result, this) + } + this.Resume(); + this.posting = false; + if (!this.pending) { + this.call() + } + } + return callback + }, + Clear: function(callback) { + callback = USING(callback); + if (this.posting || this.pending) { + callback = this.Push(["Clear", this, callback]) + } else { + this.posted = []; + callback() + } + return callback + }, + call: function() { + this.callback(this); + this.Process() + }, + Interest: function(callback, ignorePast, priority) { + callback = USING(callback); + this.listeners.Add(callback, priority); + if (!ignorePast) { + for (var i = 0, m = this.posted.length; i < m; i++) { + callback.reset(); + var result = callback(this.posted[i]); + if (ISCALLBACK(result) && i === this.posted.length - 1) { + WAITFOR(result, this) + } + } + } + return callback + }, + NoInterest: function(callback) { + this.listeners.Remove(callback) + }, + MessageHook: function(msg, callback, priority) { + callback = USING(callback); + if (!this.hooks) { + this.hooks = {}; + this.Interest(["ExecuteHooks", this]) + } + if (!this.hooks[msg]) { + this.hooks[msg] = HOOKS(true) + } + this.hooks[msg].Add(callback, priority); + for (var i = 0, m = this.posted.length; i < m; i++) { + if (this.posted[i] == msg) { + callback.reset(); + callback(this.posted[i]) + } + } + callback.msg = msg; + return callback + }, + ExecuteHooks: function(msg) { + var type = ((msg instanceof Array) ? msg[0] : msg); + if (!this.hooks[type]) { + return null + } + return this.hooks[type].Execute(msg) + }, + RemoveHook: function(hook) { + this.hooks[hook.msg].Remove(hook) + } + }, { + signals: {}, + find: function(name) { + if (!SIGNAL.signals[name]) { + SIGNAL.signals[name] = new SIGNAL(name) + } + return SIGNAL.signals[name] + } + }); + BASE.Callback = BASE.CallBack = USING; + BASE.Callback.Delay = DELAY; + BASE.Callback.After = AFTER; + BASE.Callback.Queue = QUEUE; + BASE.Callback.Signal = SIGNAL.find; + BASE.Callback.Hooks = HOOKS; + BASE.Callback.ExecuteHooks = EXECUTEHOOKS + })("MathJax"); + (function(e) { + var a = window[e]; + if (!a) { + a = window[e] = {} + } + var d = (navigator.vendor === "Apple Computer, Inc." && typeof navigator.vendorSub === "undefined"); + var g = 0; + var h = function(i) { + if (document.styleSheets && document.styleSheets.length > g) { + g = document.styleSheets.length + } + if (!i) { + i = document.head || ((document.getElementsByTagName("head"))[0]); + if (!i) { + i = document.body + } + } + return i + }; + var f = []; + var c = function() { + for (var k = 0, j = f.length; k < j; k++) { + a.Ajax.head.removeChild(f[k]) + } + f = [] + }; + var b = {}; + b[e] = ""; + a.Ajax = { + loaded: {}, + loading: {}, + loadHooks: {}, + timeout: 15 * 1000, + styleDelay: 1, + config: { + root: "", + path: b + }, + STATUS: { + OK: 1, + ERROR: -1 + }, + fileURL: function(j) { + var i = j.match(/^\[([-._a-z0-9]+)\]/i); + if (i && i[1] in b) { + j = (b[i[1]] || this.config.root) + j.substr(i[1].length + 2) + } + return j + }, + fileName: function(j) { + var i = this.config.root; + if (j.substr(0, i.length) === i) { + j = "[" + e + "]" + j.substr(i.length) + } else { + for (var k in b) { + if (b.hasOwnProperty(k) && b[k]) { + if (j.substr(0, b[k].length) === b[k]) { + j = "[" + k + "]" + j.substr(b[k].length); + break + } + } + } + } + return j + }, + fileRev: function(j) { + var i = a.cdnFileVersions[name] || a.cdnVersion; + if (i) { + i = "?rev=" + i + } + return i + }, + urlRev: function(i) { + return this.fileURL(i) + this.fileRev(i) + }, + Require: function(k, n) { + n = a.Callback(n); + var l; + if (k instanceof Object) { + for (var j in k) { + if (k.hasOwnProperty(j)) { + l = j.toUpperCase(); + k = k[j] + } + } + } else { + l = k.split(/\./).pop().toUpperCase() + } + k = this.fileURL(k); + if (this.loaded[k]) { + n(this.loaded[k]) + } else { + var m = {}; + m[l] = k; + this.Load(m, n) + } + return n + }, + Load: function(k, m) { + m = a.Callback(m); + var l; + if (k instanceof Object) { + for (var j in k) { + if (k.hasOwnProperty(j)) { + l = j.toUpperCase(); + k = k[j] + } + } + } else { + l = k.split(/\./).pop().toUpperCase() + } + k = this.fileURL(k); + if (this.loading[k]) { + this.addHook(k, m) + } else { + this.head = h(this.head); + if (this.loader[l]) { + this.loader[l].call(this, k, m) + } else { + throw Error("Can't load files of type " + l) + } + } + return m + }, + LoadHook: function(l, m, k) { + m = a.Callback(m); + if (l instanceof Object) { + for (var j in l) { + if (l.hasOwnProperty(j)) { + l = l[j] + } + } + } + l = this.fileURL(l); + if (this.loaded[l]) { + m(this.loaded[l]) + } else { + this.addHook(l, m, k) + } + return m + }, + addHook: function(j, k, i) { + if (!this.loadHooks[j]) { + this.loadHooks[j] = MathJax.Callback.Hooks() + } + this.loadHooks[j].Add(k, i); + k.file = j + }, + removeHook: function(i) { + if (this.loadHooks[i.file]) { + this.loadHooks[i.file].Remove(i); + if (!this.loadHooks[i.file].hooks.length) { + delete this.loadHooks[i.file] + } + } + }, + Preloading: function() { + for (var l = 0, j = arguments.length; l < j; l++) { + var k = this.fileURL(arguments[l]); + if (!this.loading[k]) { + this.loading[k] = { + preloaded: true + } + } + } + }, + loader: { + JS: function(k, m) { + var j = this.fileName(k); + var i = document.createElement("script"); + var l = a.Callback(["loadTimeout", this, k]); + this.loading[k] = { + callback: m, + timeout: setTimeout(l, this.timeout), + status: this.STATUS.OK, + script: i + }; + this.loading[k].message = a.Message.File(j); + i.onerror = l; + i.type = "text/javascript"; + i.src = k + this.fileRev(j); + this.head.appendChild(i) + }, + CSS: function(j, l) { + var i = this.fileName(j); + var k = document.createElement("link"); + k.rel = "stylesheet"; + k.type = "text/css"; + k.href = j + this.fileRev(i); + this.loading[j] = { + callback: l, + message: a.Message.File(i), + status: this.STATUS.OK + }; + this.head.appendChild(k); + this.timer.create.call(this, [this.timer.file, j], k) + } + }, + timer: { + create: function(j, i) { + j = a.Callback(j); + if (i.nodeName === "STYLE" && i.styleSheet && typeof(i.styleSheet.cssText) !== "undefined") { + j(this.STATUS.OK) + } else { + if (window.chrome && i.nodeName === "LINK") { + j(this.STATUS.OK) + } else { + if (d) { + this.timer.start(this, [this.timer.checkSafari2, g++, j], this.styleDelay) + } else { + this.timer.start(this, [this.timer.checkLength, i, j], this.styleDelay) + } + } + } + return j + }, + start: function(j, i, k, l) { + i = a.Callback(i); + i.execute = this.execute; + i.time = this.time; + i.STATUS = j.STATUS; + i.timeout = l || j.timeout; + i.delay = i.total = k || 0; + if (k) { + setTimeout(i, k) + } else { + i() + } + }, + time: function(i) { + this.total += this.delay; + this.delay = Math.floor(this.delay * 1.05 + 5); + if (this.total >= this.timeout) { + i(this.STATUS.ERROR); + return 1 + } + return 0 + }, + file: function(j, i) { + if (i < 0) { + a.Ajax.loadTimeout(j) + } else { + a.Ajax.loadComplete(j) + } + }, + execute: function() { + this.hook.call(this.object, this, this.data[0], this.data[1]) + }, + checkSafari2: function(i, j, k) { + if (i.time(k)) { + return + } + if (document.styleSheets.length > j && document.styleSheets[j].cssRules && document.styleSheets[j].cssRules.length) { + k(i.STATUS.OK) + } else { + setTimeout(i, i.delay) + } + }, + checkLength: function(i, l, n) { + if (i.time(n)) { + return + } + var m = 0; + var j = (l.sheet || l.styleSheet); + try { + if ((j.cssRules || j.rules || []).length > 0) { + m = 1 + } + } catch (k) { + if (k.message.match(/protected variable|restricted URI/)) { + m = 1 + } else { + if (k.message.match(/Security error/)) { + m = 1 + } + } + } + if (m) { + setTimeout(a.Callback([n, i.STATUS.OK]), 0) + } else { + setTimeout(i, i.delay) + } + } + }, + loadComplete: function(i) { + i = this.fileURL(i); + var j = this.loading[i]; + if (j && !j.preloaded) { + a.Message.Clear(j.message); + clearTimeout(j.timeout); + if (j.script) { + if (f.length === 0) { + setTimeout(c, 0) + } + f.push(j.script) + } + this.loaded[i] = j.status; + delete this.loading[i]; + this.addHook(i, j.callback) + } else { + if (j) { + delete this.loading[i] + } + this.loaded[i] = this.STATUS.OK; + j = { + status: this.STATUS.OK + } + } + if (!this.loadHooks[i]) { + return null + } + return this.loadHooks[i].Execute(j.status) + }, + loadTimeout: function(i) { + if (this.loading[i].timeout) { + clearTimeout(this.loading[i].timeout) + } + this.loading[i].status = this.STATUS.ERROR; + this.loadError(i); + this.loadComplete(i) + }, + loadError: function(i) { + a.Message.Set(["LoadFailed", "File failed to load: %1", i], null, 2000); + a.Hub.signal.Post(["file load error", i]) + }, + Styles: function(k, l) { + var i = this.StyleString(k); + if (i === "") { + l = a.Callback(l); + l() + } else { + var j = document.createElement("style"); + j.type = "text/css"; + this.head = h(this.head); + this.head.appendChild(j); + if (j.styleSheet && typeof(j.styleSheet.cssText) !== "undefined") { + j.styleSheet.cssText = i + } else { + j.appendChild(document.createTextNode(i)) + } + l = this.timer.create.call(this, l, j) + } + return l + }, + StyleString: function(n) { + if (typeof(n) === "string") { + return n + } + var k = "", + o, m; + for (o in n) { + if (n.hasOwnProperty(o)) { + if (typeof n[o] === "string") { + k += o + " {" + n[o] + "}\n" + } else { + if (n[o] instanceof Array) { + for (var l = 0; l < n[o].length; l++) { + m = {}; + m[o] = n[o][l]; + k += this.StyleString(m) + } + } else { + if (o.substr(0, 6) === "@media") { + k += o + " {" + this.StyleString(n[o]) + "}\n" + } else { + if (n[o] != null) { + m = []; + for (var j in n[o]) { + if (n[o].hasOwnProperty(j)) { + if (n[o][j] != null) { + m[m.length] = j + ": " + n[o][j] + } + } + } + k += o + " {" + m.join("; ") + "}\n" + } + } + } + } + } + } + return k + } + } + })("MathJax"); + MathJax.HTML = { + Element: function(d, f, e) { + var g = document.createElement(d), + h; + if (f) { + if (f.hasOwnProperty("style")) { + var c = f.style; + f.style = {}; + for (h in c) { + if (c.hasOwnProperty(h)) { + f.style[h.replace(/-([a-z])/g, this.ucMatch)] = c[h] + } + } + } + MathJax.Hub.Insert(g, f); + for (h in f) { + if (h === "role" || h.substr(0, 5) === "aria-") { + g.setAttribute(h, f[h]) + } + } + } + if (e) { + if (!(e instanceof Array)) { + e = [e] + } + for (var b = 0, a = e.length; b < a; b++) { + if (e[b] instanceof Array) { + g.appendChild(this.Element(e[b][0], e[b][1], e[b][2])) + } else { + if (d === "script") { + this.setScript(g, e[b]) + } else { + g.appendChild(document.createTextNode(e[b])) + } + } + } + } + return g + }, + ucMatch: function(a, b) { + return b.toUpperCase() + }, + addElement: function(b, a, d, c) { + return b.appendChild(this.Element(a, d, c)) + }, + TextNode: function(a) { + return document.createTextNode(a) + }, + addText: function(a, b) { + return a.appendChild(this.TextNode(b)) + }, + setScript: function(a, b) { + if (this.setScriptBug) { + a.text = b + } else { + while (a.firstChild) { + a.removeChild(a.firstChild) + } + this.addText(a, b) + } + }, + getScript: function(a) { + var b = (a.text === "" ? a.innerHTML : a.text); + return b.replace(/^\s+/, "").replace(/\s+$/, "") + }, + Cookie: { + prefix: "mjx", + expires: 365, + Set: function(a, e) { + var d = []; + if (e) { + for (var g in e) { + if (e.hasOwnProperty(g)) { + d.push(g + ":" + e[g].toString().replace(/&/g, "&&")) + } + } + } + var b = this.prefix + "." + a + "=" + escape(d.join("&;")); + if (this.expires) { + var f = new Date(); + f.setDate(f.getDate() + this.expires); + b += "; expires=" + f.toGMTString() + } + try { + document.cookie = b + "; path=/" + } catch (c) {} + }, + Get: function(a, d) { + if (!d) { + d = {} + } + var g = new RegExp("(?:^|;\\s*)" + this.prefix + "\\." + a + "=([^;]*)(?:;|$)"); + var f; + try { + f = g.exec(document.cookie) + } catch (c) {} + if (f && f[1] !== "") { + var j = unescape(f[1]).split("&;"); + for (var e = 0, b = j.length; e < b; e++) { + f = j[e].match(/([^:]+):(.*)/); + var h = f[2].replace(/&&/g, "&"); + if (h === "true") { + h = true + } else { + if (h === "false") { + h = false + } else { + if (h.match(/^-?(\d+(\.\d+)?|\.\d+)$/)) { + h = parseFloat(h) + } + } + } + d[f[1]] = h + } + } + return d + } + } + }; + MathJax.Localization = { + locale: "en", + directory: "[MathJax]/localization", + strings: { + ast: { + menuTitle: "asturianu" + }, + bg: { + menuTitle: "\u0431\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438" + }, + bcc: { + menuTitle: "\u0628\u0644\u0648\u0686\u06CC" + }, + br: { + menuTitle: "brezhoneg" + }, + ca: { + menuTitle: "catal\u00E0" + }, + cdo: { + menuTitle: "M\u00ECng-d\u0115\u0324ng-ng\u1E73\u0304" + }, + cs: { + menuTitle: "\u010De\u0161tina" + }, + da: { + menuTitle: "dansk" + }, + de: { + menuTitle: "Deutsch" + }, + en: { + menuTitle: "English", + isLoaded: true + }, + eo: { + menuTitle: "Esperanto" + }, + es: { + menuTitle: "espa\u00F1ol" + }, + fa: { + menuTitle: "\u0641\u0627\u0631\u0633\u06CC" + }, + fi: { + menuTitle: "suomi" + }, + fr: { + menuTitle: "fran\u00E7ais" + }, + gl: { + menuTitle: "galego" + }, + he: { + menuTitle: "\u05E2\u05D1\u05E8\u05D9\u05EA" + }, + ia: { + menuTitle: "interlingua" + }, + it: { + menuTitle: "italiano" + }, + ja: { + menuTitle: "\u65E5\u672C\u8A9E" + }, + kn: { + menuTitle: "\u0C95\u0CA8\u0CCD\u0CA8\u0CA1" + }, + ko: { + menuTitle: "\uD55C\uAD6D\uC5B4" + }, + lb: { + menuTitle: "L\u00EBtzebuergesch" + }, + lt: { + menuTitle: "lietuvi\u0173" + }, + mk: { + menuTitle: "\u043C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438" + }, + nl: { + menuTitle: "Nederlands" + }, + oc: { + menuTitle: "occitan" + }, + pl: { + menuTitle: "polski" + }, + pt: { + menuTitle: "portugus\u00EA" + }, + "pt-br": { + menuTitle: "portugu\u00EAs do Brasil" + }, + ru: { + menuTitle: "\u0440\u0443\u0441\u0441\u043A\u0438\u0439" + }, + sco: { + menuTitle: "Scots" + }, + scn: { + menuTitle: "sicilianu" + }, + sl: { + menuTitle: "sloven\u0161\u010Dina" + }, + sv: { + menuTitle: "svenska" + }, + tr: { + menuTitle: "T\u00FCrk\u00E7e" + }, + uk: { + menuTitle: "\u0443\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430" + }, + vi: { + menuTitle: "Ti\u1EBFng Vi\u1EC7t" + }, + "zh-hans": { + menuTitle: "\u4E2D\u6587\uFF08\u7B80\u4F53\uFF09" + } + }, + pattern: /%(\d+|\{\d+\}|\{[a-z]+:\%\d+(?:\|(?:%\{\d+\}|%.|[^\}])*)+\}|.)/g, + SPLIT: ("axb".split(/(x)/).length === 3 ? function(a, b) { + return a.split(b) + } : function(c, e) { + var a = [], + b, d = 0; + e.lastIndex = 0; + while ((b = e.exec(c))) { + a.push(c.substr(d, b.index - d)); + a.push.apply(a, b.slice(1)); + d = b.index + b[0].length + } + a.push(c.substr(d)); + return a + }), + _: function(b, a) { + if (a instanceof Array) { + return this.processSnippet(b, a) + } + return this.processString(this.lookupPhrase(b, a), [].slice.call(arguments, 2)) + }, + processString: function(l, o, g) { + var j, e; + for (j = 0, e = o.length; j < e; j++) { + if (g && o[j] instanceof Array) { + o[j] = this.processSnippet(g, o[j]) + } + } + var f = this.SPLIT(l, this.pattern); + for (j = 1, e = f.length; j < e; j += 2) { + var p = f[j].charAt(0); + if (p >= "0" && p <= "9") { + f[j] = o[f[j] - 1]; + if (typeof f[j] === "number") { + f[j] = this.number(f[j]) + } + } else { + if (p === "{") { + p = f[j].substr(1); + if (p >= "0" && p <= "9") { + f[j] = o[f[j].substr(1, f[j].length - 2) - 1]; + if (typeof f[j] === "number") { + f[j] = this.number(f[j]) + } + } else { + var k = f[j].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/); + if (k) { + if (k[1] === "plural") { + var d = o[k[2] - 1]; + if (typeof d === "undefined") { + f[j] = "???" + } else { + d = this.plural(d) - 1; + var h = k[3].replace(/(^|[^%])(%%)*%\|/g, "$1$2%\uEFEF").split(/\|/); + if (d >= 0 && d < h.length) { + f[j] = this.processString(h[d].replace(/\uEFEF/g, "|"), o, g) + } else { + f[j] = "???" + } + } + } else { + f[j] = "%" + f[j] + } + } + } + } + } + if (f[j] == null) { + f[j] = "???" + } + } + if (!g) { + return f.join("") + } + var a = [], + b = ""; + for (j = 0; j < e; j++) { + b += f[j]; + j++; + if (j < e) { + if (f[j] instanceof Array) { + a.push(b); + a = a.concat(f[j]); + b = "" + } else { + b += f[j] + } + } + } + if (b !== "") { + a.push(b) + } + return a + }, + processSnippet: function(g, e) { + var c = []; + for (var d = 0, b = e.length; d < b; d++) { + if (e[d] instanceof Array) { + var f = e[d]; + if (typeof f[1] === "string") { + var h = f[0]; + if (!(h instanceof Array)) { + h = [g, h] + } + var a = this.lookupPhrase(h, f[1]); + c = c.concat(this.processMarkdown(a, f.slice(2), g)) + } else { + if (f[1] instanceof Array) { + c = c.concat(this.processSnippet.apply(this, f)) + } else { + if (f.length >= 3) { + c.push([f[0], f[1], this.processSnippet(g, f[2])]) + } else { + c.push(e[d]) + } + } + } + } else { + c.push(e[d]) + } + } + return c + }, + markdownPattern: /(%.)|(\*{1,3})((?:%.|.)+?)\2|(`+)((?:%.|.)+?)\4|\[((?:%.|.)+?)\]\(([^\s\)]+)\)/, + processMarkdown: function(b, h, d) { + var j = [], + e; + var c = b.split(this.markdownPattern); + var g = c[0]; + for (var f = 1, a = c.length; f < a; f += 8) { + if (c[f + 1]) { + e = this.processString(c[f + 2], h, d); + if (!(e instanceof Array)) { + e = [e] + } + e = [ + ["b", "i", "i"][c[f + 1].length - 1], {}, + e + ]; + if (c[f + 1].length === 3) { + e = ["b", {}, e] + } + } else { + if (c[f + 3]) { + e = this.processString(c[f + 4].replace(/^\s/, "").replace(/\s$/, ""), h, d); + if (!(e instanceof Array)) { + e = [e] + } + e = ["code", {}, e] + } else { + if (c[f + 5]) { + e = this.processString(c[f + 5], h, d); + if (!(e instanceof Array)) { + e = [e] + } + e = ["a", { + href: this.processString(c[f + 6], h), + target: "_blank" + }, e] + } else { + g += c[f]; + e = null + } + } + } + if (e) { + j = this.concatString(j, g, h, d); + j.push(e); + g = "" + } + if (c[f + 7] !== "") { + g += c[f + 7] + } + } + j = this.concatString(j, g, h, d); + return j + }, + concatString: function(a, c, b, d) { + if (c != "") { + c = this.processString(c, b, d); + if (!(c instanceof Array)) { + c = [c] + } + a = a.concat(c) + } + return a + }, + lookupPhrase: function(f, a, d) { + if (!d) { + d = "_" + } + if (f instanceof Array) { + d = (f[0] || "_"); + f = (f[1] || "") + } + var c = this.loadDomain(d); + if (c) { + MathJax.Hub.RestartAfter(c) + } + var b = this.strings[this.locale]; + if (b) { + if (b.domains && d in b.domains) { + var e = b.domains[d]; + if (e.strings && f in e.strings) { + a = e.strings[f] + } + } + } + return a + }, + loadFile: function(b, d, e) { + e = MathJax.Callback(e); + b = (d.file || b); + if (!b.match(/\.js$/)) { + b += ".js" + } + if (!b.match(/^([a-z]+:|\[MathJax\])/)) { + var a = (this.strings[this.locale].directory || this.directory + "/" + this.locale || "[MathJax]/localization/" + this.locale); + b = a + "/" + b + } + var c = MathJax.Ajax.Require(b, function() { + d.isLoaded = true; + return e() + }); + return (c.called ? null : c) + }, + loadDomain: function(c, e) { + var b, a = this.strings[this.locale]; + if (a) { + if (!a.isLoaded) { + b = this.loadFile(this.locale, a); + if (b) { + return MathJax.Callback.Queue(b, ["loadDomain", this, c]).Push(e || {}) + } + } + if (a.domains && c in a.domains) { + var d = a.domains[c]; + if (!d.isLoaded) { + b = this.loadFile(c, d); + if (b) { + return MathJax.Callback.Queue(b).Push(e) + } + } + } + } + return MathJax.Callback(e)() + }, + Try: function(a) { + a = MathJax.Callback(a); + a.autoReset = true; + try { + a() + } catch (b) { + if (!b.restart) { + throw b + } + MathJax.Callback.After(["Try", this, a], b.restart) + } + }, + resetLocale: function(a) { + if (!a) { + return + } + a = a.toLowerCase(); + while (!this.strings[a]) { + var c = a.lastIndexOf("-"); + if (c === -1) { + return + } + a = a.substring(0, c) + } + var b = this.strings[a].remap; + this.locale = b ? b : a + }, + setLocale: function(a) { + this.resetLocale(a); + if (MathJax.Menu) { + this.loadDomain("MathMenu") + } + }, + addTranslation: function(b, e, c) { + var d = this.strings[b], + a = false; + if (!d) { + d = this.strings[b] = {}; + a = true + } + if (!d.domains) { + d.domains = {} + } + if (e) { + if (!d.domains[e]) { + d.domains[e] = {} + } + d = d.domains[e] + } + MathJax.Hub.Insert(d, c); + if (a && MathJax.Menu.menu) { + MathJax.Menu.CreateLocaleMenu() + } + }, + setCSS: function(b) { + var a = this.strings[this.locale]; + if (a) { + if (a.fontFamily) { + b.style.fontFamily = a.fontFamily + } + if (a.fontDirection) { + b.style.direction = a.fontDirection; + if (a.fontDirection === "rtl") { + b.style.textAlign = "right" + } + } + } + return b + }, + fontFamily: function() { + var a = this.strings[this.locale]; + return (a ? a.fontFamily : null) + }, + fontDirection: function() { + var a = this.strings[this.locale]; + return (a ? a.fontDirection : null) + }, + plural: function(b) { + var a = this.strings[this.locale]; + if (a && a.plural) { + return a.plural(b) + } + if (b == 1) { + return 1 + } + return 2 + }, + number: function(b) { + var a = this.strings[this.locale]; + if (a && a.number) { + return a.number(b) + } + return b + } + }; + MathJax.Message = { + ready: false, + log: [{}], + current: null, + textNodeBug: (navigator.vendor === "Apple Computer, Inc." && typeof navigator.vendorSub === "undefined") || (window.hasOwnProperty && window.hasOwnProperty("konqueror")), + styles: { + "#MathJax_Message": { + position: "fixed", + left: "1px", + bottom: "2px", + "background-color": "#E6E6E6", + border: "1px solid #959595", + margin: "0px", + padding: "2px 8px", + "z-index": "102", + color: "black", + "font-size": "80%", + width: "auto", + "white-space": "nowrap" + }, + "#MathJax_MSIE_Frame": { + position: "absolute", + top: 0, + left: 0, + width: "0px", + "z-index": 101, + border: "0px", + margin: "0px", + padding: "0px" + } + }, + browsers: { + MSIE: function(a) { + MathJax.Message.msieFixedPositionBug = ((document.documentMode || 0) < 7); + if (MathJax.Message.msieFixedPositionBug) { + MathJax.Hub.config.styles["#MathJax_Message"].position = "absolute" + } + MathJax.Message.quirks = (document.compatMode === "BackCompat") + }, + Chrome: function(a) { + MathJax.Hub.config.styles["#MathJax_Message"].bottom = "1.5em"; + MathJax.Hub.config.styles["#MathJax_Message"].left = "1em" + } + }, + Init: function(a) { + if (a) { + this.ready = true + } + if (!document.body || !this.ready) { + return false + } + if (this.div && this.div.parentNode == null) { + this.div = document.getElementById("MathJax_Message"); + if (this.div) { + this.text = this.div.firstChild + } + } + if (!this.div) { + var b = document.body; + if (this.msieFixedPositionBug && window.attachEvent) { + b = this.frame = this.addDiv(document.body); + b.removeAttribute("id"); + b.style.position = "absolute"; + b.style.border = b.style.margin = b.style.padding = "0px"; + b.style.zIndex = "101"; + b.style.height = "0px"; + b = this.addDiv(b); + b.id = "MathJax_MSIE_Frame"; + window.attachEvent("onscroll", this.MoveFrame); + window.attachEvent("onresize", this.MoveFrame); + this.MoveFrame() + } + this.div = this.addDiv(b); + this.div.style.display = "none"; + this.text = this.div.appendChild(document.createTextNode("")) + } + return true + }, + addDiv: function(a) { + var b = document.createElement("div"); + b.id = "MathJax_Message"; + if (a.firstChild) { + a.insertBefore(b, a.firstChild) + } else { + a.appendChild(b) + } + return b + }, + MoveFrame: function() { + var a = (MathJax.Message.quirks ? document.body : document.documentElement); + var b = MathJax.Message.frame; + b.style.left = a.scrollLeft + "px"; + b.style.top = a.scrollTop + "px"; + b.style.width = a.clientWidth + "px"; + b = b.firstChild; + b.style.height = a.clientHeight + "px" + }, + localize: function(a) { + return MathJax.Localization._(a, a) + }, + filterText: function(a, c, b) { + if (MathJax.Hub.config.messageStyle === "simple") { + if (b === "LoadFile") { + if (!this.loading) { + this.loading = this.localize("Loading") + " " + } + a = this.loading; + this.loading += "." + } else { + if (b === "ProcessMath") { + if (!this.processing) { + this.processing = this.localize("Processing") + " " + } + a = this.processing; + this.processing += "." + } else { + if (b === "TypesetMath") { + if (!this.typesetting) { + this.typesetting = this.localize("Typesetting") + " " + } + a = this.typesetting; + this.typesetting += "." + } + } + } + } + return a + }, + Set: function(c, e, b) { + if (e == null) { + e = this.log.length; + this.log[e] = {} + } + var d = ""; + if (c instanceof Array) { + d = c[0]; + if (d instanceof Array) { + d = d[1] + } + try { + c = MathJax.Localization._.apply(MathJax.Localization, c) + } catch (a) { + if (!a.restart) { + throw a + } + if (!a.restart.called) { + if (this.log[e].restarted == null) { + this.log[e].restarted = 0 + } + this.log[e].restarted++; + delete this.log[e].cleared; + MathJax.Callback.After(["Set", this, c, e, b], a.restart); + return e + } + } + } + if (this.timer) { + clearTimeout(this.timer); + delete this.timer + } + this.log[e].text = c; + this.log[e].filteredText = c = this.filterText(c, e, d); + if (typeof(this.log[e].next) === "undefined") { + this.log[e].next = this.current; + if (this.current != null) { + this.log[this.current].prev = e + } + this.current = e + } + if (this.current === e && MathJax.Hub.config.messageStyle !== "none") { + if (this.Init()) { + if (this.textNodeBug) { + this.div.innerHTML = c + } else { + this.text.nodeValue = c + } + this.div.style.display = ""; + if (this.status) { + window.status = ""; + delete this.status + } + } else { + window.status = c; + this.status = true + } + } + if (this.log[e].restarted) { + if (this.log[e].cleared) { + b = 0 + } + if (--this.log[e].restarted === 0) { + delete this.log[e].cleared + } + } + if (b) { + setTimeout(MathJax.Callback(["Clear", this, e]), b) + } else { + if (b == 0) { + this.Clear(e, 0) + } + } + return e + }, + Clear: function(b, a) { + if (this.log[b].prev != null) { + this.log[this.log[b].prev].next = this.log[b].next + } + if (this.log[b].next != null) { + this.log[this.log[b].next].prev = this.log[b].prev + } + if (this.current === b) { + this.current = this.log[b].next; + if (this.text) { + if (this.div.parentNode == null) { + this.Init() + } + if (this.current == null) { + if (this.timer) { + clearTimeout(this.timer); + delete this.timer + } + if (a == null) { + a = 600 + } + if (a === 0) { + this.Remove() + } else { + this.timer = setTimeout(MathJax.Callback(["Remove", this]), a) + } + } else { + if (MathJax.Hub.config.messageStyle !== "none") { + if (this.textNodeBug) { + this.div.innerHTML = this.log[this.current].filteredText + } else { + this.text.nodeValue = this.log[this.current].filteredText + } + } + } + if (this.status) { + window.status = ""; + delete this.status + } + } else { + if (this.status) { + window.status = (this.current == null ? "" : this.log[this.current].text) + } + } + } + delete this.log[b].next; + delete this.log[b].prev; + delete this.log[b].filteredText; + if (this.log[b].restarted) { + this.log[b].cleared = true + } + }, + Remove: function() { + this.text.nodeValue = ""; + this.div.style.display = "none" + }, + File: function(a) { + return this.Set(["LoadFile", "Loading %1", a], null, null) + }, + Log: function() { + var b = []; + for (var c = 1, a = this.log.length; c < a; c++) { + b[c] = this.log[c].text + } + return b.join("\n") + } + }; + MathJax.Hub = { + config: { + root: "", + config: [], + styleSheets: [], + styles: { + ".MathJax_Preview": { + color: "#888" + } + }, + jax: [], + extensions: [], + preJax: null, + postJax: null, + displayAlign: "center", + displayIndent: "0", + preRemoveClass: "MathJax_Preview", + showProcessingMessages: true, + messageStyle: "normal", + delayStartupUntil: "none", + skipStartupTypeset: false, + elements: [], + positionToHash: true, + showMathMenu: true, + showMathMenuMSIE: true, + menuSettings: { + zoom: "None", + CTRL: false, + ALT: false, + CMD: false, + Shift: false, + discoverable: false, + zscale: "200%", + renderer: null, + font: "Auto", + context: "MathJax", + locale: null, + mpContext: false, + mpMouse: false, + texHints: true, + FastPreview: null, + assistiveMML: null, + inTabOrder: true, + semantics: false + }, + errorSettings: { + message: ["[", ["MathProcessingError", "Math Processing Error"], "]"], + style: { + color: "#CC0000", + "font-style": "italic" + } + }, + ignoreMMLattributes: {} + }, + preProcessors: MathJax.Callback.Hooks(true), + inputJax: {}, + outputJax: { + order: {} + }, + processSectionDelay: 50, + processUpdateTime: 250, + processUpdateDelay: 10, + signal: MathJax.Callback.Signal("Hub"), + Config: function(a) { + this.Insert(this.config, a); + if (this.config.Augment) { + this.Augment(this.config.Augment) + } + }, + CombineConfig: function(c, f) { + var b = this.config, + g, e; + c = c.split(/\./); + for (var d = 0, a = c.length; d < a; d++) { + g = c[d]; + if (!b[g]) { + b[g] = {} + } + e = b; + b = b[g] + } + e[g] = b = this.Insert(f, b); + return b + }, + Register: { + PreProcessor: function() { + return MathJax.Hub.preProcessors.Add.apply(MathJax.Hub.preProcessors, arguments) + }, + MessageHook: function() { + return MathJax.Hub.signal.MessageHook.apply(MathJax.Hub.signal, arguments) + }, + StartupHook: function() { + return MathJax.Hub.Startup.signal.MessageHook.apply(MathJax.Hub.Startup.signal, arguments) + }, + LoadHook: function() { + return MathJax.Ajax.LoadHook.apply(MathJax.Ajax, arguments) + } + }, + UnRegister: { + PreProcessor: function(a) { + MathJax.Hub.preProcessors.Remove(a) + }, + MessageHook: function(a) { + MathJax.Hub.signal.RemoveHook(a) + }, + StartupHook: function(a) { + MathJax.Hub.Startup.signal.RemoveHook(a) + }, + LoadHook: function(a) { + MathJax.Ajax.removeHook(a) + } + }, + getAllJax: function(e) { + var c = [], + b = this.elementScripts(e); + for (var d = 0, a = b.length; d < a; d++) { + if (b[d].MathJax && b[d].MathJax.elementJax) { + c.push(b[d].MathJax.elementJax) + } + } + return c + }, + getJaxByType: function(f, e) { + var c = [], + b = this.elementScripts(e); + for (var d = 0, a = b.length; d < a; d++) { + if (b[d].MathJax && b[d].MathJax.elementJax && b[d].MathJax.elementJax.mimeType === f) { + c.push(b[d].MathJax.elementJax) + } + } + return c + }, + getJaxByInputType: function(f, e) { + var c = [], + b = this.elementScripts(e); + for (var d = 0, a = b.length; d < a; d++) { + if (b[d].MathJax && b[d].MathJax.elementJax && b[d].type && b[d].type.replace(/ *;(.|\s)*/, "") === f) { + c.push(b[d].MathJax.elementJax) + } + } + return c + }, + getJaxFor: function(a) { + if (typeof(a) === "string") { + a = document.getElementById(a) + } + if (a && a.MathJax) { + return a.MathJax.elementJax + } + if (this.isMathJaxNode(a)) { + if (!a.isMathJax) { + a = a.firstChild + } + while (a && !a.jaxID) { + a = a.parentNode + } + if (a) { + return MathJax.OutputJax[a.jaxID].getJaxFromMath(a) + } + } + return null + }, + isJax: function(a) { + if (typeof(a) === "string") { + a = document.getElementById(a) + } + if (this.isMathJaxNode(a)) { + return 1 + } + if (a && (a.tagName || "").toLowerCase() === "script") { + if (a.MathJax) { + return (a.MathJax.state === MathJax.ElementJax.STATE.PROCESSED ? 1 : -1) + } + if (a.type && this.inputJax[a.type.replace(/ *;(.|\s)*/, "")]) { + return -1 + } + } + return 0 + }, + isMathJaxNode: function(a) { + return !!a && (a.isMathJax || (a.className || "") === "MathJax_MathML") + }, + setRenderer: function(d, c) { + if (!d) { + return + } + if (!MathJax.OutputJax[d]) { + this.config.menuSettings.renderer = ""; + var b = "[MathJax]/jax/output/" + d + "/config.js"; + return MathJax.Ajax.Require(b, ["setRenderer", this, d, c]) + } else { + this.config.menuSettings.renderer = d; + if (c == null) { + c = "jax/mml" + } + var a = this.outputJax; + if (a[c] && a[c].length) { + if (d !== a[c][0].id) { + a[c].unshift(MathJax.OutputJax[d]); + return this.signal.Post(["Renderer Selected", d]) + } + } + return null + } + }, + Queue: function() { + return this.queue.Push.apply(this.queue, arguments) + }, + Typeset: function(c, d) { + if (!MathJax.isReady) { + return null + } + var b = this.elementCallback(c, d); + if (b.count) { + var a = MathJax.Callback.Queue(["PreProcess", this, b.elements], ["Process", this, b.elements]) + } + return a.Push(b.callback) + }, + PreProcess: function(e, g) { + var c = this.elementCallback(e, g); + var b = MathJax.Callback.Queue(); + if (c.count) { + var f = (c.count === 1 ? [c.elements] : c.elements); + b.Push(["Post", this.signal, ["Begin PreProcess", c.elements]]); + for (var d = 0, a = f.length; d < a; d++) { + if (f[d]) { + b.Push(["Execute", this.preProcessors, f[d]]) + } + } + b.Push(["Post", this.signal, ["End PreProcess", c.elements]]) + } + return b.Push(c.callback) + }, + Process: function(a, b) { + return this.takeAction("Process", a, b) + }, + Update: function(a, b) { + return this.takeAction("Update", a, b) + }, + Reprocess: function(a, b) { + return this.takeAction("Reprocess", a, b) + }, + Rerender: function(a, b) { + return this.takeAction("Rerender", a, b) + }, + takeAction: function(g, d, h) { + var c = this.elementCallback(d, h); + var f = c.elements; + var a = MathJax.Callback.Queue(["Clear", this.signal]); + var e = { + scripts: [], + start: new Date().getTime(), + i: 0, + j: 0, + jax: {}, + jaxIDs: [] + }; + if (c.count) { + var b = ["Delay", MathJax.Callback, this.processSectionDelay]; + if (!b[2]) { + b = {} + } + a.Push(["Post", this.signal, ["Begin " + g, f]], ["Post", this.signal, ["Begin Math", f, g]], ["prepareScripts", this, g, f, e], ["Post", this.signal, ["Begin Math Input", f, g]], ["processInput", this, e], ["Post", this.signal, ["End Math Input", f, g]], b, ["prepareOutput", this, e, "preProcess"], b, ["Post", this.signal, ["Begin Math Output", f, g]], ["processOutput", this, e], ["Post", this.signal, ["End Math Output", f, g]], b, ["prepareOutput", this, e, "postProcess"], b, ["Post", this.signal, ["End Math", f, g]], ["Post", this.signal, ["End " + g, f]]) + } + return a.Push(c.callback) + }, + scriptAction: { + Process: function(a) {}, + Update: function(b) { + var a = b.MathJax.elementJax; + if (a && a.needsUpdate()) { + a.Remove(true); + b.MathJax.state = a.STATE.UPDATE + } else { + b.MathJax.state = a.STATE.PROCESSED + } + }, + Reprocess: function(b) { + var a = b.MathJax.elementJax; + if (a) { + a.Remove(true); + b.MathJax.state = a.STATE.UPDATE + } + }, + Rerender: function(b) { + var a = b.MathJax.elementJax; + if (a) { + a.Remove(true); + b.MathJax.state = a.STATE.OUTPUT + } + } + }, + prepareScripts: function(h, e, g) { + if (arguments.callee.disabled) { + return + } + var b = this.elementScripts(e); + var f = MathJax.ElementJax.STATE; + for (var d = 0, a = b.length; d < a; d++) { + var c = b[d]; + if (c.type && this.inputJax[c.type.replace(/ *;(.|\n)*/, "")]) { + if (c.MathJax) { + if (c.MathJax.elementJax && c.MathJax.elementJax.hover) { + MathJax.Extension.MathEvents.Hover.ClearHover(c.MathJax.elementJax) + } + if (c.MathJax.state !== f.PENDING) { + this.scriptAction[h](c) + } + } + if (!c.MathJax) { + c.MathJax = { + state: f.PENDING + } + } + if (c.MathJax.error) { + delete c.MathJax.error + } + if (c.MathJax.state !== f.PROCESSED) { + g.scripts.push(c) + } + } + } + }, + checkScriptSiblings: function(a) { + if (a.MathJax.checked) { + return + } + var b = this.config, + f = a.previousSibling; + if (f && f.nodeName === "#text") { + var d, e, c = a.nextSibling; + if (c && c.nodeName !== "#text") { + c = null + } + if (b.preJax) { + if (typeof(b.preJax) === "string") { + b.preJax = new RegExp(b.preJax + "$") + } + d = f.nodeValue.match(b.preJax) + } + if (b.postJax && c) { + if (typeof(b.postJax) === "string") { + b.postJax = new RegExp("^" + b.postJax) + } + e = c.nodeValue.match(b.postJax) + } + if (d && (!b.postJax || e)) { + f.nodeValue = f.nodeValue.replace(b.preJax, (d.length > 1 ? d[1] : "")); + f = null + } + if (e && (!b.preJax || d)) { + c.nodeValue = c.nodeValue.replace(b.postJax, (e.length > 1 ? e[1] : "")) + } + if (f && !f.nodeValue.match(/\S/)) { + f = f.previousSibling + } + } + if (b.preRemoveClass && f && f.className === b.preRemoveClass) { + a.MathJax.preview = f + } + a.MathJax.checked = 1 + }, + processInput: function(a) { + var b, i = MathJax.ElementJax.STATE; + var h, e, d = a.scripts.length; + try { + while (a.i < d) { + h = a.scripts[a.i]; + if (!h) { + a.i++; + continue + } + e = h.previousSibling; + if (e && e.className === "MathJax_Error") { + e.parentNode.removeChild(e) + } + if (!h.MathJax || h.MathJax.state === i.PROCESSED) { + a.i++; + continue + } + if (!h.MathJax.elementJax || h.MathJax.state === i.UPDATE) { + this.checkScriptSiblings(h); + var g = h.type.replace(/ *;(.|\s)*/, ""); + var j = this.inputJax[g]; + b = j.Process(h, a); + if (typeof b === "function") { + if (b.called) { + continue + } + this.RestartAfter(b) + } + b = b.Attach(h, j.id); + this.saveScript(b, a, h, i); + this.postInputHooks.Execute(b, j.id, h) + } else { + if (h.MathJax.state === i.OUTPUT) { + this.saveScript(h.MathJax.elementJax, a, h, i) + } + } + a.i++; + var c = new Date().getTime(); + if (c - a.start > this.processUpdateTime && a.i < a.scripts.length) { + a.start = c; + this.RestartAfter(MathJax.Callback.Delay(1)) + } + } + } catch (f) { + return this.processError(f, a, "Input") + } + if (a.scripts.length && this.config.showProcessingMessages) { + MathJax.Message.Set(["ProcessMath", "Processing math: %1%%", 100], 0) + } + a.start = new Date().getTime(); + a.i = a.j = 0; + return null + }, + postInputHooks: MathJax.Callback.Hooks(true), + saveScript: function(a, d, b, c) { + if (!this.outputJax[a.mimeType]) { + b.MathJax.state = c.UPDATE; + throw Error("No output jax registered for " + a.mimeType) + } + a.outputJax = this.outputJax[a.mimeType][0].id; + if (!d.jax[a.outputJax]) { + if (d.jaxIDs.length === 0) { + d.jax[a.outputJax] = d.scripts + } else { + if (d.jaxIDs.length === 1) { + d.jax[d.jaxIDs[0]] = d.scripts.slice(0, d.i) + } + d.jax[a.outputJax] = [] + } + d.jaxIDs.push(a.outputJax) + } + if (d.jaxIDs.length > 1) { + d.jax[a.outputJax].push(b) + } + b.MathJax.state = c.OUTPUT + }, + prepareOutput: function(c, f) { + while (c.j < c.jaxIDs.length) { + var e = c.jaxIDs[c.j], + d = MathJax.OutputJax[e]; + if (d[f]) { + try { + var a = d[f](c); + if (typeof a === "function") { + if (a.called) { + continue + } + this.RestartAfter(a) + } + } catch (b) { + if (!b.restart) { + MathJax.Message.Set(["PrepError", "Error preparing %1 output (%2)", e, f], null, 600); + MathJax.Hub.lastPrepError = b; + c.j++ + } + return MathJax.Callback.After(["prepareOutput", this, c, f], b.restart) + } + } + c.j++ + } + return null + }, + processOutput: function(h) { + var b, g = MathJax.ElementJax.STATE, + d, a = h.scripts.length; + try { + while (h.i < a) { + d = h.scripts[h.i]; + if (!d || !d.MathJax || d.MathJax.error) { + h.i++; + continue + } + var c = d.MathJax.elementJax; + if (!c) { + h.i++; + continue + } + b = MathJax.OutputJax[c.outputJax].Process(d, h); + if (b !== false) { + d.MathJax.state = g.PROCESSED; + if (d.MathJax.preview) { + d.MathJax.preview.innerHTML = "" + } + this.signal.Post(["New Math", c.inputID]) + } + h.i++; + var e = new Date().getTime(); + if (e - h.start > this.processUpdateTime && h.i < h.scripts.length) { + h.start = e; + this.RestartAfter(MathJax.Callback.Delay(this.processUpdateDelay)) + } + } + } catch (f) { + return this.processError(f, h, "Output") + } + if (h.scripts.length && this.config.showProcessingMessages) { + MathJax.Message.Set(["TypesetMath", "Typesetting math: %1%%", 100], 0); + MathJax.Message.Clear(0) + } + h.i = h.j = 0; + return null + }, + processMessage: function(d, b) { + var a = Math.floor(d.i / (d.scripts.length) * 100); + var c = (b === "Output" ? ["TypesetMath", "Typesetting math: %1%%"] : ["ProcessMath", "Processing math: %1%%"]); + if (this.config.showProcessingMessages) { + MathJax.Message.Set(c.concat(a), 0) + } + }, + processError: function(b, c, a) { + if (!b.restart) { + if (!this.config.errorSettings.message) { + throw b + } + this.formatError(c.scripts[c.i], b); + c.i++ + } + this.processMessage(c, a); + return MathJax.Callback.After(["process" + a, this, c], b.restart) + }, + formatError: function(b, f) { + var h = function(l, k, j, i) { + return MathJax.Localization._(l, k, j, i) + }; + var e = h("ErrorMessage", "Error: %1", f.message) + "\n"; + if (f.sourceURL || f.fileName) { + e += "\n" + h("ErrorFile", "file: %1", f.sourceURL || f.fileName) + } + if (f.line || f.lineNumber) { + e += "\n" + h("ErrorLine", "line: %1", f.line || f.lineNumber) + } + e += "\n\n" + h("ErrorTips", "Debugging tips: use %1, inspect %2 in the browser console", "'unpacked/MathJax.js'", "'MathJax.Hub.lastError'"); + b.MathJax.error = MathJax.OutputJax.Error.Jax(e, b); + if (b.MathJax.elementJax) { + b.MathJax.error.inputID = b.MathJax.elementJax.inputID + } + var g = this.config.errorSettings; + var a = h(g.messageId, g.message); + var c = MathJax.HTML.Element("span", { + className: "MathJax_Error", + jaxID: "Error", + isMathJax: true, + id: b.MathJax.error.inputID + "-Frame" + }, [ + ["span", null, a] + ]); + MathJax.Ajax.Require("[MathJax]/extensions/MathEvents.js", function() { + var j = MathJax.Extension.MathEvents.Event, + i = MathJax.Hub; + c.oncontextmenu = j.Menu; + c.onmousedown = j.Mousedown; + c.onkeydown = j.Keydown; + c.tabIndex = i.getTabOrder(i.getJaxFor(b)) + }); + var d = document.getElementById(c.id); + if (d) { + d.parentNode.removeChild(d) + } + b.parentNode.insertBefore(c, b); + if (b.MathJax.preview) { + b.MathJax.preview.innerHTML = "" + } + this.lastError = f; + this.signal.Post(["Math Processing Error", b, f]) + }, + RestartAfter: function(a) { + throw this.Insert(Error("restart"), { + restart: MathJax.Callback(a) + }) + }, + elementCallback: function(c, f) { + if (f == null && (c instanceof Array || typeof c === "function")) { + try { + MathJax.Callback(c); + f = c; + c = null + } catch (d) {} + } + if (c == null) { + c = this.config.elements || [] + } + if (this.isHTMLCollection(c)) { + c = this.HTMLCollection2Array(c) + } + if (!(c instanceof Array)) { + c = [c] + } + c = [].concat(c); + for (var b = 0, a = c.length; b < a; b++) { + if (typeof(c[b]) === "string") { + c[b] = document.getElementById(c[b]) + } + } + if (!document.body) { + document.body = document.getElementsByTagName("body")[0] + } + if (c.length == 0) { + c.push(document.body) + } + if (!f) { + f = {} + } + return { + count: c.length, + elements: (c.length === 1 ? c[0] : c), + callback: f + } + }, + elementScripts: function(e) { + var b = []; + if (e instanceof Array || this.isHTMLCollection(e)) { + for (var d = 0, a = e.length; d < a; d++) { + var f = 0; + for (var c = 0; c < d && !f; c++) { + f = e[c].contains(e[d]) + } + if (!f) { + b.push.apply(b, this.elementScripts(e[d])) + } + } + return b + } + if (typeof(e) === "string") { + e = document.getElementById(e) + } + if (!document.body) { + document.body = document.getElementsByTagName("body")[0] + } + if (e == null) { + e = document.body + } + if (e.tagName != null && e.tagName.toLowerCase() === "script") { + return [e] + } + b = e.getElementsByTagName("script"); + if (this.msieHTMLCollectionBug) { + b = this.HTMLCollection2Array(b) + } + return b + }, + isHTMLCollection: function(a) { + return ("HTMLCollection" in window && typeof(a) === "object" && a instanceof HTMLCollection) + }, + HTMLCollection2Array: function(c) { + if (!this.msieHTMLCollectionBug) { + return [].slice.call(c) + } + var b = []; + for (var d = 0, a = c.length; d < a; d++) { + b[d] = c[d] + } + return b + }, + Insert: function(c, a) { + for (var b in a) { + if (a.hasOwnProperty(b)) { + if (typeof a[b] === "object" && !(a[b] instanceof Array) && (typeof c[b] === "object" || typeof c[b] === "function")) { + this.Insert(c[b], a[b]) + } else { + c[b] = a[b] + } + } + } + return c + }, + getTabOrder: function(a) { + return this.config.menuSettings.inTabOrder ? 0 : -1 + }, + SplitList: ("trim" in String.prototype ? function(a) { + return a.trim().split(/\s+/) + } : function(a) { + return a.replace(/^\s+/, "").replace(/\s+$/, "").split(/\s+/) + }) + }; + MathJax.Hub.Insert(MathJax.Hub.config.styles, MathJax.Message.styles); + MathJax.Hub.Insert(MathJax.Hub.config.styles, { + ".MathJax_Error": MathJax.Hub.config.errorSettings.style + }); + MathJax.Extension = {}; + MathJax.Hub.Configured = MathJax.Callback({}); + MathJax.Hub.Startup = { + script: "", + queue: MathJax.Callback.Queue(), + signal: MathJax.Callback.Signal("Startup"), + params: {}, + Config: function() { + this.queue.Push(["Post", this.signal, "Begin Config"]); + if (this.params.locale) { + MathJax.Localization.resetLocale(this.params.locale); + MathJax.Hub.config.menuSettings.locale = this.params.locale + } + if (this.params.config) { + var c = this.params.config.split(/,/); + for (var b = 0, a = c.length; b < a; b++) { + if (!c[b].match(/\.js$/)) { + c[b] += ".js" + } + this.queue.Push(["Require", MathJax.Ajax, this.URL("config", c[b])]) + } + } + this.queue.Push(["Config", MathJax.Hub, MathJax.AuthorConfig]); + if (this.script.match(/\S/)) { + this.queue.Push(this.script + ";\n1;") + } + this.queue.Push(["ConfigDelay", this], ["ConfigBlocks", this], [function(d) { + return d.loadArray(MathJax.Hub.config.config, "config", null, true) + }, this], ["Post", this.signal, "End Config"]) + }, + ConfigDelay: function() { + var a = this.params.delayStartupUntil || MathJax.Hub.config.delayStartupUntil; + if (a === "onload") { + return this.onload + } + if (a === "configured") { + return MathJax.Hub.Configured + } + return a + }, + ConfigBlocks: function() { + var c = document.getElementsByTagName("script"); + var f = null, + b = MathJax.Callback.Queue(); + for (var d = 0, a = c.length; d < a; d++) { + var e = String(c[d].type).replace(/ /g, ""); + if (e.match(/^text\/x-mathjax-config(;.*)?$/) && !e.match(/;executed=true/)) { + c[d].type += ";executed=true"; + f = b.Push(c[d].innerHTML + ";\n1;") + } + } + return f + }, + Cookie: function() { + return this.queue.Push(["Post", this.signal, "Begin Cookie"], ["Get", MathJax.HTML.Cookie, "menu", MathJax.Hub.config.menuSettings], [function(e) { + var d = e.menuSettings; + if (d.locale) { + MathJax.Localization.resetLocale(d.locale) + } + var g = e.menuSettings.renderer, + b = e.jax; + if (g) { + var c = "output/" + g; + b.sort(); + for (var f = 0, a = b.length; f < a; f++) { + if (b[f].substr(0, 7) === "output/") { + break + } + } + if (f == a - 1) { + b.pop() + } else { + while (f < a) { + if (b[f] === c) { + b.splice(f, 1); + break + } + f++ + } + } + b.unshift(c) + } + if (d.CHTMLpreview != null) { + if (d.FastPreview == null) { + d.FastPreview = d.CHTMLpreview + } + delete d.CHTMLpreview + } + if (d.FastPreview && !MathJax.Extension["fast-preview"]) { + MathJax.Hub.config.extensions.push("fast-preview.js") + } + if (e.menuSettings.assistiveMML && !MathJax.Extension.AssistiveMML) { + MathJax.Hub.config.extensions.push("AssistiveMML.js") + } + }, MathJax.Hub.config], ["Post", this.signal, "End Cookie"]) + }, + Styles: function() { + return this.queue.Push(["Post", this.signal, "Begin Styles"], ["loadArray", this, MathJax.Hub.config.styleSheets, "config"], ["Styles", MathJax.Ajax, MathJax.Hub.config.styles], ["Post", this.signal, "End Styles"]) + }, + Jax: function() { + var f = MathJax.Hub.config, + c = MathJax.Hub.outputJax; + for (var g = 0, b = f.jax.length, d = 0; g < b; g++) { + var e = f.jax[g].substr(7); + if (f.jax[g].substr(0, 7) === "output/" && c.order[e] == null) { + c.order[e] = d; + d++ + } + } + var a = MathJax.Callback.Queue(); + return a.Push(["Post", this.signal, "Begin Jax"], ["loadArray", this, f.jax, "jax", "config.js"], ["Post", this.signal, "End Jax"]) + }, + Extensions: function() { + var a = MathJax.Callback.Queue(); + return a.Push(["Post", this.signal, "Begin Extensions"], ["loadArray", this, MathJax.Hub.config.extensions, "extensions"], ["Post", this.signal, "End Extensions"]) + }, + Message: function() { + MathJax.Message.Init(true) + }, + Menu: function() { + var b = MathJax.Hub.config.menuSettings, + a = MathJax.Hub.outputJax, + d; + for (var c in a) { + if (a.hasOwnProperty(c)) { + if (a[c].length) { + d = a[c]; + break + } + } + } + if (d && d.length) { + if (b.renderer && b.renderer !== d[0].id) { + d.unshift(MathJax.OutputJax[b.renderer]) + } + b.renderer = d[0].id + } + }, + Hash: function() { + if (MathJax.Hub.config.positionToHash && document.location.hash && document.body && document.body.scrollIntoView) { + var d = document.location.hash.substr(1); + var f = document.getElementById(d); + if (!f) { + var c = document.getElementsByTagName("a"); + for (var e = 0, b = c.length; e < b; e++) { + if (c[e].name === d) { + f = c[e]; + break + } + } + } + if (f) { + while (!f.scrollIntoView) { + f = f.parentNode + } + f = this.HashCheck(f); + if (f && f.scrollIntoView) { + setTimeout(function() { + f.scrollIntoView(true) + }, 1) + } + } + } + }, + HashCheck: function(b) { + var a = MathJax.Hub.getJaxFor(b); + if (a && MathJax.OutputJax[a.outputJax].hashCheck) { + b = MathJax.OutputJax[a.outputJax].hashCheck(b) + } + return b + }, + MenuZoom: function() { + if (MathJax.Hub.config.showMathMenu) { + if (!MathJax.Extension.MathMenu) { + setTimeout(function() { + MathJax.Callback.Queue(["Require", MathJax.Ajax, "[MathJax]/extensions/MathMenu.js", {}], ["loadDomain", MathJax.Localization, "MathMenu"]) + }, 1000) + } else { + setTimeout(MathJax.Callback(["loadDomain", MathJax.Localization, "MathMenu"]), 1000) + } + if (!MathJax.Extension.MathZoom) { + setTimeout(MathJax.Callback(["Require", MathJax.Ajax, "[MathJax]/extensions/MathZoom.js", {}]), 2000) + } + } + }, + onLoad: function() { + var a = this.onload = MathJax.Callback(function() { + MathJax.Hub.Startup.signal.Post("onLoad") + }); + if (document.body && document.readyState) { + if (MathJax.Hub.Browser.isMSIE) { + if (document.readyState === "complete") { + return [a] + } + } else { + if (document.readyState !== "loading") { + return [a] + } + } + } + if (window.addEventListener) { + window.addEventListener("load", a, false); + if (!this.params.noDOMContentEvent) { + window.addEventListener("DOMContentLoaded", a, false) + } + } else { + if (window.attachEvent) { + window.attachEvent("onload", a) + } else { + window.onload = a + } + } + return a + }, + Typeset: function(a, b) { + if (MathJax.Hub.config.skipStartupTypeset) { + return function() {} + } + return this.queue.Push(["Post", this.signal, "Begin Typeset"], ["Typeset", MathJax.Hub, a, b], ["Post", this.signal, "End Typeset"]) + }, + URL: function(b, a) { + if (!a.match(/^([a-z]+:\/\/|\[|\/)/)) { + a = "[MathJax]/" + b + "/" + a + } + return a + }, + loadArray: function(b, f, c, a) { + if (b) { + if (!(b instanceof Array)) { + b = [b] + } + if (b.length) { + var h = MathJax.Callback.Queue(), + j = {}, + e; + for (var g = 0, d = b.length; g < d; g++) { + e = this.URL(f, b[g]); + if (c) { + e += "/" + c + } + if (a) { + h.Push(["Require", MathJax.Ajax, e, j]) + } else { + h.Push(MathJax.Ajax.Require(e, j)) + } + } + return h.Push({}) + } + } + return null + } + }; + (function(d) { + var b = window[d], + e = "[" + d + "]"; + var c = b.Hub, + a = b.Ajax, + f = b.Callback; + var g = MathJax.Object.Subclass({ + JAXFILE: "jax.js", + require: null, + config: {}, + Init: function(i, h) { + if (arguments.length === 0) { + return this + } + return (this.constructor.Subclass(i, h))() + }, + Augment: function(k, j) { + var i = this.constructor, + h = {}; + if (k != null) { + for (var l in k) { + if (k.hasOwnProperty(l)) { + if (typeof k[l] === "function") { + i.protoFunction(l, k[l]) + } else { + h[l] = k[l] + } + } + } + if (k.toString !== i.prototype.toString && k.toString !== {}.toString) { + i.protoFunction("toString", k.toString) + } + } + c.Insert(i.prototype, h); + i.Augment(null, j); + return this + }, + Translate: function(h, i) { + throw Error(this.directory + "/" + this.JAXFILE + " failed to define the Translate() method") + }, + Register: function(h) {}, + Config: function() { + this.config = c.CombineConfig(this.id, this.config); + if (this.config.Augment) { + this.Augment(this.config.Augment) + } + }, + Startup: function() {}, + loadComplete: function(i) { + if (i === "config.js") { + return a.loadComplete(this.directory + "/" + i) + } else { + var h = f.Queue(); + h.Push(c.Register.StartupHook("End Config", {}), ["Post", c.Startup.signal, this.id + " Jax Config"], ["Config", this], ["Post", c.Startup.signal, this.id + " Jax Require"], [function(j) { + return MathJax.Hub.Startup.loadArray(j.require, this.directory) + }, this], [function(j, k) { + return MathJax.Hub.Startup.loadArray(j.extensions, "extensions/" + k) + }, this.config || {}, this.id], ["Post", c.Startup.signal, this.id + " Jax Startup"], ["Startup", this], ["Post", c.Startup.signal, this.id + " Jax Ready"]); + if (this.copyTranslate) { + h.Push([function(j) { + j.preProcess = j.preTranslate; + j.Process = j.Translate; + j.postProcess = j.postTranslate + }, this.constructor.prototype]) + } + return h.Push(["loadComplete", a, this.directory + "/" + i]) + } + } + }, { + id: "Jax", + version: "2.6.0", + directory: e + "/jax", + extensionDir: e + "/extensions" + }); + b.InputJax = g.Subclass({ + elementJax: "mml", + sourceMenuTitle: ["Original", "Original Form"], + copyTranslate: true, + Process: function(l, q) { + var j = f.Queue(), + o; + var k = this.elementJax; + if (!(k instanceof Array)) { + k = [k] + } + for (var n = 0, h = k.length; n < h; n++) { + o = b.ElementJax.directory + "/" + k[n] + "/" + this.JAXFILE; + if (!this.require) { + this.require = [] + } else { + if (!(this.require instanceof Array)) { + this.require = [this.require] + } + } + this.require.push(o); + j.Push(a.Require(o)) + } + o = this.directory + "/" + this.JAXFILE; + var p = j.Push(a.Require(o)); + if (!p.called) { + this.constructor.prototype.Process = function() { + if (!p.called) { + return p + } + throw Error(o + " failed to load properly") + } + } + k = c.outputJax["jax/" + k[0]]; + if (k) { + j.Push(a.Require(k[0].directory + "/" + this.JAXFILE)) + } + return j.Push({}) + }, + needsUpdate: function(h) { + var i = h.SourceElement(); + return (h.originalText !== b.HTML.getScript(i)) + }, + Register: function(h) { + if (!c.inputJax) { + c.inputJax = {} + } + c.inputJax[h] = this + } + }, { + id: "InputJax", + version: "2.6.0", + directory: g.directory + "/input", + extensionDir: g.extensionDir + }); + b.OutputJax = g.Subclass({ + copyTranslate: true, + preProcess: function(j) { + var i, h = this.directory + "/" + this.JAXFILE; + this.constructor.prototype.preProcess = function(k) { + if (!i.called) { + return i + } + throw Error(h + " failed to load properly") + }; + i = a.Require(h); + return i + }, + Register: function(i) { + var h = c.outputJax; + if (!h[i]) { + h[i] = [] + } + if (h[i].length && (this.id === c.config.menuSettings.renderer || (h.order[this.id] || 0) < (h.order[h[i][0].id] || 0))) { + h[i].unshift(this) + } else { + h[i].push(this) + } + if (!this.require) { + this.require = [] + } else { + if (!(this.require instanceof Array)) { + this.require = [this.require] + } + } + this.require.push(b.ElementJax.directory + "/" + (i.split(/\//)[1]) + "/" + this.JAXFILE) + }, + Remove: function(h) {} + }, { + id: "OutputJax", + version: "2.6.0", + directory: g.directory + "/output", + extensionDir: g.extensionDir, + fontDir: e + (b.isPacked ? "" : "/..") + "/fonts", + imageDir: e + (b.isPacked ? "" : "/..") + "/images" + }); + b.ElementJax = g.Subclass({ + Init: function(i, h) { + return this.constructor.Subclass(i, h) + }, + inputJax: null, + outputJax: null, + inputID: null, + originalText: "", + mimeType: "", + sourceMenuTitle: ["MathMLcode", "MathML Code"], + Text: function(i, j) { + var h = this.SourceElement(); + b.HTML.setScript(h, i); + h.MathJax.state = this.STATE.UPDATE; + return c.Update(h, j) + }, + Reprocess: function(i) { + var h = this.SourceElement(); + h.MathJax.state = this.STATE.UPDATE; + return c.Reprocess(h, i) + }, + Update: function(h) { + return this.Rerender(h) + }, + Rerender: function(i) { + var h = this.SourceElement(); + h.MathJax.state = this.STATE.OUTPUT; + return c.Process(h, i) + }, + Remove: function(h) { + if (this.hover) { + this.hover.clear(this) + } + b.OutputJax[this.outputJax].Remove(this); + if (!h) { + c.signal.Post(["Remove Math", this.inputID]); + this.Detach() + } + }, + needsUpdate: function() { + return b.InputJax[this.inputJax].needsUpdate(this) + }, + SourceElement: function() { + return document.getElementById(this.inputID) + }, + Attach: function(i, j) { + var h = i.MathJax.elementJax; + if (i.MathJax.state === this.STATE.UPDATE) { + h.Clone(this) + } else { + h = i.MathJax.elementJax = this; + if (i.id) { + this.inputID = i.id + } else { + i.id = this.inputID = b.ElementJax.GetID(); + this.newID = 1 + } + } + h.originalText = b.HTML.getScript(i); + h.inputJax = j; + if (h.root) { + h.root.inputID = h.inputID + } + return h + }, + Detach: function() { + var h = this.SourceElement(); + if (!h) { + return + } + try { + delete h.MathJax + } catch (i) { + h.MathJax = null + } + if (this.newID) { + h.id = "" + } + }, + Clone: function(h) { + var i; + for (i in this) { + if (!this.hasOwnProperty(i)) { + continue + } + if (typeof(h[i]) === "undefined" && i !== "newID") { + delete this[i] + } + } + for (i in h) { + if (!h.hasOwnProperty(i)) { + continue + } + if (typeof(this[i]) === "undefined" || (this[i] !== h[i] && i !== "inputID")) { + this[i] = h[i] + } + } + } + }, { + id: "ElementJax", + version: "2.6.0", + directory: g.directory + "/element", + extensionDir: g.extensionDir, + ID: 0, + STATE: { + PENDING: 1, + PROCESSED: 2, + UPDATE: 3, + OUTPUT: 4 + }, + GetID: function() { + this.ID++; + return "MathJax-Element-" + this.ID + }, + Subclass: function() { + var h = g.Subclass.apply(this, arguments); + h.loadComplete = this.prototype.loadComplete; + return h + } + }); + b.ElementJax.prototype.STATE = b.ElementJax.STATE; + b.OutputJax.Error = { + id: "Error", + version: "2.6.0", + config: {}, + errors: 0, + ContextMenu: function() { + return b.Extension.MathEvents.Event.ContextMenu.apply(b.Extension.MathEvents.Event, arguments) + }, + Mousedown: function() { + return b.Extension.MathEvents.Event.AltContextMenu.apply(b.Extension.MathEvents.Event, arguments) + }, + getJaxFromMath: function(h) { + return (h.nextSibling.MathJax || {}).error + }, + Jax: function(j, i) { + var h = MathJax.Hub.inputJax[i.type.replace(/ *;(.|\s)*/, "")]; + this.errors++; + return { + inputJax: (h || { + id: "Error" + }).id, + outputJax: "Error", + inputID: "MathJax-Error-" + this.errors, + sourceMenuTitle: ["ErrorMessage", "Error Message"], + sourceMenuFormat: "Error", + originalText: MathJax.HTML.getScript(i), + errorText: j + } + } + }; + b.InputJax.Error = { + id: "Error", + version: "2.6.0", + config: {}, + sourceMenuTitle: ["Original", "Original Form"] + } + })("MathJax"); + (function(o) { + var h = window[o]; + if (!h) { + h = window[o] = {} + } + var d = h.Hub; + var s = d.Startup; + var w = d.config; + var g = document.head || (document.getElementsByTagName("head")[0]); + if (!g) { + g = document.childNodes[0] + } + var b = (document.documentElement || document).getElementsByTagName("script"); + if (b.length === 0 && g.namespaceURI) { + b = document.getElementsByTagNameNS(g.namespaceURI, "script") + } + var f = new RegExp("(^|/)" + o + "\\.js(\\?.*)?$"); + for (var q = b.length - 1; q >= 0; q--) { + if ((b[q].src || "").match(f)) { + s.script = b[q].innerHTML; + if (RegExp.$2) { + var t = RegExp.$2.substr(1).split(/\&/); + for (var p = 0, l = t.length; p < l; p++) { + var n = t[p].match(/(.*)=(.*)/); + if (n) { + s.params[unescape(n[1])] = unescape(n[2]) + } + } + } + w.root = b[q].src.replace(/(^|\/)[^\/]*(\?.*)?$/, "").replace(/^(https?:\/\/cdn.mathjax.org\/mathjax\/)(latest)/, "$1" + h.version.split(/\./).slice(0, 2).join(".") + "-$2"); + h.Ajax.config.root = w.root; + break + } + } + var k = navigator.userAgent; + var a = { + isMac: (navigator.platform.substr(0, 3) === "Mac"), + isPC: (navigator.platform.substr(0, 3) === "Win"), + isMSIE: ("ActiveXObject" in window && "clipboardData" in window), + isEdge: ("MSGestureEvent" in window && "chrome" in window && window.chrome.loadTimes == null), + isFirefox: (!!k.match(/Gecko\//) && !k.match(/like Gecko/)), + isSafari: (!!k.match(/ (Apple)?WebKit\//) && !k.match(/ like iPhone /) && (!window.chrome || window.chrome.app == null)), + isChrome: ("chrome" in window && window.chrome.loadTimes != null), + isOpera: ("opera" in window && window.opera.version != null), + isKonqueror: ("konqueror" in window && navigator.vendor == "KDE"), + versionAtLeast: function(y) { + var x = (this.version).split("."); + y = (new String(y)).split("."); + for (var z = 0, j = y.length; z < j; z++) { + if (x[z] != y[z]) { + return parseInt(x[z] || "0") >= parseInt(y[z]) + } + } + return true + }, + Select: function(j) { + var i = j[d.Browser]; + if (i) { + return i(d.Browser) + } + return null + } + }; + var e = k.replace(/^Mozilla\/(\d+\.)+\d+ /, "").replace(/[a-z][-a-z0-9._: ]+\/\d+[^ ]*-[^ ]*\.([a-z][a-z])?\d+ /i, "").replace(/Gentoo |Ubuntu\/(\d+\.)*\d+ (\([^)]*\) )?/, ""); + d.Browser = d.Insert(d.Insert(new String("Unknown"), { + version: "0.0" + }), a); + for (var v in a) { + if (a.hasOwnProperty(v)) { + if (a[v] && v.substr(0, 2) === "is") { + v = v.slice(2); + if (v === "Mac" || v === "PC") { + continue + } + d.Browser = d.Insert(new String(v), a); + var r = new RegExp(".*(Version/| Trident/.*; rv:)((?:\\d+\\.)+\\d+)|.*(" + v + ")" + (v == "MSIE" ? " " : "/") + "((?:\\d+\\.)*\\d+)|(?:^|\\(| )([a-z][-a-z0-9._: ]+|(?:Apple)?WebKit)/((?:\\d+\\.)+\\d+)"); + var u = r.exec(e) || ["", "", "", "unknown", "0.0"]; + d.Browser.name = (u[1] != "" ? v : (u[3] || u[5])); + d.Browser.version = u[2] || u[4] || u[6]; + break + } + } + } + try { + d.Browser.Select({ + Safari: function(j) { + var i = parseInt((String(j.version).split("."))[0]); + if (i > 85) { + j.webkit = j.version + } + if (i >= 538) { + j.version = "8.0" + } else { + if (i >= 537) { + j.version = "7.0" + } else { + if (i >= 536) { + j.version = "6.0" + } else { + if (i >= 534) { + j.version = "5.1" + } else { + if (i >= 533) { + j.version = "5.0" + } else { + if (i >= 526) { + j.version = "4.0" + } else { + if (i >= 525) { + j.version = "3.1" + } else { + if (i > 500) { + j.version = "3.0" + } else { + if (i > 400) { + j.version = "2.0" + } else { + if (i > 85) { + j.version = "1.0" + } + } + } + } + } + } + } + } + } + } + j.webkit = (navigator.appVersion.match(/WebKit\/(\d+)\./))[1]; + j.isMobile = (navigator.appVersion.match(/Mobile/i) != null); + j.noContextMenu = j.isMobile + }, + Firefox: function(j) { + if ((j.version === "0.0" || k.match(/Firefox/) == null) && navigator.product === "Gecko") { + var m = k.match(/[\/ ]rv:(\d+\.\d.*?)[\) ]/); + if (m) { + j.version = m[1] + } else { + var i = (navigator.buildID || navigator.productSub || "0").substr(0, 8); + if (i >= "20111220") { + j.version = "9.0" + } else { + if (i >= "20111120") { + j.version = "8.0" + } else { + if (i >= "20110927") { + j.version = "7.0" + } else { + if (i >= "20110816") { + j.version = "6.0" + } else { + if (i >= "20110621") { + j.version = "5.0" + } else { + if (i >= "20110320") { + j.version = "4.0" + } else { + if (i >= "20100121") { + j.version = "3.6" + } else { + if (i >= "20090630") { + j.version = "3.5" + } else { + if (i >= "20080617") { + j.version = "3.0" + } else { + if (i >= "20061024") { + j.version = "2.0" + } + } + } + } + } + } + } + } + } + } + } + } + j.isMobile = (navigator.appVersion.match(/Android/i) != null || k.match(/ Fennec\//) != null || k.match(/Mobile/) != null) + }, + Chrome: function(i) { + i.noContextMenu = i.isMobile = !!navigator.userAgent.match(/ Mobile[ \/]/) + }, + Opera: function(i) { + i.version = opera.version() + }, + Edge: function(i) { + i.isMobile = !!navigator.userAgent.match(/ Phone/) + }, + MSIE: function(j) { + j.isMobile = !!navigator.userAgent.match(/ Phone/); + j.isIE9 = !!(document.documentMode && (window.performance || window.msPerformance)); + MathJax.HTML.setScriptBug = !j.isIE9 || document.documentMode < 9; + MathJax.Hub.msieHTMLCollectionBug = (document.documentMode < 9); + if (document.documentMode < 10 && !s.params.NoMathPlayer) { + try { + new ActiveXObject("MathPlayer.Factory.1"); + j.hasMathPlayer = true + } catch (m) {} + try { + if (j.hasMathPlayer) { + var i = document.createElement("object"); + i.id = "mathplayer"; + i.classid = "clsid:32F66A20-7614-11D4-BD11-00104BD3F987"; + g.appendChild(i); + document.namespaces.add("m", "http://www.w3.org/1998/Math/MathML"); + j.mpNamespace = true; + if (document.readyState && (document.readyState === "loading" || document.readyState === "interactive")) { + document.write(''); + j.mpImported = true + } + } else { + document.namespaces.add("mjx_IE_fix", "http://www.w3.org/1999/xlink") + } + } catch (m) {} + } + } + }) + } catch (c) { + console.error(c.message) + } + d.Browser.Select(MathJax.Message.browsers); + if (h.AuthorConfig && typeof h.AuthorConfig.AuthorInit === "function") { + h.AuthorConfig.AuthorInit() + } + d.queue = h.Callback.Queue(); + d.queue.Push(["Post", s.signal, "Begin"], ["Config", s], ["Cookie", s], ["Styles", s], ["Message", s], function() { + var i = h.Callback.Queue(s.Jax(), s.Extensions()); + return i.Push({}) + }, ["Menu", s], s.onLoad(), function() { + MathJax.isReady = true + }, ["Typeset", s], ["Hash", s], ["MenuZoom", s], ["Post", s.signal, "End"]) + })("MathJax") + } +}; diff --git a/modules/MathJax/config/TeX-AMS-MML_HTMLorMML.js b/modules/MathJax/config/TeX-AMS-MML_HTMLorMML.js new file mode 100644 index 0000000..8ce103b --- /dev/null +++ b/modules/MathJax/config/TeX-AMS-MML_HTMLorMML.js @@ -0,0 +1,66 @@ +/* + * /MathJax/config/TeX-AMS-MML_HTMLorMML.js + * + * Copyright (c) 2010-2015 The MathJax Consortium + * + * Part of the MathJax library. + * See http://www.mathjax.org for details. + * + * Licensed under the Apache License, Version 2.0; + * you may not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +MathJax.Hub.Config({delayJaxRegistration: true}); + +MathJax.Ajax.Preloading( + "[MathJax]/jax/input/TeX/config.js", + "[MathJax]/jax/input/MathML/config.js", + "[MathJax]/jax/output/HTML-CSS/config.js", + "[MathJax]/jax/output/NativeMML/config.js", + "[MathJax]/jax/output/PreviewHTML/config.js", + "[MathJax]/config/MMLorHTML.js", + "[MathJax]/extensions/tex2jax.js", + "[MathJax]/extensions/mml2jax.js", + "[MathJax]/extensions/MathEvents.js", + "[MathJax]/extensions/MathZoom.js", + "[MathJax]/extensions/MathMenu.js", + "[MathJax]/jax/element/mml/jax.js", + "[MathJax]/extensions/toMathML.js", + "[MathJax]/extensions/TeX/noErrors.js", + "[MathJax]/extensions/TeX/noUndefined.js", + "[MathJax]/jax/input/TeX/jax.js", + "[MathJax]/extensions/TeX/AMSmath.js", + "[MathJax]/extensions/TeX/AMSsymbols.js", + "[MathJax]/jax/input/MathML/jax.js", + "[MathJax]/jax/output/PreviewHTML/jax.js", + "[MathJax]/extensions/fast-preview.js", + "[MathJax]/extensions/AssistiveMML.js" +); + +MathJax.Hub.Config({"v1.0-compatible":false}); + +MathJax.InputJax.TeX=MathJax.InputJax({id:"TeX",version:"2.6.1",directory:MathJax.InputJax.directory+"/TeX",extensionDir:MathJax.InputJax.extensionDir+"/TeX",config:{TagSide:"right",TagIndent:"0.8em",MultLineWidth:"85%",equationNumbers:{autoNumber:"none",formatNumber:function(a){return a},formatTag:function(a){return"("+a+")"},formatID:function(a){return"mjx-eqn-"+String(a).replace(/[:"'<>&]/g,"")},formatURL:function(a){return"#"+escape(a)},useLabelIds:true}}});MathJax.InputJax.TeX.Register("math/tex");MathJax.InputJax.TeX.loadComplete("config.js"); +MathJax.InputJax.MathML=MathJax.InputJax({id:"MathML",version:"2.6.1",directory:MathJax.InputJax.directory+"/MathML",extensionDir:MathJax.InputJax.extensionDir+"/MathML",entityDir:MathJax.InputJax.directory+"/MathML/entities",config:{useMathMLspacing:false}});MathJax.InputJax.MathML.Register("math/mml");MathJax.InputJax.MathML.loadComplete("config.js"); +MathJax.OutputJax["HTML-CSS"]=MathJax.OutputJax({id:"HTML-CSS",version:"2.6.1",directory:MathJax.OutputJax.directory+"/HTML-CSS",extensionDir:MathJax.OutputJax.extensionDir+"/HTML-CSS",autoloadDir:MathJax.OutputJax.directory+"/HTML-CSS/autoload",fontDir:MathJax.OutputJax.directory+"/HTML-CSS/fonts",webfontDir:MathJax.OutputJax.fontDir+"/HTML-CSS",config:{noReflows:true,matchFontHeight:true,scale:100,minScaleAdjust:50,availableFonts:["STIX","TeX"],preferredFont:"TeX",webFont:"TeX",imageFont:"TeX",undefinedFamily:"STIXGeneral,'Arial Unicode MS',serif",mtextFontInherit:false,EqnChunk:(MathJax.Hub.Browser.isMobile?10:50),EqnChunkFactor:1.5,EqnChunkDelay:100,linebreaks:{automatic:false,width:"container"},styles:{".MathJax_Display":{"text-align":"center",margin:"1em 0em"},".MathJax .merror":{"background-color":"#FFFF88",color:"#CC0000",border:"1px solid #CC0000",padding:"1px 3px","font-style":"normal","font-size":"90%"},".MathJax .MJX-monospace":{"font-family":"monospace"},".MathJax .MJX-sans-serif":{"font-family":"sans-serif"},"#MathJax_Tooltip":{"background-color":"InfoBackground",color:"InfoText",border:"1px solid black","box-shadow":"2px 2px 5px #AAAAAA","-webkit-box-shadow":"2px 2px 5px #AAAAAA","-moz-box-shadow":"2px 2px 5px #AAAAAA","-khtml-box-shadow":"2px 2px 5px #AAAAAA",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')",padding:"3px 4px","z-index":401}}}});if(MathJax.Hub.Browser.isMSIE&&document.documentMode>=9){delete MathJax.OutputJax["HTML-CSS"].config.styles["#MathJax_Tooltip"].filter}if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax["HTML-CSS"].Register("jax/mml")}MathJax.Hub.Register.StartupHook("End Config",[function(b,c){var a=b.Insert({minBrowserVersion:{Firefox:3,Opera:9.52,MSIE:6,Chrome:0.3,Safari:2,Konqueror:4},inlineMathDelimiters:["$","$"],displayMathDelimiters:["$$","$$"],multilineDisplay:true,minBrowserTranslate:function(f){var e=b.getJaxFor(f),k=["[Math]"],j;var h=document.createElement("span",{className:"MathJax_Preview"});if(e.inputJax==="TeX"){if(e.root.Get("displaystyle")){j=a.displayMathDelimiters;k=[j[0]+e.originalText+j[1]];if(a.multilineDisplay){k=k[0].split(/\n/)}}else{j=a.inlineMathDelimiters;k=[j[0]+e.originalText.replace(/^\s+/,"").replace(/\s+$/,"")+j[1]]}}for(var g=0,d=k.length;g0)},patternQuote:function(a){return a.replace(/([\^$(){}+*?\-|\[\]\:\\])/g,"\\$1")},endPattern:function(a){return new RegExp(this.patternQuote(a)+"|\\\\.|[{}]","g")},sortLength:function(d,c){if(d.length!==c.length){return c.length-d.length}return(d==c?0:(d/i,"").replace(/<\?xml:namespace .*?\/>/i,"");b=b.replace(/ /g," ")}MathJax.HTML.setScript(a,b);d.removeChild(e)}else{var c=MathJax.HTML.Element("span");c.appendChild(e);MathJax.HTML.setScript(a,c.innerHTML)}if(this.config.preview!=="none"){this.createPreview(e,a)}},ProcessMathFlattened:function(f){var d=f.parentNode;if(!d||d.className===MathJax.Hub.config.preRemoveClass){return}var b=document.createElement("script");b.type="math/mml";d.insertBefore(b,f);var c="",e,a=f;while(f&&f.nodeName!=="/MATH"){e=f;f=f.nextSibling;c+=this.NodeHTML(e);e.parentNode.removeChild(e)}if(f&&f.nodeName==="/MATH"){f.parentNode.removeChild(f)}b.text=c+"";if(this.config.preview!=="none"){this.createPreview(a,b)}},NodeHTML:function(e){var c,b,a;if(e.nodeName==="#text"){c=this.quoteHTML(e.nodeValue)}else{if(e.nodeName==="#comment"){c=""}else{c="<"+e.nodeName.toLowerCase();for(b=0,a=e.attributes.length;b";if(e.outerHTML!=null&&e.outerHTML.match(/(.<\/[A-Z]+>|\/>)$/)){for(b=0,a=e.childNodes.length;b"}}}return c},OuterHTML:function(d){if(d.nodeName.charAt(0)==="#"){return this.NodeHTML(d)}if(!this.AttributeBug){return d.outerHTML}var c=this.NodeHTML(d);for(var b=0,a=d.childNodes.length;b";return c},quoteHTML:function(a){if(a==null){a=""}return a.replace(/&/g,"&").replace(//g,">").replace(/\"/g,""")},createPreview:function(f,b){var g=this.config.preview;if(g==="none"){return}var a=false;if(g==="mathml"){a=true;if(this.MathTagBug){g="alttext"}else{g=f.cloneNode(true)}}if(g==="alttext"||g==="altimg"){a=true;var c=this.filterPreview(f.getAttribute("alttext"));if(g==="alttext"){if(c!=null){g=MathJax.HTML.TextNode(c)}else{g=null}}else{var h=f.getAttribute("altimg");if(h!=null){var e={width:f.getAttribute("altimg-width"),height:f.getAttribute("altimg-height")};g=MathJax.HTML.Element("img",{src:h,alt:c,style:e})}else{g=null}}}if(g){var d;if(a){d=MathJax.HTML.Element("span",{className:MathJax.Hub.config.preRemoveClass});d.appendChild(g)}else{d=MathJax.HTML.Element("span",{className:MathJax.Hub.config.preRemoveClass},g)}b.parentNode.insertBefore(d,b)}},filterPreview:function(a){return a},InitBrowser:function(){var b=MathJax.HTML.Element("span",{id:"<",className:"mathjax",innerHTML:"x"});var a=b.outerHTML||"";this.AttributeBug=a!==""&&!(a.match(/id="<"/)&&a.match(/class="mathjax"/)&&a.match(/<\/math>/));this.MathTagBug=b.childNodes.length>1;this.CleanupHTML=MathJax.Hub.Browser.isMSIE}};MathJax.Hub.Register.PreProcessor(["PreProcess",MathJax.Extension.mml2jax],5);MathJax.Ajax.loadComplete("[MathJax]/extensions/mml2jax.js"); +(function(d,h,l,g,m,b,j){var p="2.6.0";var i=MathJax.Extension;var c=i.MathEvents={version:p};var k=d.config.menuSettings;var o={hover:500,frame:{x:3.5,y:5,bwidth:1,bcolor:"#A6D",hwidth:"15px",hcolor:"#83A"},button:{x:-6,y:-3,wx:-2},fadeinInc:0.2,fadeoutInc:0.05,fadeDelay:50,fadeoutStart:400,fadeoutDelay:15*1000,styles:{".MathJax_Hover_Frame":{"border-radius":".25em","-webkit-border-radius":".25em","-moz-border-radius":".25em","-khtml-border-radius":".25em","box-shadow":"0px 0px 15px #83A","-webkit-box-shadow":"0px 0px 15px #83A","-moz-box-shadow":"0px 0px 15px #83A","-khtml-box-shadow":"0px 0px 15px #83A",border:"1px solid #A6D ! important",display:"inline-block",position:"absolute"},".MathJax_Menu_Button .MathJax_Hover_Arrow":{position:"absolute",cursor:"pointer",display:"inline-block",border:"2px solid #AAA","border-radius":"4px","-webkit-border-radius":"4px","-moz-border-radius":"4px","-khtml-border-radius":"4px","font-family":"'Courier New',Courier","font-size":"9px",color:"#F0F0F0"},".MathJax_Menu_Button .MathJax_Hover_Arrow span":{display:"block","background-color":"#AAA",border:"1px solid","border-radius":"3px","line-height":0,padding:"4px"},".MathJax_Hover_Arrow:hover":{color:"white!important",border:"2px solid #CCC!important"},".MathJax_Hover_Arrow:hover span":{"background-color":"#CCC!important"}}};var n=c.Event={LEFTBUTTON:0,RIGHTBUTTON:2,MENUKEY:"altKey",KEY:{RETURN:13,ESCAPE:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40},Mousedown:function(q){return n.Handler(q,"Mousedown",this)},Mouseup:function(q){return n.Handler(q,"Mouseup",this)},Mousemove:function(q){return n.Handler(q,"Mousemove",this)},Mouseover:function(q){return n.Handler(q,"Mouseover",this)},Mouseout:function(q){return n.Handler(q,"Mouseout",this)},Click:function(q){return n.Handler(q,"Click",this)},DblClick:function(q){return n.Handler(q,"DblClick",this)},Menu:function(q){return n.Handler(q,"ContextMenu",this)},Handler:function(t,r,s){if(l.loadingMathMenu){return n.False(t)}var q=b[s.jaxID];if(!t){t=window.event}t.isContextMenu=(r==="ContextMenu");if(q[r]){return q[r](t,s)}if(i.MathZoom){return i.MathZoom.HandleEvent(t,r,s)}},False:function(q){if(!q){q=window.event}if(q){if(q.preventDefault){q.preventDefault()}else{q.returnValue=false}if(q.stopPropagation){q.stopPropagation()}q.cancelBubble=true}return false},Keydown:function(r,q){if(!r){r=window.event}if(r.keyCode===n.KEY.SPACE){n.ContextMenu(r,this)}},ContextMenu:function(t,E,w){var B=b[E.jaxID],v=B.getJaxFromMath(E);var F=(B.config.showMathMenu!=null?B:d).config.showMathMenu;if(!F||(k.context!=="MathJax"&&!w)){return}if(c.msieEventBug){t=window.event||t}n.ClearSelection();f.ClearHoverTimer();if(v.hover){if(v.hover.remove){clearTimeout(v.hover.remove);delete v.hover.remove}v.hover.nofade=true}var u=MathJax.Menu;var G,D;if(u){if(u.loadingDomain){return n.False(t)}G=m.loadDomain("MathMenu");if(!G){u.jax=v;var r=u.menu.Find("Show Math As").submenu;r.items[0].name=v.sourceMenuTitle;r.items[0].format=(v.sourceMenuFormat||"MathML");r.items[1].name=j[v.inputJax].sourceMenuTitle;r.items[5].disabled=!j[v.inputJax].annotationEncoding;var A=r.items[2];A.disabled=true;var q=A.submenu.items;annotationList=MathJax.Hub.Config.semanticsAnnotations;for(var z=0,y=q.length;z0){this.HoverFadeTimer(q,q.hover.inc);return}s.parentNode.removeChild(s);if(r){r.parentNode.removeChild(r)}if(q.hover.remove){clearTimeout(q.hover.remove)}delete q.hover},HoverFadeTimer:function(q,s,r){q.hover.inc=s;if(!q.hover.timer){q.hover.timer=setTimeout(g(["HoverFade",this,q]),(r||o.fadeDelay))}},HoverMenu:function(q){if(!q){q=window.event}return b[this.jax].ContextMenu(q,this.math,true)},ClearHover:function(q){if(q.hover.remove){clearTimeout(q.hover.remove)}if(q.hover.timer){clearTimeout(q.hover.timer)}f.ClearHoverTimer();delete q.hover},Px:function(q){if(Math.abs(q)<0.006){return"0px"}return q.toFixed(2).replace(/\.?0+$/,"")+"px"},getImages:function(){if(k.discoverable){var q=new Image();q.src=o.button.src}}};var a=c.Touch={last:0,delay:500,start:function(r){var q=new Date().getTime();var s=(q-a.lastt){z.style.height=t+"px";z.style.width=(x.zW+this.scrollSize)+"px"}if(z.offsetWidth>l){z.style.width=l+"px";z.style.height=(x.zH+this.scrollSize)+"px"}}if(this.operaPositionBug){z.style.width=Math.min(l,x.zW)+"px"}if(z.offsetWidth>m&&z.offsetWidth-m=9);h.msiePositionBug=!m;h.msieSizeBug=l.versionAtLeast("7.0")&&(!document.documentMode||n===7||n===8);h.msieZIndexBug=(n<=7);h.msieInlineBlockAlignBug=(n<=7);h.msieTrapEventBug=!window.addEventListener;if(document.compatMode==="BackCompat"){h.scrollSize=52}if(m){delete i.styles["#MathJax_Zoom"].filter}},Opera:function(l){h.operaPositionBug=true;h.operaRefreshBug=true}});h.topImg=(h.msieInlineBlockAlignBug?d.Element("img",{style:{width:0,height:0,position:"relative"},src:"about:blank"}):d.Element("span",{style:{width:0,height:0,display:"inline-block"}}));if(h.operaPositionBug||h.msieTopBug){h.topImg.style.border="1px solid"}MathJax.Callback.Queue(["StartupHook",MathJax.Hub.Register,"Begin Styles",{}],["Styles",f,i.styles],["Post",a.Startup.signal,"MathZoom Ready"],["loadComplete",f,"[MathJax]/extensions/MathZoom.js"])})(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.OutputJax["HTML-CSS"],MathJax.OutputJax.NativeMML); +(function(f,n,p,e,q){var o="2.6.1";var d=MathJax.Callback.Signal("menu");MathJax.Extension.MathMenu={version:o,signal:d};var s=function(t){return MathJax.Localization._.apply(MathJax.Localization,[["MathMenu",t]].concat([].slice.call(arguments,1)))};var a=f.Browser.isPC,k=f.Browser.isMSIE,l=((document.documentMode||0)>8);var i=(a?null:"5px");var r=f.CombineConfig("MathMenu",{delay:150,showRenderer:true,showMathPlayer:true,showFontMenu:false,showContext:false,showDiscoverable:false,showLocale:true,showLocaleURL:false,semanticsAnnotations:{TeX:["TeX","LaTeX","application/x-tex"],StarMath:["StarMath 5.0"],Maple:["Maple"],ContentMathML:["MathML-Content","application/mathml-content+xml"],OpenMath:["OpenMath"]},windowSettings:{status:"no",toolbar:"no",locationbar:"no",menubar:"no",directories:"no",personalbar:"no",resizable:"yes",scrollbars:"yes",width:400,height:300,left:Math.round((screen.width-400)/2),top:Math.round((screen.height-300)/3)},styles:{"#MathJax_About":{position:"fixed",left:"50%",width:"auto","text-align":"center",border:"3px outset",padding:"1em 2em","background-color":"#DDDDDD",color:"black",cursor:"default","font-family":"message-box","font-size":"120%","font-style":"normal","text-indent":0,"text-transform":"none","line-height":"normal","letter-spacing":"normal","word-spacing":"normal","word-wrap":"normal","white-space":"nowrap","float":"none","z-index":201,"border-radius":"15px","-webkit-border-radius":"15px","-moz-border-radius":"15px","-khtml-border-radius":"15px","box-shadow":"0px 10px 20px #808080","-webkit-box-shadow":"0px 10px 20px #808080","-moz-box-shadow":"0px 10px 20px #808080","-khtml-box-shadow":"0px 10px 20px #808080",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')"},"#MathJax_About.MathJax_MousePost":{outline:"none"},".MathJax_Menu":{position:"absolute","background-color":"white",color:"black",width:"auto",padding:(a?"2px":"5px 0px"),border:"1px solid #CCCCCC",margin:0,cursor:"default",font:"menu","text-align":"left","text-indent":0,"text-transform":"none","line-height":"normal","letter-spacing":"normal","word-spacing":"normal","word-wrap":"normal","white-space":"nowrap","float":"none","z-index":201,"border-radius":i,"-webkit-border-radius":i,"-moz-border-radius":i,"-khtml-border-radius":i,"box-shadow":"0px 10px 20px #808080","-webkit-box-shadow":"0px 10px 20px #808080","-moz-box-shadow":"0px 10px 20px #808080","-khtml-box-shadow":"0px 10px 20px #808080",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')"},".MathJax_MenuItem":{padding:(a?"2px 2em":"1px 2em"),background:"transparent"},".MathJax_MenuArrow":{position:"absolute",right:".5em","padding-top":".25em",color:"#666666","font-family":(k?"'Arial unicode MS'":null),"font-size":".75em"},".MathJax_MenuActive .MathJax_MenuArrow":{color:"white"},".MathJax_MenuArrow.RTL":{left:".5em",right:"auto"},".MathJax_MenuCheck":{position:"absolute",left:".7em","font-family":(k?"'Arial unicode MS'":null)},".MathJax_MenuCheck.RTL":{right:".7em",left:"auto"},".MathJax_MenuRadioCheck":{position:"absolute",left:(a?"1em":".7em")},".MathJax_MenuRadioCheck.RTL":{right:(a?"1em":".7em"),left:"auto"},".MathJax_MenuLabel":{padding:(a?"2px 2em 4px 1.33em":"1px 2em 3px 1.33em"),"font-style":"italic"},".MathJax_MenuRule":{"border-top":(a?"1px solid #CCCCCC":"1px solid #DDDDDD"),margin:(a?"4px 1px 0px":"4px 3px")},".MathJax_MenuDisabled":{color:"GrayText"},".MathJax_MenuActive":{"background-color":(a?"Highlight":"#606872"),color:(a?"HighlightText":"white")},".MathJax_MenuDisabled:focus, .MathJax_MenuLabel:focus":{"background-color":"#E8E8E8"},".MathJax_ContextMenu:focus":{outline:"none"},".MathJax_ContextMenu .MathJax_MenuItem:focus":{outline:"none"},"#MathJax_AboutClose":{top:".2em",right:".2em"},".MathJax_Menu .MathJax_MenuClose":{top:"-10px",left:"-10px"},".MathJax_MenuClose":{position:"absolute",cursor:"pointer",display:"inline-block",border:"2px solid #AAA","border-radius":"18px","-webkit-border-radius":"18px","-moz-border-radius":"18px","-khtml-border-radius":"18px","font-family":"'Courier New',Courier","font-size":"24px",color:"#F0F0F0"},".MathJax_MenuClose span":{display:"block","background-color":"#AAA",border:"1.5px solid","border-radius":"18px","-webkit-border-radius":"18px","-moz-border-radius":"18px","-khtml-border-radius":"18px","line-height":0,padding:"8px 0 6px"},".MathJax_MenuClose:hover":{color:"white!important",border:"2px solid #CCC!important"},".MathJax_MenuClose:hover span":{"background-color":"#CCC!important"},".MathJax_MenuClose:hover:focus":{outline:"none"}}});var m,j,b;f.Register.StartupHook("MathEvents Ready",function(){m=MathJax.Extension.MathEvents.Event.False;j=MathJax.Extension.MathEvents.Hover;b=MathJax.Extension.MathEvents.Event.KEY});var h=MathJax.Object.Subclass({Keydown:function(t,u){switch(t.keyCode){case b.ESCAPE:this.Remove(t,u);break;case b.RIGHT:this.Right(t,u);break;case b.LEFT:this.Left(t,u);break;case b.UP:this.Up(t,u);break;case b.DOWN:this.Down(t,u);break;case b.RETURN:case b.SPACE:this.Space(t,u);break;default:return;break}return m(t)},Escape:function(t,u){},Right:function(t,u){},Left:function(t,u){},Up:function(t,u){},Down:function(t,u){},Space:function(t,u){}},{});var g=MathJax.Menu=h.Subclass({version:o,items:[],posted:false,title:null,margin:5,Init:function(t){this.items=[].slice.call(arguments,0)},With:function(t){if(t){f.Insert(this,t)}return this},Post:function(u,I,G){if(!u){u=window.event||{}}var t=document.getElementById("MathJax_MenuFrame");if(!t){t=g.Background(this);delete c.lastItem;delete c.lastMenu;delete g.skipUp;d.Post(["post",g.jax]);g.isRTL=(MathJax.Localization.fontDirection()==="rtl")}var v=n.Element("div",{onmouseup:g.Mouseup,ondblclick:m,ondragstart:m,onselectstart:m,oncontextmenu:m,menuItem:this,className:"MathJax_Menu",onkeydown:g.Keydown,role:"menu"});if(u.type==="contextmenu"||u.type==="mouseover"){v.className+=" MathJax_ContextMenu"}if(!G){MathJax.Localization.setCSS(v)}for(var B=0,z=this.items.length;Bdocument.body.offsetWidth-this.margin){H=document.body.offsetWidth-v.offsetWidth-this.margin}if(g.isMobile){H=Math.max(5,H-Math.floor(v.offsetWidth/2));F-=20}g.skipUp=u.isContextMenu}else{var D="left",L=I.offsetWidth;H=(g.isMobile?30:L-2);F=0;while(I&&I!==t){H+=I.offsetLeft;F+=I.offsetTop;I=I.parentNode}if(!g.isMobile){if((g.isRTL&&H-L-v.offsetWidth>this.margin)||(!g.isRTL&&H+v.offsetWidth>document.body.offsetWidth-this.margin)){D="right";H=Math.max(this.margin,H-L-v.offsetWidth+6)}}if(!a){v.style["borderRadiusTop"+D]=0;v.style["WebkitBorderRadiusTop"+D]=0;v.style["MozBorderRadiusTop"+D]=0;v.style["KhtmlBorderRadiusTop"+D]=0}}v.style.left=H+"px";v.style.top=F+"px";if(document.selection&&document.selection.empty){document.selection.empty()}var K=window.pageXOffset||document.documentElement.scrollLeft;var J=window.pageYOffset||document.documentElement.scrollTop;g.Focus(v);if(u.type==="keydown"){g.skipMouseoverFromKey=true;setTimeout(function(){delete g.skipMouseoverFromKey},r.delay)}window.scrollTo(K,J);return m(u)},Remove:function(t,u){d.Post(["unpost",g.jax]);var v=document.getElementById("MathJax_MenuFrame");if(v){v.parentNode.removeChild(v);if(this.msieFixedPositionBug){detachEvent("onresize",g.Resize)}}if(g.jax.hover){delete g.jax.hover.nofade;j.UnHover(g.jax)}g.Unfocus(u);if(t.type==="mousedown"){g.CurrentNode().blur()}return m(t)},Find:function(t){return this.FindN(1,t,[].slice.call(arguments,1))},FindId:function(t){return this.FindN(0,t,[].slice.call(arguments,1))},FindN:function(x,u,w){for(var v=0,t=this.items.length;v0){t.oldTabIndex=t.tabIndex}t.tabIndex=-1}},SetTabIndex:function(){var u=g.AllNodes();for(var v=0,t;t=u[v];v++){if(t.oldTabIndex!==undefined){t.tabIndex=t.oldTabIndex;delete t.oldTabIndex}else{t.tabIndex=f.getTabOrder(t)}}},Mod:function(t,u){return((t%u)+u)%u},IndexOf:(Array.prototype.indexOf?function(t,u,v){return t.indexOf(u,v)}:function(t,w,x){for(var v=(x||0),u=t.length;v=0&&c.GetMenuNode(v).menuItem!==u[t].menuItem){u[t].menuItem.posted=false;u[t].parentNode.removeChild(u[t]);t--}},Touchstart:function(t,u){return this.TouchEvent(t,u,"Mousedown")},Touchend:function(t,u){return this.TouchEvent(t,u,"Mouseup")},TouchEvent:function(u,v,t){if(this!==c.lastItem){if(c.lastMenu){g.Event(u,c.lastMenu,"Mouseout")}g.Event(u,v,"Mouseover",true);c.lastItem=this;c.lastMenu=v}if(this.nativeTouch){return null}g.Event(u,v,t);return false},Remove:function(t,u){u=u.parentNode.menuItem;return u.Remove(t,u)},With:function(t){if(t){f.Insert(this,t)}return this},isRTL:function(){return g.isRTL},rtlClass:function(){return(this.isRTL()?" RTL":"")}},{GetMenuNode:function(t){return t.parentNode}});g.ENTRY=g.ITEM.Subclass({role:"menuitem",Attributes:function(t){t=f.Insert({onmouseover:g.Mouseover,onmouseout:g.Mouseout,onmousedown:g.Mousedown,onkeydown:g.Keydown,"aria-disabled":!!this.disabled},t);t=this.SUPER(arguments).Attributes.call(this,t);if(this.disabled){t.className+=" MathJax_MenuDisabled"}return t},MoveVertical:function(t,D,v){var w=c.GetMenuNode(D);var C=[];for(var y=0,B=w.menuItem.items,x;x=B[y];y++){if(!x.hidden){C.push(x)}}var A=g.IndexOf(C,this);if(A===-1){return}var z=C.length;var u=w.childNodes;do{A=g.Mod(v(A),z)}while(C[A].hidden||!u[A].role||u[A].role==="separator");this.Deactivate(D);C[A].Activate(t,u[A])},Up:function(u,t){this.MoveVertical(u,t,function(v){return v-1})},Down:function(u,t){this.MoveVertical(u,t,function(v){return v+1})},Right:function(u,t){this.MoveHorizontal(u,t,g.Right,!this.isRTL())},Left:function(u,t){this.MoveHorizontal(u,t,g.Left,this.isRTL())},MoveHorizontal:function(z,y,t,A){var w=c.GetMenuNode(y);if(w.menuItem===g.menu&&z.shiftKey){t(z,y)}if(A){return}if(w.menuItem!==g.menu){this.Deactivate(y)}var u=w.previousSibling.childNodes;var x=u.length;while(x--){var v=u[x];if(v.menuItem.submenu&&v.menuItem.submenu===w.menuItem){g.Focus(v);break}}this.RemoveSubmenus(y)},Space:function(t,u){this.Mouseup(t,u)},Activate:function(t,u){this.Deactivate(u);if(!this.disabled){u.className+=" MathJax_MenuActive"}this.DeactivateSubmenus(u);g.Focus(u)},Deactivate:function(t){t.className=t.className.replace(/ MathJax_MenuActive/,"")}});g.ITEM.COMMAND=g.ENTRY.Subclass({action:function(){},Init:function(t,v,u){if(!(t instanceof Array)){t=[t,t]}this.name=t;this.action=v;this.With(u)},Label:function(t,u){return[this.Name()]},Mouseup:function(t,u){if(!this.disabled){this.Remove(t,u);d.Post(["command",this]);this.action.call(this,t)}return m(t)}});g.ITEM.SUBMENU=g.ENTRY.Subclass({submenu:null,marker:"\u25BA",markerRTL:"\u25C4",Attributes:function(t){t=f.Insert({"aria-haspopup":"true"},t);t=this.SUPER(arguments).Attributes.call(this,t);return t},Init:function(t,v){if(!(t instanceof Array)){t=[t,t]}this.name=t;var u=1;if(!(v instanceof g.ITEM)){this.With(v),u++}this.submenu=g.apply(g,[].slice.call(arguments,u))},Label:function(t,u){this.submenu.posted=false;return[this.Name()+" ",["span",{className:"MathJax_MenuArrow"+this.rtlClass()},[this.isRTL()?this.markerRTL:this.marker]]]},Timer:function(t,u){this.ClearTimer();t={type:t.type,clientX:t.clientX,clientY:t.clientY};this.timer=setTimeout(e(["Mouseup",this,t,u]),r.delay)},ClearTimer:function(){if(this.timer){clearTimeout(this.timer)}},Touchend:function(u,w){var v=this.submenu.posted;var t=this.SUPER(arguments).Touchend.apply(this,arguments);if(v){this.Deactivate(w);delete c.lastItem;delete c.lastMenu}return t},Mouseout:function(t,u){if(!this.submenu.posted){this.Deactivate(u)}this.ClearTimer()},Mouseover:function(t,u){this.Activate(t,u)},Mouseup:function(t,u){if(!this.disabled){if(!this.submenu.posted){this.ClearTimer();this.submenu.Post(t,u,this.ltr);g.Focus(u)}else{this.DeactivateSubmenus(u)}}return m(t)},Activate:function(t,u){if(!this.disabled){this.Deactivate(u);u.className+=" MathJax_MenuActive"}if(!this.submenu.posted){this.DeactivateSubmenus(u);if(!g.isMobile){this.Timer(t,u)}}g.Focus(u)},MoveVertical:function(v,u,t){this.ClearTimer();this.SUPER(arguments).MoveVertical.apply(this,arguments)},MoveHorizontal:function(v,x,u,w){if(!w){this.SUPER(arguments).MoveHorizontal.apply(this,arguments);return}if(this.disabled){return}if(!this.submenu.posted){this.Activate(v,x);return}var t=c.GetMenuNode(x).nextSibling.childNodes;if(t.length>0){this.submenu.items[0].Activate(v,t[0])}}});g.ITEM.RADIO=g.ENTRY.Subclass({variable:null,marker:(a?"\u25CF":"\u2713"),role:"menuitemradio",Attributes:function(u){var t=r.settings[this.variable]===this.value?"true":"false";u=f.Insert({"aria-checked":t},u);u=this.SUPER(arguments).Attributes.call(this,u);return u},Init:function(u,t,v){if(!(u instanceof Array)){u=[u,u]}this.name=u;this.variable=t;this.With(v);if(this.value==null){this.value=this.name[0]}},Label:function(u,v){var t={className:"MathJax_MenuRadioCheck"+this.rtlClass()};if(r.settings[this.variable]!==this.value){t={style:{display:"none"}}}return[["span",t,[this.marker]]," "+this.Name()]},Mouseup:function(w,x){if(!this.disabled){var y=x.parentNode.childNodes;for(var u=0,t=y.length;u/g,">");var x=s("EqSource","MathJax Equation Source");if(g.isMobile){t.document.open();t.document.write(""+x+"");t.document.write("
"+y+"
");t.document.write("
");t.document.write("");t.document.close()}else{t.document.open();t.document.write(""+x+"");t.document.write("
"+y+"
");t.document.write("");t.document.close();var u=t.document.body.firstChild;setTimeout(function(){var A=(t.outerHeight-t.innerHeight)||30,z=(t.outerWidth-t.innerWidth)||30,w,D;z=Math.max(140,Math.min(Math.floor(0.5*screen.width),u.offsetWidth+z+25));A=Math.max(40,Math.min(Math.floor(0.5*screen.height),u.offsetHeight+A+25));if(g.prototype.msieHeightBug){A+=35}t.resizeTo(z,A);var C;try{C=v.screenX}catch(B){}if(v&&C!=null){w=Math.max(0,Math.min(v.screenX-Math.floor(z/2),screen.width-z-20));D=Math.max(0,Math.min(v.screenY-Math.floor(A/2),screen.height-A-20));t.moveTo(w,D)}},50)}};g.Scale=function(){var y=["CommonHTML","HTML-CSS","SVG","NativeMML","PreviewHTML"],t=y.length,x=100,v,u;for(v=0;v7;g.Augment({margin:20,msieBackgroundBug:((document.documentMode||0)<9),msieFixedPositionBug:(u||!v),msieAboutBug:u,msieHeightBug:((document.documentMode||0)<9)});if(l){delete r.styles["#MathJax_About"].filter;delete r.styles[".MathJax_Menu"].filter}},Firefox:function(t){g.skipMouseover=t.isMobile&&t.versionAtLeast("6.0");g.skipMousedown=t.isMobile}});g.isMobile=f.Browser.isMobile;g.noContextMenu=f.Browser.noContextMenu;g.CreateLocaleMenu=function(){if(!g.menu){return}var y=g.menu.Find("Language").submenu,v=y.items;var u=[],A=MathJax.Localization.strings;for(var z in A){if(A.hasOwnProperty(z)){u.push(z)}}u=u.sort();y.items=[];for(var w=0,t=u.length;w0&&this.Get("scriptlevel")>0&&g>=0){return""}return this.TEXSPACELENGTH[Math.abs(g)]},TEXSPACELENGTH:["",a.LENGTH.THINMATHSPACE,a.LENGTH.MEDIUMMATHSPACE,a.LENGTH.THICKMATHSPACE],TEXSPACE:[[0,-1,2,3,0,0,0,1],[-1,-1,0,3,0,0,0,1],[2,2,0,0,2,0,0,2],[3,3,0,0,3,0,0,3],[0,0,0,0,0,0,0,0],[0,-1,2,3,0,0,0,1],[1,1,0,1,1,1,1,1],[1,-1,2,3,1,0,1,1]],autoDefault:function(e){return""},isSpacelike:function(){return false},isEmbellished:function(){return false},Core:function(){return this},CoreMO:function(){return this},childIndex:function(g){if(g==null){return}for(var f=0,e=this.data.length;f=55296&&e.charCodeAt(0)<56320)?a.VARIANT.ITALIC:a.VARIANT.NORMAL)}return""},setTeXclass:function(f){this.getPrevClass(f);var e=this.data.join("");if(e.length>1&&e.match(/^[a-z][a-z0-9]*$/i)&&this.texClass===a.TEXCLASS.ORD){this.texClass=a.TEXCLASS.OP;this.autoOP=true}return this}});a.mn=a.mbase.Subclass({type:"mn",isToken:true,texClass:a.TEXCLASS.ORD,defaults:{mathvariant:a.INHERIT,mathsize:a.INHERIT,mathbackground:a.INHERIT,mathcolor:a.INHERIT,dir:a.INHERIT}});a.mo=a.mbase.Subclass({type:"mo",isToken:true,defaults:{mathvariant:a.INHERIT,mathsize:a.INHERIT,mathbackground:a.INHERIT,mathcolor:a.INHERIT,dir:a.INHERIT,form:a.AUTO,fence:a.AUTO,separator:a.AUTO,lspace:a.AUTO,rspace:a.AUTO,stretchy:a.AUTO,symmetric:a.AUTO,maxsize:a.AUTO,minsize:a.AUTO,largeop:a.AUTO,movablelimits:a.AUTO,accent:a.AUTO,linebreak:a.LINEBREAK.AUTO,lineleading:a.INHERIT,linebreakstyle:a.AUTO,linebreakmultchar:a.INHERIT,indentalign:a.INHERIT,indentshift:a.INHERIT,indenttarget:a.INHERIT,indentalignfirst:a.INHERIT,indentshiftfirst:a.INHERIT,indentalignlast:a.INHERIT,indentshiftlast:a.INHERIT,texClass:a.AUTO},defaultDef:{form:a.FORM.INFIX,fence:false,separator:false,lspace:a.LENGTH.THICKMATHSPACE,rspace:a.LENGTH.THICKMATHSPACE,stretchy:false,symmetric:false,maxsize:a.SIZE.INFINITY,minsize:"0em",largeop:false,movablelimits:false,accent:false,linebreak:a.LINEBREAK.AUTO,lineleading:"1ex",linebreakstyle:"before",indentalign:a.INDENTALIGN.AUTO,indentshift:"0",indenttarget:"",indentalignfirst:a.INDENTALIGN.INDENTALIGN,indentshiftfirst:a.INDENTSHIFT.INDENTSHIFT,indentalignlast:a.INDENTALIGN.INDENTALIGN,indentshiftlast:a.INDENTSHIFT.INDENTSHIFT,texClass:a.TEXCLASS.REL},SPACE_ATTR:{lspace:1,rspace:2,form:4},useMMLspacing:7,autoDefault:function(g,n){var l=this.def;if(!l){if(g==="form"){this.useMMLspacing&=~this.SPACE_ATTR.form;return this.getForm()}var k=this.data.join("");var f=[this.Get("form"),a.FORM.INFIX,a.FORM.POSTFIX,a.FORM.PREFIX];for(var h=0,e=f.length;h=55296&&k<56320){k=(((k-55296)<<10)+(j.charCodeAt(1)-56320))+65536}for(var g=0,e=this.RANGES.length;g=0;e--){if(this.data[0]&&!this.data[e].isSpacelike()){return this.data[e]}}return null},Core:function(){if(!(this.isEmbellished())||typeof(this.core)==="undefined"){return this}return this.data[this.core]},CoreMO:function(){if(!(this.isEmbellished())||typeof(this.core)==="undefined"){return this}return this.data[this.core].CoreMO()},toString:function(){if(this.inferred){return"["+this.data.join(",")+"]"}return this.SUPER(arguments).toString.call(this)},setTeXclass:function(g){var f,e=this.data.length;if((this.open||this.close)&&(!g||!g.fnOP)){this.getPrevClass(g);g=null;for(f=0;f0){e++}return e},adjustChild_texprimestyle:function(e){if(e==this.den){return true}return this.Get("texprimestyle")},setTeXclass:a.mbase.setSeparateTeXclasses});a.msqrt=a.mbase.Subclass({type:"msqrt",inferRow:true,linebreakContainer:true,texClass:a.TEXCLASS.ORD,setTeXclass:a.mbase.setSeparateTeXclasses,adjustChild_texprimestyle:function(e){return true}});a.mroot=a.mbase.Subclass({type:"mroot",linebreakContainer:true,texClass:a.TEXCLASS.ORD,adjustChild_displaystyle:function(e){if(e===1){return false}return this.Get("displaystyle")},adjustChild_scriptlevel:function(f){var e=this.Get("scriptlevel");if(f===1){e+=2}return e},adjustChild_texprimestyle:function(e){if(e===0){return true}return this.Get("texprimestyle")},setTeXclass:a.mbase.setSeparateTeXclasses});a.mstyle=a.mbase.Subclass({type:"mstyle",isSpacelike:a.mbase.childrenSpacelike,isEmbellished:a.mbase.childEmbellished,Core:a.mbase.childCore,CoreMO:a.mbase.childCoreMO,inferRow:true,defaults:{scriptlevel:a.INHERIT,displaystyle:a.INHERIT,scriptsizemultiplier:Math.sqrt(1/2),scriptminsize:"8pt",mathbackground:a.INHERIT,mathcolor:a.INHERIT,dir:a.INHERIT,infixlinebreakstyle:a.LINEBREAKSTYLE.BEFORE,decimalseparator:"."},adjustChild_scriptlevel:function(g){var f=this.scriptlevel;if(f==null){f=this.Get("scriptlevel")}else{if(String(f).match(/^ *[-+]/)){var e=this.Get("scriptlevel",null,true);f=e+parseInt(f)}}return f},inheritFromMe:true,noInherit:{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:a.mbase.setChildTeXclass});a.merror=a.mbase.Subclass({type:"merror",inferRow:true,linebreakContainer:true,texClass:a.TEXCLASS.ORD});a.mpadded=a.mbase.Subclass({type:"mpadded",inferRow:true,isSpacelike:a.mbase.childrenSpacelike,isEmbellished:a.mbase.childEmbellished,Core:a.mbase.childCore,CoreMO:a.mbase.childCoreMO,defaults:{mathbackground:a.INHERIT,mathcolor:a.INHERIT,width:"",height:"",depth:"",lspace:0,voffset:0},setTeXclass:a.mbase.setChildTeXclass});a.mphantom=a.mbase.Subclass({type:"mphantom",texClass:a.TEXCLASS.ORD,inferRow:true,isSpacelike:a.mbase.childrenSpacelike,isEmbellished:a.mbase.childEmbellished,Core:a.mbase.childCore,CoreMO:a.mbase.childCoreMO,setTeXclass:a.mbase.setChildTeXclass});a.mfenced=a.mbase.Subclass({type:"mfenced",defaults:{mathbackground:a.INHERIT,mathcolor:a.INHERIT,open:"(",close:")",separators:","},addFakeNodes:function(){var f=this.getValues("open","close","separators");f.open=f.open.replace(/[ \t\n\r]/g,"");f.close=f.close.replace(/[ \t\n\r]/g,"");f.separators=f.separators.replace(/[ \t\n\r]/g,"");if(f.open!==""){this.SetData("open",a.mo(f.open).With({fence:true,form:a.FORM.PREFIX,texClass:a.TEXCLASS.OPEN}));this.data.open.useMMLspacing=0}if(f.separators!==""){while(f.separators.length0){return false}return this.Get("displaystyle")},adjustChild_scriptlevel:function(f){var e=this.Get("scriptlevel");if(f>0){e++}return e},adjustChild_texprimestyle:function(e){if(e===this.sub){return true}return this.Get("texprimestyle")},setTeXclass:a.mbase.setBaseTeXclasses});a.msub=a.msubsup.Subclass({type:"msub"});a.msup=a.msubsup.Subclass({type:"msup",sub:2,sup:1});a.mmultiscripts=a.msubsup.Subclass({type:"mmultiscripts",adjustChild_texprimestyle:function(e){if(e%2===1){return true}return this.Get("texprimestyle")}});a.mprescripts=a.mbase.Subclass({type:"mprescripts"});a.none=a.mbase.Subclass({type:"none"});a.munderover=a.mbase.Subclass({type:"munderover",base:0,under:1,over:2,sub:1,sup:2,ACCENTS:["","accentunder","accent"],linebreakContainer:true,isEmbellished:a.mbase.childEmbellished,Core:a.mbase.childCore,CoreMO:a.mbase.childCoreMO,defaults:{mathbackground:a.INHERIT,mathcolor:a.INHERIT,accent:a.AUTO,accentunder:a.AUTO,align:a.ALIGN.CENTER,texClass:a.AUTO,subscriptshift:"",superscriptshift:""},autoDefault:function(e){if(e==="texClass"){return(this.isEmbellished()?this.CoreMO().Get(e):a.TEXCLASS.ORD)}if(e==="accent"&&this.data[this.over]){return this.data[this.over].CoreMO().Get("accent")}if(e==="accentunder"&&this.data[this.under]){return this.data[this.under].CoreMO().Get("accent")}return false},adjustChild_displaystyle:function(e){if(e>0){return false}return this.Get("displaystyle")},adjustChild_scriptlevel:function(g){var f=this.Get("scriptlevel");var e=(this.data[this.base]&&!this.Get("displaystyle")&&this.data[this.base].CoreMO().Get("movablelimits"));if(g==this.under&&(e||!this.Get("accentunder"))){f++}if(g==this.over&&(e||!this.Get("accent"))){f++}return f},adjustChild_texprimestyle:function(e){if(e===this.base&&this.data[this.over]){return true}return this.Get("texprimestyle")},setTeXclass:a.mbase.setBaseTeXclasses});a.munder=a.munderover.Subclass({type:"munder"});a.mover=a.munderover.Subclass({type:"mover",over:1,under:2,sup:1,sub:2,ACCENTS:["","accent","accentunder"]});a.mtable=a.mbase.Subclass({type:"mtable",defaults:{mathbackground:a.INHERIT,mathcolor:a.INHERIT,align:a.ALIGN.AXIS,rowalign:a.ALIGN.BASELINE,columnalign:a.ALIGN.CENTER,groupalign:"{left}",alignmentscope:true,columnwidth:a.WIDTH.AUTO,width:a.WIDTH.AUTO,rowspacing:"1ex",columnspacing:".8em",rowlines:a.LINES.NONE,columnlines:a.LINES.NONE,frame:a.LINES.NONE,framespacing:"0.4em 0.5ex",equalrows:false,equalcolumns:false,displaystyle:false,side:a.SIDE.RIGHT,minlabelspacing:"0.8em",texClass:a.TEXCLASS.ORD,useHeight:1},adjustChild_displaystyle:function(){return(this.displaystyle!=null?this.displaystyle:this.defaults.displaystyle)},inheritFromMe:true,noInherit:{mover:{align:true},munder:{align:true},munderover:{align:true},mtable:{align:true,rowalign:true,columnalign:true,groupalign:true,alignmentscope:true,columnwidth:true,width:true,rowspacing:true,columnspacing:true,rowlines:true,columnlines:true,frame:true,framespacing:true,equalrows:true,equalcolumns:true,displaystyle:true,side:true,minlabelspacing:true,texClass:true,useHeight:1}},linebreakContainer:true,Append:function(){for(var f=0,e=arguments.length;f>10)+55296)+String.fromCharCode((e&1023)+56320)}});a.xml=a.mbase.Subclass({type:"xml",Init:function(){this.div=document.createElement("div");return this.SUPER(arguments).Init.apply(this,arguments)},Append:function(){for(var f=0,e=arguments.length;f":d.REL,"?":[1,1,b.CLOSE],"\\":d.ORD,"^":d.ORD11,_:d.ORD11,"|":[2,2,b.ORD,{fence:true,stretchy:true,symmetric:true}],"#":d.ORD,"$":d.ORD,"\u002E":[0,3,b.PUNCT,{separator:true}],"\u02B9":d.ORD,"\u0300":d.ACCENT,"\u0301":d.ACCENT,"\u0303":d.WIDEACCENT,"\u0304":d.ACCENT,"\u0306":d.ACCENT,"\u0307":d.ACCENT,"\u0308":d.ACCENT,"\u030C":d.ACCENT,"\u0332":d.WIDEACCENT,"\u0338":d.REL4,"\u2015":[0,0,b.ORD,{stretchy:true}],"\u2017":[0,0,b.ORD,{stretchy:true}],"\u2020":d.BIN3,"\u2021":d.BIN3,"\u20D7":d.ACCENT,"\u2111":d.ORD,"\u2113":d.ORD,"\u2118":d.ORD,"\u211C":d.ORD,"\u2205":d.ORD,"\u221E":d.ORD,"\u2305":d.BIN3,"\u2306":d.BIN3,"\u2322":d.REL4,"\u2323":d.REL4,"\u2329":d.OPEN,"\u232A":d.CLOSE,"\u23AA":d.ORD,"\u23AF":[0,0,b.ORD,{stretchy:true}],"\u23B0":d.OPEN,"\u23B1":d.CLOSE,"\u2500":d.ORD,"\u25EF":d.BIN3,"\u2660":d.ORD,"\u2661":d.ORD,"\u2662":d.ORD,"\u2663":d.ORD,"\u3008":d.OPEN,"\u3009":d.CLOSE,"\uFE37":d.WIDEACCENT,"\uFE38":d.WIDEACCENT}}},{OPTYPES:d});var c=a.mo.prototype.OPTABLE;c.infix["^"]=d.WIDEREL;c.infix._=d.WIDEREL;c.prefix["\u2223"]=d.OPEN;c.prefix["\u2225"]=d.OPEN;c.postfix["\u2223"]=d.CLOSE;c.postfix["\u2225"]=d.CLOSE})(MathJax.ElementJax.mml);MathJax.ElementJax.mml.loadComplete("jax.js"); +MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function(){var c="2.6.1";var a=MathJax.ElementJax.mml,b=MathJax.Hub.config.menuSettings;a.mbase.Augment({toMathML:function(l){var h=(this.inferred&&this.parent.inferRow);if(l==null){l=""}var f=this.type,e=this.toMathMLattributes();if(f==="mspace"){return l+"<"+f+e+" />"}var k=[],j=(this.isToken?"":l+(h?"":" "));for(var g=0,d=this.data.length;g")}}}if(this.isToken||this.isChars){return l+"<"+f+e+">"+k.join("")+""}if(h){return k.join("\n")}if(k.length===0||(k.length===1&&k[0]==="")){return l+"<"+f+e+" />"}return l+"<"+f+e+">\n"+k.join("\n")+"\n"+l+""},toMathMLattributes:function(){var j=(this.type==="mstyle"?a.math.prototype.defaults:this.defaults);var h=(this.attrNames||a.copyAttributeNames),g=a.skipAttributes,l=a.copyAttributes;var e=[];if(this.type==="math"&&(!this.attr||!this.attr.xmlns)){e.push('xmlns="http://www.w3.org/1998/Math/MathML"')}if(!this.attrNames){for(var k in j){if(!g[k]&&!l[k]&&j.hasOwnProperty(k)){if(this[k]!=null&&this[k]!==j[k]){if(this.Get(k,null,1)!==this[k]){e.push(k+'="'+this.toMathMLattribute(this[k])+'"')}}}}}for(var f=0,d=h.length;f126||(k<32&&k!==10&&k!==13&&k!==9)){f[g]="&#x"+k.toString(16).toUpperCase()+";"}else{var j={"&":"&","<":"<",">":">",'"':"""}[f[g]];if(j){f[g]=j}}}else{if(g+11);var p=this.type,k=this.toMathMLattributes();var j=[],o=d+(g?" "+(n?" ":""):"")+" ";for(var h=0,f=this.data.length;h")}}if(j.length===0||(j.length===1&&j[0]==="")){if(!g){return"<"+p+k+" />"}j.push(o+"")}if(g){if(n){j.unshift(d+" ");j.push(d+" ")}j.unshift(d+" ");var l=e.originalText.replace(/[&<>]/g,function(i){return{">":">","<":"<","&":"&"}[i]});j.push(d+' '+l+"");j.push(d+" ")}return d+"<"+p+k+">\n"+j.join("\n")+"\n"+d+""}});a.msubsup.Augment({toMathML:function(j){var f=this.type;if(this.data[this.sup]==null){f="msub"}if(this.data[this.sub]==null){f="msup"}var e=this.toMathMLattributes();delete this.data[0].inferred;var h=[];for(var g=0,d=this.data.length;g\n"+h.join("\n")+"\n"+j+""}});a.munderover.Augment({toMathML:function(k){var f=this.type;var j=this.data[this.base];if(j&&j.isa(a.TeXAtom)&&j.movablelimits&&!j.Get("displaystyle")){type="msubsup";if(this.data[this.under]==null){f="msup"}if(this.data[this.over]==null){f="msub"}}else{if(this.data[this.under]==null){f="mover"}if(this.data[this.over]==null){f="munder"}}var e=this.toMathMLattributes();delete this.data[0].inferred;var h=[];for(var g=0,d=this.data.length;g\n"+h.join("\n")+"\n"+k+""}});a.TeXAtom.Augment({toMathML:function(e){var d=this.toMathMLattributes();if(!d&&this.data[0].data.length===1){return e.substr(2)+this.data[0].toMathML(e)}return e+"\n"+this.data[0].toMathML(e+" ")+"\n"+e+""}});a.chars.Augment({toMathML:function(d){return(d||"")+this.toMathMLquote(this.toString())}});a.entity.Augment({toMathML:function(d){return(d||"")+"&"+this.data[0]+";"}});a.xml.Augment({toMathML:function(d){return(d||"")+this.toString()}});MathJax.Hub.Register.StartupHook("TeX mathchoice Ready",function(){a.TeXmathchoice.Augment({toMathML:function(d){return this.Core().toMathML(d)}})});MathJax.Hub.Startup.signal.Post("toMathML Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/toMathML.js"); +(function(b,e){var d="2.6.0";var a=b.CombineConfig("TeX.noErrors",{disabled:false,multiLine:true,inlineDelimiters:["",""],style:{"font-size":"90%","text-align":"left",color:"black",padding:"1px 3px",border:"1px solid"}});var c="\u00A0";MathJax.Extension["TeX/noErrors"]={version:d,config:a};b.Register.StartupHook("TeX Jax Ready",function(){var f=MathJax.InputJax.TeX.formatError;MathJax.InputJax.TeX.Augment({formatError:function(j,i,k,g){if(a.disabled){return f.apply(this,arguments)}var h=j.message.replace(/\n.*/,"");b.signal.Post(["TeX Jax - parse error",h,i,k,g]);var m=a.inlineDelimiters;var l=(k||a.multiLine);if(!k){i=m[0]+i+m[1]}if(l){i=i.replace(/ /g,c)}else{i=i.replace(/\n/g," ")}return MathJax.ElementJax.mml.merror(i).With({isError:true,multiLine:l})}})});b.Register.StartupHook("HTML-CSS Jax Config",function(){b.Config({"HTML-CSS":{styles:{".MathJax .noError":b.Insert({"vertical-align":(b.Browser.isMSIE&&a.multiLine?"-2px":"")},a.style)}}})});b.Register.StartupHook("HTML-CSS Jax Ready",function(){var g=MathJax.ElementJax.mml;var h=MathJax.OutputJax["HTML-CSS"];var f=g.math.prototype.toHTML,i=g.merror.prototype.toHTML;g.math.Augment({toHTML:function(j,k){var l=this.data[0];if(l&&l.data[0]&&l.data[0].isError){j.style.fontSize="";j=this.HTMLcreateSpan(j);j.bbox=l.data[0].toHTML(j).bbox}else{j=f.apply(this,arguments)}return j}});g.merror.Augment({toHTML:function(p){if(!this.isError){return i.apply(this,arguments)}p=this.HTMLcreateSpan(p);p.className="noError";if(this.multiLine){p.style.display="inline-block"}var r=this.data[0].data[0].data.join("").split(/\n/);for(var o=0,l=r.length;o1){var n=(q.h+q.d)/2,j=h.TeX.x_height/2;p.parentNode.style.verticalAlign=h.Em(q.d+(j-n));q.h=j+n;q.d=n-j}p.bbox={h:q.h,d:q.d,w:k,lw:0,rw:k};return p}})});b.Register.StartupHook("SVG Jax Config",function(){b.Config({SVG:{styles:{".MathJax_SVG .noError":b.Insert({"vertical-align":(b.Browser.isMSIE&&a.multiLine?"-2px":"")},a.style)}}})});b.Register.StartupHook("SVG Jax Ready",function(){var g=MathJax.ElementJax.mml;var f=g.math.prototype.toSVG,h=g.merror.prototype.toSVG;g.math.Augment({toSVG:function(i,j){var k=this.data[0];if(k&&k.data[0]&&k.data[0].isError){i=k.data[0].toSVG(i)}else{i=f.apply(this,arguments)}return i}});g.merror.Augment({toSVG:function(n){if(!this.isError||this.Parent().type!=="math"){return h.apply(this,arguments)}n=e.addElement(n,"span",{className:"noError",isMathJax:true});if(this.multiLine){n.style.display="inline-block"}var o=this.data[0].data[0].data.join("").split(/\n/);for(var l=0,j=o.length;l1){var k=n.offsetHeight/2;n.style.verticalAlign=(-k+(k/j))+"px"}return n}})});b.Register.StartupHook("NativeMML Jax Ready",function(){var h=MathJax.ElementJax.mml;var g=MathJax.Extension["TeX/noErrors"].config;var f=h.math.prototype.toNativeMML,i=h.merror.prototype.toNativeMML;h.math.Augment({toNativeMML:function(j){var k=this.data[0];if(k&&k.data[0]&&k.data[0].isError){j=k.data[0].toNativeMML(j)}else{j=f.apply(this,arguments)}return j}});h.merror.Augment({toNativeMML:function(n){if(!this.isError){return i.apply(this,arguments)}n=n.appendChild(document.createElement("span"));var o=this.data[0].data[0].data.join("").split(/\n/);for(var l=0,k=o.length;l1){n.style.verticalAlign="middle"}}for(var p in g.style){if(g.style.hasOwnProperty(p)){var j=p.replace(/-./g,function(m){return m.charAt(1).toUpperCase()});n.style[j]=g.style[p]}}return n}})});b.Register.StartupHook("PreviewHTML Jax Config",function(){b.Config({PreviewHTML:{styles:{".MathJax_PHTML .noError":b.Insert({"vertical-align":(b.Browser.isMSIE&&a.multiLine?"-2px":"")},a.style)}}})});b.Register.StartupHook("PreviewHTML Jax Ready",function(){var f=MathJax.ElementJax.mml;var h=MathJax.HTML;var g=f.merror.prototype.toPreviewHTML;f.merror.Augment({toPreviewHTML:function(l){if(!this.isError){return g.apply(this,arguments)}l=this.PHTMLcreateSpan(l);l.className="noError";if(this.multiLine){l.style.display="inline-block"}var n=this.data[0].data[0].data.join("").split(/\n/);for(var k=0,j=n.length;k1){var l=1.2*j/2;o.h=l+0.25;o.d=l-0.25;n.style.verticalAlign=g.Em(0.45-l)}else{o.h=1;o.d=0.2+2/g.em}return n}})});b.Startup.signal.Post("TeX noErrors Ready")})(MathJax.Hub,MathJax.HTML);MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/noErrors.js"); +MathJax.Extension["TeX/noUndefined"]={version:"2.6.0",config:MathJax.Hub.CombineConfig("TeX.noUndefined",{disabled:false,attributes:{mathcolor:"red"}})};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var b=MathJax.Extension["TeX/noUndefined"].config;var a=MathJax.ElementJax.mml;var c=MathJax.InputJax.TeX.Parse.prototype.csUndefined;MathJax.InputJax.TeX.Parse.Augment({csUndefined:function(d){if(b.disabled){return c.apply(this,arguments)}MathJax.Hub.signal.Post(["TeX Jax - undefined control sequence",d]);this.Push(a.mtext(d).With(b.attributes))}});MathJax.Hub.Startup.signal.Post("TeX noUndefined Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/noUndefined.js"); +(function(d,c,i){var h,g="\u00A0";var j=function(l){return MathJax.Localization._.apply(MathJax.Localization,[["TeX",l]].concat([].slice.call(arguments,1)))};var e=MathJax.Object.Subclass({Init:function(m,l){this.global={isInner:l};this.data=[b.start(this.global)];if(m){this.data[0].env=m}this.env=this.data[0].env},Push:function(){var n,l,o,p;for(n=0,l=arguments.length;n":"27E9","\\lt":"27E8","\\gt":"27E9","/":"/","|":["|",{texClass:h.TEXCLASS.ORD}],".":"","\\\\":"\\","\\lmoustache":"23B0","\\rmoustache":"23B1","\\lgroup":"27EE","\\rgroup":"27EF","\\arrowvert":"23D0","\\Arrowvert":"2016","\\bracevert":"23AA","\\Vert":["2225",{texClass:h.TEXCLASS.ORD}],"\\|":["2225",{texClass:h.TEXCLASS.ORD}],"\\vert":["|",{texClass:h.TEXCLASS.ORD}],"\\uparrow":"2191","\\downarrow":"2193","\\updownarrow":"2195","\\Uparrow":"21D1","\\Downarrow":"21D3","\\Updownarrow":"21D5","\\backslash":"\\","\\rangle":"27E9","\\langle":"27E8","\\rbrace":"}","\\lbrace":"{","\\}":"}","\\{":"{","\\rceil":"2309","\\lceil":"2308","\\rfloor":"230B","\\lfloor":"230A","\\lbrack":"[","\\rbrack":"]"},macros:{displaystyle:["SetStyle","D",true,0],textstyle:["SetStyle","T",false,0],scriptstyle:["SetStyle","S",false,1],scriptscriptstyle:["SetStyle","SS",false,2],rm:["SetFont",h.VARIANT.NORMAL],mit:["SetFont",h.VARIANT.ITALIC],oldstyle:["SetFont",h.VARIANT.OLDSTYLE],cal:["SetFont",h.VARIANT.CALIGRAPHIC],it:["SetFont","-tex-mathit"],bf:["SetFont",h.VARIANT.BOLD],bbFont:["SetFont",h.VARIANT.DOUBLESTRUCK],scr:["SetFont",h.VARIANT.SCRIPT],frak:["SetFont",h.VARIANT.FRAKTUR],sf:["SetFont",h.VARIANT.SANSSERIF],tt:["SetFont",h.VARIANT.MONOSPACE],tiny:["SetSize",0.5],Tiny:["SetSize",0.6],scriptsize:["SetSize",0.7],small:["SetSize",0.85],normalsize:["SetSize",1],large:["SetSize",1.2],Large:["SetSize",1.44],LARGE:["SetSize",1.73],huge:["SetSize",2.07],Huge:["SetSize",2.49],arcsin:["NamedFn"],arccos:["NamedFn"],arctan:["NamedFn"],arg:["NamedFn"],cos:["NamedFn"],cosh:["NamedFn"],cot:["NamedFn"],coth:["NamedFn"],csc:["NamedFn"],deg:["NamedFn"],det:"NamedOp",dim:["NamedFn"],exp:["NamedFn"],gcd:"NamedOp",hom:["NamedFn"],inf:"NamedOp",ker:["NamedFn"],lg:["NamedFn"],lim:"NamedOp",liminf:["NamedOp","lim inf"],limsup:["NamedOp","lim sup"],ln:["NamedFn"],log:["NamedFn"],max:"NamedOp",min:"NamedOp",Pr:"NamedOp",sec:["NamedFn"],sin:["NamedFn"],sinh:["NamedFn"],sup:"NamedOp",tan:["NamedFn"],tanh:["NamedFn"],limits:["Limits",1],nolimits:["Limits",0],overline:["UnderOver","00AF",null,1],underline:["UnderOver","005F"],overbrace:["UnderOver","23DE",1],underbrace:["UnderOver","23DF",1],overparen:["UnderOver","23DC"],underparen:["UnderOver","23DD"],overrightarrow:["UnderOver","2192"],underrightarrow:["UnderOver","2192"],overleftarrow:["UnderOver","2190"],underleftarrow:["UnderOver","2190"],overleftrightarrow:["UnderOver","2194"],underleftrightarrow:["UnderOver","2194"],overset:"Overset",underset:"Underset",stackrel:["Macro","\\mathrel{\\mathop{#2}\\limits^{#1}}",2],over:"Over",overwithdelims:"Over",atop:"Over",atopwithdelims:"Over",above:"Over",abovewithdelims:"Over",brace:["Over","{","}"],brack:["Over","[","]"],choose:["Over","(",")"],frac:"Frac",sqrt:"Sqrt",root:"Root",uproot:["MoveRoot","upRoot"],leftroot:["MoveRoot","leftRoot"],left:"LeftRight",right:"LeftRight",middle:"Middle",llap:"Lap",rlap:"Lap",raise:"RaiseLower",lower:"RaiseLower",moveleft:"MoveLeftRight",moveright:"MoveLeftRight",",":["Spacer",h.LENGTH.THINMATHSPACE],":":["Spacer",h.LENGTH.MEDIUMMATHSPACE],">":["Spacer",h.LENGTH.MEDIUMMATHSPACE],";":["Spacer",h.LENGTH.THICKMATHSPACE],"!":["Spacer",h.LENGTH.NEGATIVETHINMATHSPACE],enspace:["Spacer",".5em"],quad:["Spacer","1em"],qquad:["Spacer","2em"],thinspace:["Spacer",h.LENGTH.THINMATHSPACE],negthinspace:["Spacer",h.LENGTH.NEGATIVETHINMATHSPACE],hskip:"Hskip",hspace:"Hskip",kern:"Hskip",mskip:"Hskip",mspace:"Hskip",mkern:"Hskip",Rule:["Rule"],Space:["Rule","blank"],big:["MakeBig",h.TEXCLASS.ORD,0.85],Big:["MakeBig",h.TEXCLASS.ORD,1.15],bigg:["MakeBig",h.TEXCLASS.ORD,1.45],Bigg:["MakeBig",h.TEXCLASS.ORD,1.75],bigl:["MakeBig",h.TEXCLASS.OPEN,0.85],Bigl:["MakeBig",h.TEXCLASS.OPEN,1.15],biggl:["MakeBig",h.TEXCLASS.OPEN,1.45],Biggl:["MakeBig",h.TEXCLASS.OPEN,1.75],bigr:["MakeBig",h.TEXCLASS.CLOSE,0.85],Bigr:["MakeBig",h.TEXCLASS.CLOSE,1.15],biggr:["MakeBig",h.TEXCLASS.CLOSE,1.45],Biggr:["MakeBig",h.TEXCLASS.CLOSE,1.75],bigm:["MakeBig",h.TEXCLASS.REL,0.85],Bigm:["MakeBig",h.TEXCLASS.REL,1.15],biggm:["MakeBig",h.TEXCLASS.REL,1.45],Biggm:["MakeBig",h.TEXCLASS.REL,1.75],mathord:["TeXAtom",h.TEXCLASS.ORD],mathop:["TeXAtom",h.TEXCLASS.OP],mathopen:["TeXAtom",h.TEXCLASS.OPEN],mathclose:["TeXAtom",h.TEXCLASS.CLOSE],mathbin:["TeXAtom",h.TEXCLASS.BIN],mathrel:["TeXAtom",h.TEXCLASS.REL],mathpunct:["TeXAtom",h.TEXCLASS.PUNCT],mathinner:["TeXAtom",h.TEXCLASS.INNER],vcenter:["TeXAtom",h.TEXCLASS.VCENTER],mathchoice:["Extension","mathchoice"],buildrel:"BuildRel",hbox:["HBox",0],text:"HBox",mbox:["HBox",0],fbox:"FBox",strut:"Strut",mathstrut:["Macro","\\vphantom{(}"],phantom:"Phantom",vphantom:["Phantom",1,0],hphantom:["Phantom",0,1],smash:"Smash",acute:["Accent","00B4"],grave:["Accent","0060"],ddot:["Accent","00A8"],tilde:["Accent","007E"],bar:["Accent","00AF"],breve:["Accent","02D8"],check:["Accent","02C7"],hat:["Accent","005E"],vec:["Accent","2192"],dot:["Accent","02D9"],widetilde:["Accent","007E",1],widehat:["Accent","005E",1],matrix:"Matrix",array:"Matrix",pmatrix:["Matrix","(",")"],cases:["Matrix","{","","left left",null,".1em",null,true],eqalign:["Matrix",null,null,"right left",h.LENGTH.THICKMATHSPACE,".5em","D"],displaylines:["Matrix",null,null,"center",null,".5em","D"],cr:"Cr","\\":"CrLaTeX",newline:"Cr",hline:["HLine","solid"],hdashline:["HLine","dashed"],eqalignno:["Matrix",null,null,"right left",h.LENGTH.THICKMATHSPACE,".5em","D",null,"right"],leqalignno:["Matrix",null,null,"right left",h.LENGTH.THICKMATHSPACE,".5em","D",null,"left"],hfill:"HFill",hfil:"HFill",hfilll:"HFill",bmod:["Macro",'\\mmlToken{mo}[lspace="thickmathspace" rspace="thickmathspace"]{mod}'],pmod:["Macro","\\pod{\\mmlToken{mi}{mod}\\kern 6mu #1}",1],mod:["Macro","\\mathchoice{\\kern18mu}{\\kern12mu}{\\kern12mu}{\\kern12mu}\\mmlToken{mi}{mod}\\,\\,#1",1],pod:["Macro","\\mathchoice{\\kern18mu}{\\kern8mu}{\\kern8mu}{\\kern8mu}(#1)",1],iff:["Macro","\\;\\Longleftrightarrow\\;"],skew:["Macro","{{#2{#3\\mkern#1mu}\\mkern-#1mu}{}}",3],mathcal:["Macro","{\\cal #1}",1],mathscr:["Macro","{\\scr #1}",1],mathrm:["Macro","{\\rm #1}",1],mathbf:["Macro","{\\bf #1}",1],mathbb:["Macro","{\\bbFont #1}",1],Bbb:["Macro","{\\bbFont #1}",1],mathit:["Macro","{\\it #1}",1],mathfrak:["Macro","{\\frak #1}",1],mathsf:["Macro","{\\sf #1}",1],mathtt:["Macro","{\\tt #1}",1],textrm:["Macro","\\mathord{\\rm\\text{#1}}",1],textit:["Macro","\\mathord{\\it\\text{#1}}",1],textbf:["Macro","\\mathord{\\bf\\text{#1}}",1],textsf:["Macro","\\mathord{\\sf\\text{#1}}",1],texttt:["Macro","\\mathord{\\tt\\text{#1}}",1],pmb:["Macro","\\rlap{#1}\\kern1px{#1}",1],TeX:["Macro","T\\kern-.14em\\lower.5ex{E}\\kern-.115em X"],LaTeX:["Macro","L\\kern-.325em\\raise.21em{\\scriptstyle{A}}\\kern-.17em\\TeX"]," ":["Macro","\\text{ }"],not:"Not",dots:"Dots",space:"Tilde","\u00A0":"Tilde",begin:"BeginEnd",end:"BeginEnd",newcommand:["Extension","newcommand"],renewcommand:["Extension","newcommand"],newenvironment:["Extension","newcommand"],renewenvironment:["Extension","newcommand"],def:["Extension","newcommand"],let:["Extension","newcommand"],verb:["Extension","verb"],boldsymbol:["Extension","boldsymbol"],tag:["Extension","AMSmath"],notag:["Extension","AMSmath"],label:["Extension","AMSmath"],ref:["Extension","AMSmath"],eqref:["Extension","AMSmath"],nonumber:["Macro","\\notag"],unicode:["Extension","unicode"],color:"Color",href:["Extension","HTML"],"class":["Extension","HTML"],style:["Extension","HTML"],cssId:["Extension","HTML"],bbox:["Extension","bbox"],mmlToken:"MmlToken",require:"Require"},environment:{array:["AlignedArray"],matrix:["Array",null,null,null,"c"],pmatrix:["Array",null,"(",")","c"],bmatrix:["Array",null,"[","]","c"],Bmatrix:["Array",null,"\\{","\\}","c"],vmatrix:["Array",null,"\\vert","\\vert","c"],Vmatrix:["Array",null,"\\Vert","\\Vert","c"],cases:["Array",null,"\\{",".","ll",null,".2em","T"],equation:[null,"Equation"],"equation*":[null,"Equation"],eqnarray:["ExtensionEnv",null,"AMSmath"],"eqnarray*":["ExtensionEnv",null,"AMSmath"],align:["ExtensionEnv",null,"AMSmath"],"align*":["ExtensionEnv",null,"AMSmath"],aligned:["ExtensionEnv",null,"AMSmath"],multline:["ExtensionEnv",null,"AMSmath"],"multline*":["ExtensionEnv",null,"AMSmath"],split:["ExtensionEnv",null,"AMSmath"],gather:["ExtensionEnv",null,"AMSmath"],"gather*":["ExtensionEnv",null,"AMSmath"],gathered:["ExtensionEnv",null,"AMSmath"],alignat:["ExtensionEnv",null,"AMSmath"],"alignat*":["ExtensionEnv",null,"AMSmath"],alignedat:["ExtensionEnv",null,"AMSmath"]},p_height:1.2/0.85});if(this.config.Macros){var l=this.config.Macros;for(var m in l){if(l.hasOwnProperty(m)){if(typeof(l[m])==="string"){f.macros[m]=["Macro",l[m]]}else{f.macros[m]=["Macro"].concat(l[m])}f.macros[m].isUser=true}}}};var a=MathJax.Object.Subclass({Init:function(m,n){this.string=m;this.i=0;this.macroCount=0;var l;if(n){l={};for(var o in n){if(n.hasOwnProperty(o)){l[o]=n[o]}}}this.stack=d.Stack(l,!!n);this.Parse();this.Push(b.stop())},Parse:function(){var m,l;while(this.i=55296&&l<56320){m+=this.string.charAt(this.i++)}if(f.special[m]){this[f.special[m]](m)}else{if(f.letter.test(m)){this.Variable(m)}else{if(f.digit.test(m)){this.Number(m)}else{this.Other(m)}}}}},Push:function(){this.stack.Push.apply(this.stack,arguments)},mml:function(){if(this.stack.Top().type!=="mml"){return null}return this.stack.Top().data[0]},mmlToken:function(l){return l},ControlSequence:function(o){var l=this.GetCS(),n=this.csFindMacro(l);if(n){if(!(n instanceof Array)){n=[n]}var m=n[0];if(!(m instanceof Function)){m=this[m]}m.apply(this,[o+l].concat(n.slice(1)))}else{if(f.mathchar0mi[l]){this.csMathchar0mi(l,f.mathchar0mi[l])}else{if(f.mathchar0mo[l]){this.csMathchar0mo(l,f.mathchar0mo[l])}else{if(f.mathchar7[l]){this.csMathchar7(l,f.mathchar7[l])}else{if(f.delimiter["\\"+l]!=null){this.csDelimiter(l,f.delimiter["\\"+l])}else{this.csUndefined(o+l)}}}}}},csFindMacro:function(l){return f.macros[l]},csMathchar0mi:function(l,n){var m={mathvariant:h.VARIANT.ITALIC};if(n instanceof Array){m=n[1];n=n[0]}this.Push(this.mmlToken(h.mi(h.entity("#x"+n)).With(m)))},csMathchar0mo:function(l,n){var m={stretchy:false};if(n instanceof Array){m=n[1];m.stretchy=false;n=n[0]}this.Push(this.mmlToken(h.mo(h.entity("#x"+n)).With(m)))},csMathchar7:function(l,n){var m={mathvariant:h.VARIANT.NORMAL};if(n instanceof Array){m=n[1];n=n[0]}if(this.stack.env.font){m.mathvariant=this.stack.env.font}this.Push(this.mmlToken(h.mi(h.entity("#x"+n)).With(m)))},csDelimiter:function(l,n){var m={};if(n instanceof Array){m=n[1];n=n[0]}if(n.length===4){n=h.entity("#x"+n)}else{n=h.chars(n)}this.Push(this.mmlToken(h.mo(n).With({fence:false,stretchy:false}).With(m)))},csUndefined:function(l){d.Error(["UndefinedControlSequence","Undefined control sequence %1",l])},Variable:function(m){var l={};if(this.stack.env.font){l.mathvariant=this.stack.env.font}this.Push(this.mmlToken(h.mi(h.chars(m)).With(l)))},Number:function(o){var l,m=this.string.slice(this.i-1).match(f.number);if(m){l=h.mn(m[0].replace(/[{}]/g,""));this.i+=m[0].length-1}else{l=h.mo(h.chars(o))}if(this.stack.env.font){l.mathvariant=this.stack.env.font}this.Push(this.mmlToken(l))},Open:function(l){this.Push(b.open())},Close:function(l){this.Push(b.close())},Tilde:function(l){this.Push(h.mtext(h.chars(g)))},Space:function(l){},Superscript:function(q){if(this.GetNext().match(/\d/)){this.string=this.string.substr(0,this.i+1)+" "+this.string.substr(this.i+1)}var p,n,o=this.stack.Top();if(o.type==="prime"){n=o.data[0];p=o.data[1];this.stack.Pop()}else{n=this.stack.Prev();if(!n){n=h.mi("")}}if(n.isEmbellishedWrapper){n=n.data[0].data[0]}var m=n.movesupsub,l=n.sup;if((n.type==="msubsup"&&n.data[n.sup])||(n.type==="munderover"&&n.data[n.over]&&!n.subsupOK)){d.Error(["DoubleExponent","Double exponent: use braces to clarify"])}if(n.type!=="msubsup"){if(m){if(n.type!=="munderover"||n.data[n.over]){if(n.movablelimits&&n.isa(h.mi)){n=this.mi2mo(n)}n=h.munderover(n,null,null).With({movesupsub:true})}l=n.over}else{n=h.msubsup(n,null,null);l=n.sup}}this.Push(b.subsup(n).With({position:l,primes:p,movesupsub:m}))},Subscript:function(q){if(this.GetNext().match(/\d/)){this.string=this.string.substr(0,this.i+1)+" "+this.string.substr(this.i+1)}var p,n,o=this.stack.Top();if(o.type==="prime"){n=o.data[0];p=o.data[1];this.stack.Pop()}else{n=this.stack.Prev();if(!n){n=h.mi("")}}if(n.isEmbellishedWrapper){n=n.data[0].data[0]}var m=n.movesupsub,l=n.sub;if((n.type==="msubsup"&&n.data[n.sub])||(n.type==="munderover"&&n.data[n.under]&&!n.subsupOK)){d.Error(["DoubleSubscripts","Double subscripts: use braces to clarify"])}if(n.type!=="msubsup"){if(m){if(n.type!=="munderover"||n.data[n.under]){if(n.movablelimits&&n.isa(h.mi)){n=this.mi2mo(n)}n=h.munderover(n,null,null).With({movesupsub:true})}l=n.under}else{n=h.msubsup(n,null,null);l=n.sub}}this.Push(b.subsup(n).With({position:l,primes:p,movesupsub:m}))},PRIME:"\u2032",SMARTQUOTE:"\u2019",Prime:function(n){var m=this.stack.Prev();if(!m){m=h.mi()}if(m.type==="msubsup"&&m.data[m.sup]){d.Error(["DoubleExponentPrime","Prime causes double exponent: use braces to clarify"])}var l="";this.i--;do{l+=this.PRIME;this.i++,n=this.GetNext()}while(n==="'"||n===this.SMARTQUOTE);l=["","\u2032","\u2033","\u2034","\u2057"][l.length]||l;this.Push(b.prime(m,this.mmlToken(h.mo(l))))},mi2mo:function(l){var m=h.mo();m.Append.apply(m,l.data);var n;for(n in m.defaults){if(m.defaults.hasOwnProperty(n)&&l[n]!=null){m[n]=l[n]}}for(n in h.copyAttributes){if(h.copyAttributes.hasOwnProperty(n)&&l[n]!=null){m[n]=l[n]}}m.lspace=m.rspace="0";m.useMMLspacing&=~(m.SPACE_ATTR.lspace|m.SPACE_ATTR.rspace);return m},Comment:function(l){while(this.id.config.MAXMACROS){d.Error(["MaxMacroSub1","MathJax maximum macro substitution count exceeded; is there a recursive macro call?"])}},Matrix:function(m,o,u,q,t,n,l,v,s){var r=this.GetNext();if(r===""){d.Error(["MissingArgFor","Missing argument for %1",m])}if(r==="{"){this.i++}else{this.string=r+"}"+this.string.slice(this.i+1);this.i=0}var p=b.array().With({requireClose:true,arraydef:{rowspacing:(n||"4pt"),columnspacing:(t||"1em")}});if(v){p.isCases=true}if(s){p.isNumbered=true;p.arraydef.side=s}if(o||u){p.open=o;p.close=u}if(l==="D"){p.arraydef.displaystyle=true}if(q!=null){p.arraydef.columnalign=q}this.Push(p)},Entry:function(o){this.Push(b.cell().With({isEntry:true,name:o}));if(this.stack.Top().isCases){var n=this.string;var r=0,p=this.i,l=n.length;while(pd.config.MAXMACROS){d.Error(["MaxMacroSub2","MathJax maximum substitution count exceeded; is there a recursive latex environment?"])}if(p[0]&&this[p[0]]){m=this[p[0]].apply(this,[m].concat(p.slice(2)))}}this.Push(m)},envFindName:function(l){return f.environment[l]},Equation:function(l,m){return m},ExtensionEnv:function(m,l){this.Extension(m.name,l,"environment")},Array:function(m,o,t,r,s,n,l,p){if(!r){r=this.GetArgument("\\begin{"+m.name+"}")}var u=("c"+r).replace(/[^clr|:]/g,"").replace(/[^|:]([|:])+/g,"$1");r=r.replace(/[^clr]/g,"").split("").join(" ");r=r.replace(/l/g,"left").replace(/r/g,"right").replace(/c/g,"center");var q=b.array().With({arraydef:{columnalign:r,columnspacing:(s||"1em"),rowspacing:(n||"4pt")}});if(u.match(/[|:]/)){if(u.charAt(0).match(/[|:]/)){q.frame.push("left");q.frame.dashed=u.charAt(0)===":"}if(u.charAt(u.length-1).match(/[|:]/)){q.frame.push("right")}u=u.substr(1,u.length-2);q.arraydef.columnlines=u.split("").join(" ").replace(/[^|: ]/g,"none").replace(/\|/g,"solid").replace(/:/g,"dashed")}if(o){q.open=this.convertDelimiter(o)}if(t){q.close=this.convertDelimiter(t)}if(l==="D"){q.arraydef.displaystyle=true}else{if(l){q.arraydef.displaystyle=false}}if(l==="S"){q.arraydef.scriptlevel=1}if(p){q.arraydef.useHeight=false}this.Push(m);return q},AlignedArray:function(l){var m=this.GetBrackets("\\begin{"+l.name+"}");return this.setArrayAlign(this.Array.apply(this,arguments),m)},setArrayAlign:function(m,l){l=this.trimSpaces(l||"");if(l==="t"){m.arraydef.align="baseline 1"}else{if(l==="b"){m.arraydef.align="baseline -1"}else{if(l==="c"){m.arraydef.align="center"}else{if(l){m.arraydef.align=l}}}}return m},convertDelimiter:function(l){if(l){l=f.delimiter[l]}if(l==null){return null}if(l instanceof Array){l=l[0]}if(l.length===4){l=String.fromCharCode(parseInt(l,16))}return l},trimSpaces:function(l){if(typeof(l)!="string"){return l}return l.replace(/^\s+|\s+$/g,"")},nextIsSpace:function(){return this.string.charAt(this.i).match(/\s/)},GetNext:function(){while(this.nextIsSpace()){this.i++}return this.string.charAt(this.i)},GetCS:function(){var l=this.string.slice(this.i).match(/^([a-z]+|.) ?/i);if(l){this.i+=l[1].length;return l[1]}else{this.i++;return" "}},GetArgument:function(m,n){switch(this.GetNext()){case"":if(!n){d.Error(["MissingArgFor","Missing argument for %1",m])}return null;case"}":if(!n){d.Error(["ExtraCloseMissingOpen","Extra close brace or missing open brace"])}return null;case"\\":this.i++;return"\\"+this.GetCS();case"{":var l=++this.i,o=1;while(this.i1){m=[h.mrow.apply(h,m)]}}return m},InternalText:function(m,l){m=m.replace(/^\s+/,g).replace(/\s+$/,g);return h.mtext(h.chars(m)).With(l)},SubstituteArgs:function(m,l){var p="";var o="";var q;var n=0;while(nm.length){d.Error(["IllegalMacroParam","Illegal macro parameter reference"])}o=this.AddArgs(this.AddArgs(o,p),m[q-1]);p=""}}else{p+=q}}}return this.AddArgs(o,p)},AddArgs:function(m,l){if(l.match(/^[a-z]/i)&&m.match(/(^|[^\\])(\\\\)*\\[a-z]+$/i)){m+=" "}if(m.length+l.length>d.config.MAXBUFFER){d.Error(["MaxBufferSize","MathJax internal buffer size exceeded; is there a recursive macro call?"])}return m+l}});d.Augment({Stack:e,Parse:a,Definitions:f,Startup:k,config:{MAXMACROS:10000,MAXBUFFER:5*1024},sourceMenuTitle:["TeXCommands","TeX Commands"],annotationEncoding:"application/x-tex",prefilterHooks:MathJax.Callback.Hooks(true),postfilterHooks:MathJax.Callback.Hooks(true),Config:function(){this.SUPER(arguments).Config.apply(this,arguments);if(this.config.equationNumbers.autoNumber!=="none"){if(!this.config.extensions){this.config.extensions=[]}this.config.extensions.push("AMSmath.js")}},Translate:function(l){var m,n=false,p=MathJax.HTML.getScript(l);var r=(l.type.replace(/\n/g," ").match(/(;|\s|\n)mode\s*=\s*display(;|\s|\n|$)/)!=null);var q={math:p,display:r,script:l};var s=this.prefilterHooks.Execute(q);if(s){return s}p=q.math;try{m=d.Parse(p).mml()}catch(o){if(!o.texError){throw o}m=this.formatError(o,p,r,l);n=true}if(m.isa(h.mtable)&&m.displaystyle==="inherit"){m.displaystyle=r}if(m.inferred){m=h.apply(MathJax.ElementJax,m.data)}else{m=h(m)}if(r){m.root.display="block"}if(n){m.texError=true}q.math=m;return this.postfilterHooks.Execute(q)||q.math},prefilterMath:function(m,n,l){return m},postfilterMath:function(m,n,l){this.combineRelations(m.root);return m},formatError:function(o,n,p,l){var m=o.message.replace(/\n.*/,"");c.signal.Post(["TeX Jax - parse error",m,n,p,l]);return h.Error(m)},Error:function(l){if(l instanceof Array){l=j.apply(j,l)}throw c.Insert(Error(l),{texError:true})},Macro:function(l,m,n){f.macros[l]=["Macro"].concat([].slice.call(arguments,1));f.macros[l].isUser=true},fenced:function(n,m,o){var l=h.mrow().With({open:n,close:o,texClass:h.TEXCLASS.INNER});l.Append(h.mo(n).With({fence:true,stretchy:true,texClass:h.TEXCLASS.OPEN}));if(m.type==="mrow"){l.Append.apply(l,m.data)}else{l.Append(m)}l.Append(h.mo(o).With({fence:true,stretchy:true,texClass:h.TEXCLASS.CLOSE}));return l},fixedFence:function(n,m,o){var l=h.mrow().With({open:n,close:o,texClass:h.TEXCLASS.ORD});if(n){l.Append(this.mathPalette(n,"l"))}if(m.type==="mrow"){l.Append.apply(l,m.data)}else{l.Append(m)}if(o){l.Append(this.mathPalette(o,"r"))}return l},mathPalette:function(o,m){if(o==="{"||o==="}"){o="\\"+o}var n="{\\bigg"+m+" "+o+"}",l="{\\big"+m+" "+o+"}";return d.Parse("\\mathchoice"+n+l+l+l,{}).mml()},combineRelations:function(p){var q,l,o,n;for(q=0,l=p.data.length;q0){o+="rl";m.push("0em 0em");p--}m=m.join(" ");if(h){return this.AMSarray(k,i,h,o,m)}var l=this.AMSarray(k,i,h,o,m);return this.setArrayAlign(l,j)},EquationBegin:function(h,i){this.checkEqnEnv();this.stack.global.forcetag=(i&&a.autoNumber!=="none");return h},EquationStar:function(h,i){this.stack.global.tagged=true;return i},checkEqnEnv:function(){if(this.stack.global.eqnenv){g.Error(["ErroneousNestingEq","Erroneous nesting of equation structures"])}this.stack.global.eqnenv=true},MultiIntegral:function(h,l){var k=this.GetNext();if(k==="\\"){var j=this.i;k=this.GetArgument(h);this.i=j;if(k==="\\limits"){if(h==="\\idotsint"){l="\\!\\!\\mathop{\\,\\,"+l+"}"}else{l="\\!\\!\\!\\mathop{\\,\\,\\,"+l+"}"}}}this.string=l+" "+this.string.slice(this.i);this.i=0},xArrow:function(j,n,m,h){var k={width:"+"+(m+h)+"mu",lspace:m+"mu"};var o=this.GetBrackets(j),p=this.ParseArg(j);var q=b.mo(b.chars(String.fromCharCode(n))).With({stretchy:true,texClass:b.TEXCLASS.REL});var i=b.munderover(q);i.SetData(i.over,b.mpadded(p).With(k).With({voffset:".15em"}));if(o){o=g.Parse(o,this.stack.env).mml();i.SetData(i.under,b.mpadded(o).With(k).With({voffset:"-.24em"}))}this.Push(i.With({subsupOK:true}))},GetDelimiterArg:function(h){var i=this.trimSpaces(this.GetArgument(h));if(i==""){return null}if(i in d.delimiter){return i}g.Error(["MissingOrUnrecognizedDelim","Missing or unrecognized delimiter for %1",h])},GetStar:function(){var h=(this.GetNext()==="*");if(h){this.i++}return h}});e.Augment({autoTag:function(){var i=this.global;if(!i.notag){f.number++;i.tagID=a.formatNumber(f.number.toString());var h=g.Parse("\\text{"+a.formatTag(i.tagID)+"}",{}).mml();i.tag=b.mtd(h).With({id:a.formatID(i.tagID)})}},getTag:function(){var l=this.global,j=l.tag;l.tagged=true;if(l.label){if(a.useLabelIds){j.id=a.formatID(l.label)}f.eqlabels[l.label]={tag:l.tagID,id:j.id}}if(document.getElementById(j.id)||f.IDs[j.id]||f.eqIDs[j.id]){var k=0,h;do{k++;h=j.id+"_"+k}while(document.getElementById(h)||f.IDs[h]||f.eqIDs[h]);j.id=h;if(l.label){f.eqlabels[l.label].id=h}}f.eqIDs[j.id]=1;this.clearTag();return j},clearTag:function(){var h=this.global;delete h.tag;delete h.tagID;delete h.label},fixInitialMO:function(k){for(var j=0,h=k.length;j element, not %1","<"+j.firstChild.nodeName+">"])}var i={math:j.firstChild,script:e};c.DOMfilterHooks.Execute(i);this.mml=this.MakeMML(i.math)},MakeMML:function(h){var i=String(h.getAttribute("class")||"");var f,g=h.nodeName.toLowerCase().replace(/^[a-z]+:/,"");var e=(i.match(/(^| )MJX-TeXAtom-([^ ]*)/));if(e){f=this.TeXAtom(e[2],e[2]==="OP"&&!i.match(/MJX-fixedlimits/))}else{if(!(a[g]&&a[g].isa&&a[g].isa(a.mbase))){MathJax.Hub.signal.Post(["MathML Jax - unknown node type",g]);return a.Error(b("UnknownNodeType","Unknown node type: %1",g))}else{f=a[g]()}}this.AddAttributes(f,h);this.CheckClass(f,f["class"]);this.AddChildren(f,h);if(c.config.useMathMLspacing){f.useMMLspacing=8}return f},TeXAtom:function(g,f){var e=a.TeXAtom().With({texClass:a.TEXCLASS[g]});if(f){e.movesupsub=e.movablelimits=true}return e},CheckClass:function(f,h){h=(h||"").split(/ /);var j=[];for(var g=0,e=h.length;g=2){var l=e.data[0],n=e.data[e.data.length-1];if(l.type==="mo"&&l.Get("fence")&&n.type==="mo"&&n.Get("fence")){if(l.data[0]){e.open=l.data.join("")}if(n.data[0]){e.close=n.data.join("")}}}},preProcessMath:function(f){if(f.match(/^<[a-z]+:/i)&&!f.match(/^<[^<>]* xmlns:/)){f=f.replace(/^<([a-z]+)(:math)/i,'<$1$2 xmlns:$1="http://www.w3.org/1998/Math/MathML"')}var e=f.match(/^(])+)>)/i);if(e&&e[2].match(/ (?!xmlns=)[a-z]+=\"http:/i)){f=e[1].replace(/ (?!xmlns=)([a-z]+=(['"])http:.*?\2)/ig," xmlns:$1 $1")+f.substr(e[0].length)}if(f.match(/^]* xmlns=/)){f=f.replace(/^<(math)/i,'\s*$/,"$2");return f.replace(/&([a-z][a-z0-9]*);/ig,this.replaceEntity)},trimSpace:function(e){return e.replace(/[\t\n\r]/g," ").replace(/^ +/,"").replace(/ +$/,"").replace(/ +/g," ")},replaceEntity:function(g,f){if(f.match(/^(lt|amp|quot)$/)){return g}if(c.Parse.Entity[f]){return c.Parse.Entity[f]}var h=f.charAt(0).toLowerCase();var e=f.match(/^[a-zA-Z](fr|scr|opf)$/);if(e){h=e[1]}if(!c.Parse.loaded[h]){c.Parse.loaded[h]=true;MathJax.Hub.RestartAfter(MathJax.Ajax.Require(c.entityDir+"/"+h+".js"))}return g}},{loaded:[]});c.Augment({sourceMenuTitle:["OriginalMathML","Original MathML"],prefilterHooks:MathJax.Callback.Hooks(true),DOMfilterHooks:MathJax.Callback.Hooks(true),postfilterHooks:MathJax.Callback.Hooks(true),Translate:function(e){if(!this.ParseXML){this.ParseXML=this.createParser()}var f,h,i={script:e};if(e.firstChild&&e.firstChild.nodeName.toLowerCase().replace(/^[a-z]+:/,"")==="math"){i.math=e.firstChild}else{h=MathJax.HTML.getScript(e);if(d.isMSIE){h=h.replace(/( )+$/,"")}i.math=h}var j=this.prefilterHooks.Execute(i);if(j){return j}h=i.math;try{f=c.Parse(h,e).mml}catch(g){if(!g.mathmlError){throw g}f=this.formatError(g,h,e)}i.math=a(f);return this.postfilterHooks.Execute(i)||i.math},prefilterMath:function(f,e){return f},prefilterMathML:function(f,e){return f},formatError:function(h,g,e){var f=h.message.replace(/\n.*/,"");MathJax.Hub.signal.Post(["MathML Jax - parse error",f,g,e]);return a.Error(f)},Error:function(e){if(e instanceof Array){e=b.apply(b,e)}throw MathJax.Hub.Insert(Error(e),{mathmlError:true})},parseDOM:function(e){return this.parser.parseFromString(e,"text/xml")},parseMS:function(e){return(this.parser.loadXML(e)?this.parser:null)},parseDIV:function(e){this.div.innerHTML="
"+e.replace(/<([a-z]+)([^>]*)\/>/g,"<$1$2>")+"
";var f=this.div.firstChild;this.div.innerHTML="";return f},parseError:function(e){return null},createMSParser:function(){var j=null;var f=["MSXML2.DOMDocument.6.0","MSXML2.DOMDocument.5.0","MSXML2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","MSXML2.DOMDocument.2.0","Microsoft.XMLDOM"];for(var g=0,e=f.length;g *":{display:"table-row!important"},".MJXp-surd":{"vertical-align":"top"},".MJXp-surd > *":{display:"block!important"},".MJXp-script-box > * ":{display:"table!important",height:"50%"},".MJXp-script-box > * > *":{display:"table-cell!important","vertical-align":"top"},".MJXp-script-box > *:last-child > *":{"vertical-align":"bottom"},".MJXp-script-box > * > * > *":{display:"block!important"},".MJXp-mphantom":{visibility:"hidden"},".MJXp-munderover":{display:"inline-table!important"},".MJXp-over":{display:"inline-block!important","text-align":"center"},".MJXp-over > *":{display:"block!important"},".MJXp-munderover > *":{display:"table-row!important"},".MJXp-mtable":{"vertical-align":".25em",margin:"0 .125em"},".MJXp-mtable > *":{display:"inline-table!important","vertical-align":"middle"},".MJXp-mtr":{display:"table-row!important"},".MJXp-mtd":{display:"table-cell!important","text-align":"center",padding:".5em 0 0 .5em"},".MJXp-mtr > .MJXp-mtd:first-child":{"padding-left":0},".MJXp-mtr:first-child > .MJXp-mtd":{"padding-top":0},".MJXp-mlabeledtr":{display:"table-row!important"},".MJXp-mlabeledtr > .MJXp-mtd:first-child":{"padding-left":0},".MJXp-mlabeledtr:first-child > .MJXp-mtd":{"padding-top":0},".MJXp-merror":{"background-color":"#FFFF88",color:"#CC0000",border:"1px solid #CC0000",padding:"1px 3px","font-style":"normal","font-size":"90%"}};(function(){for(var n=0;n<10;n++){var o="scaleX(."+n+")";m[".MJXp-scale"+n]={"-webkit-transform":o,"-moz-transform":o,"-ms-transform":o,"-o-transform":o,transform:o}}})();var k=1000000;var c="V",l="H";g.Augment({settings:b.config.menuSettings,config:{styles:m},hideProcessedMath:false,maxStretchyParts:1000,Config:function(){if(!this.require){this.require=[]}this.SUPER(arguments).Config.call(this);var n=this.settings;if(n.scale){this.config.scale=n.scale}this.require.push(MathJax.OutputJax.extensionDir+"/MathEvents.js")},Startup:function(){j=MathJax.Extension.MathEvents.Event;a=MathJax.Extension.MathEvents.Touch;d=MathJax.Extension.MathEvents.Hover;this.ContextMenu=j.ContextMenu;this.Mousedown=j.AltContextMenu;this.Mouseover=d.Mouseover;this.Mouseout=d.Mouseout;this.Mousemove=d.Mousemove;var n=e.addElement(document.body,"div",{style:{width:"5in"}});this.pxPerInch=n.offsetWidth/5;n.parentNode.removeChild(n);return i.Styles(this.config.styles,["InitializePHTML",this])},InitializePHTML:function(){},preTranslate:function(p){var s=p.jax[this.id],t,q=s.length,u,r,v,o,n;for(t=0;tthis.PHTML.h){this.PHTML.h=q.PHTML.h}if(q.PHTML.d>this.PHTML.d){this.PHTML.d=q.PHTML.d}if(q.PHTML.t>this.PHTML.t){this.PHTML.t=q.PHTML.t}if(q.PHTML.b>this.PHTML.b){this.PHTML.b=q.PHTML.b}}}else{if(n.forceChild){e.addElement(p,"span")}}},PHTMLstretchChild:function(q,p,s){var r=this.data[q];if(r&&r.PHTMLcanStretch("Vertical",p,s)){var t=this.PHTML,o=r.PHTML,n=o.w;r.PHTMLstretchV(p,s);t.w+=o.w-n;if(o.h>t.h){t.h=o.h}if(o.d>t.d){t.d=o.d}}},PHTMLcreateSpan:function(n){if(!this.PHTML){this.PHTML={}}this.PHTML={w:0,h:0,d:0,l:0,r:0,t:0,b:0};if(this.inferred){return n}if(this.type==="mo"&&this.data.join("")==="\u222B"){g.lastIsInt=true}else{if(this.type!=="mspace"||this.width!=="negativethinmathspace"){g.lastIsInt=false}}if(!this.PHTMLspanID){this.PHTMLspanID=g.GetID()}var o=(this.id||"MJXp-Span-"+this.PHTMLspanID);return e.addElement(n,"span",{className:"MJXp-"+this.type,id:o})},PHTMLspanElement:function(){if(!this.PHTMLspanID){return null}return document.getElementById(this.id||"MJXp-Span-"+this.PHTMLspanID)},PHTMLhandleToken:function(o){var n=this.getValues("mathvariant");if(n.mathvariant!==h.VARIANT.NORMAL){o.className+=" "+g.VARIANT[n.mathvariant]}},PHTMLhandleStyle:function(n){if(this.style){n.style.cssText=this.style}},PHTMLhandleColor:function(n){if(this.mathcolor){n.style.color=this.mathcolor}if(this.mathbackground){n.style.backgroundColor=this.mathbackground}},PHTMLhandleScriptlevel:function(n){var o=this.Get("scriptlevel");if(o){n.className+=" MJXp-script"}},PHTMLhandleText:function(y,A){var v,p;var z=0,o=0,q=0;for(var s=0,r=A.length;s=55296&&p<56319){s++;p=(((p-55296)<<10)+(A.charCodeAt(s)-56320))+65536}var t=0.7,u=0.22,x=0.5;if(p<127){if(v.match(/[A-Za-ehik-or-xz0-9]/)){u=0}if(v.match(/[A-HK-Z]/)){x=0.67}else{if(v.match(/[IJ]/)){x=0.36}}if(v.match(/[acegm-su-z]/)){t=0.45}else{if(v.match(/[ij]/)){t=0.75}}if(v.match(/[ijlt]/)){x=0.28}}if(g.DELIMITERS[v]){x=g.DELIMITERS[v].w||0.4}if(t>z){z=t}if(u>o){o=u}q+=x}if(!this.CHML){this.PHTML={}}this.PHTML={h:0.9,d:0.3,w:q,l:0,r:0,t:z,b:o};e.addText(y,A)},PHTMLbboxFor:function(o){if(this.data[o]&&this.data[o].PHTML){return this.data[o].PHTML}return{w:0,h:0,d:0,l:0,r:0,t:0,b:0}},PHTMLcanStretch:function(q,o,p){if(this.isEmbellished()){var n=this.Core();if(n&&n!==this){return n.PHTMLcanStretch(q,o,p)}}return false},PHTMLstretchV:function(n,o){},PHTMLstretchH:function(n){},CoreParent:function(){var n=this;while(n&&n.isEmbellished()&&n.CoreMO()===this&&!n.isa(h.math)){n=n.Parent()}return n},CoreText:function(n){if(!n){return""}if(n.isEmbellished()){return n.CoreMO().data.join("")}while((n.isa(h.mrow)||n.isa(h.TeXAtom)||n.isa(h.mstyle)||n.isa(h.mphantom))&&n.data.length===1&&n.data[0]){n=n.data[0]}if(!n.isToken){return""}else{return n.data.join("")}}});h.chars.Augment({toPreviewHTML:function(n){var o=this.toString().replace(/[\u2061-\u2064]/g,"");this.PHTMLhandleText(n,o)}});h.entity.Augment({toPreviewHTML:function(n){var o=this.toString().replace(/[\u2061-\u2064]/g,"");this.PHTMLhandleText(n,o)}});h.math.Augment({toPreviewHTML:function(n){n=this.PHTMLdefaultSpan(n);if(this.Get("display")==="block"){n.className+=" MJXp-display"}return n}});h.mo.Augment({toPreviewHTML:function(o){o=this.PHTMLdefaultSpan(o);this.PHTMLadjustAccent(o);var n=this.getValues("lspace","rspace","scriptlevel","displaystyle","largeop");if(n.scriptlevel===0){this.PHTML.l=g.length2em(n.lspace);this.PHTML.r=g.length2em(n.rspace);o.style.marginLeft=g.Em(this.PHTML.l);o.style.marginRight=g.Em(this.PHTML.r)}else{this.PHTML.l=0.15;this.PHTML.r=0.1}if(n.displaystyle&&n.largeop){var p=e.Element("span",{className:"MJXp-largeop"});p.appendChild(o.firstChild);o.appendChild(p);this.PHTML.h*=1.2;this.PHTML.d*=1.2;if(this.data.join("")==="\u222B"){p.className+=" MJXp-int"}}return o},PHTMLadjustAccent:function(p){var o=this.CoreParent();if(o&&o.isa(h.munderover)&&this.CoreText(o.data[o.base]).length===1){var q=o.data[o.over],n=o.data[o.under];var s=this.data.join(""),r;if(q&&this===q.CoreMO()&&o.Get("accent")){r=g.REMAPACCENT[s]}else{if(n&&this===n.CoreMO()&&o.Get("accentunder")){r=g.REMAPACCENTUNDER[s]}}if(r){s=p.innerHTML=r}if(s.match(/[\u02C6-\u02DC\u00A8]/)){this.PHTML.acc=-0.52}else{if(s==="\u2192"){this.PHTML.acc=-0.15;this.PHTML.vec=true}}}},PHTMLcanStretch:function(q,o,p){if(!this.Get("stretchy")){return false}var r=this.data.join("");if(r.length>1){return false}r=g.DELIMITERS[r];var n=(r&&r.dir===q.substr(0,1));if(n){n=(this.PHTML.h!==o||this.PHTML.d!==p||(this.Get("minsize",true)||this.Get("maxsize",true)))}return n},PHTMLstretchV:function(p,u){var o=this.PHTMLspanElement(),t=this.PHTML;var n=this.getValues("symmetric","maxsize","minsize");if(n.symmetric){l=2*Math.max(p-0.25,u+0.25)}else{l=p+u}n.maxsize=g.length2em(n.maxsize,t.h+t.d);n.minsize=g.length2em(n.minsize,t.h+t.d);l=Math.max(n.minsize,Math.min(n.maxsize,l));var s=l/(t.h+t.d-0.3);var q=e.Element("span",{style:{"font-size":g.Em(s)}});if(s>1.25){var r=Math.ceil(1.25/s*10);q.className="MJXp-right MJXp-scale"+r;q.style.marginLeft=g.Em(t.w*(r/10-1)+0.07);t.w*=s*r/10}q.appendChild(o.firstChild);o.appendChild(q);if(n.symmetric){o.style.verticalAlign=g.Em(0.25*(1-s))}}});h.mspace.Augment({toPreviewHTML:function(q){q=this.PHTMLdefaultSpan(q);var o=this.getValues("height","depth","width");var n=g.length2em(o.width),p=g.length2em(o.height),s=g.length2em(o.depth);var r=this.PHTML;r.w=n;r.h=p;r.d=s;if(n<0){if(!g.lastIsInt){q.style.marginLeft=g.Em(n)}n=0}q.style.width=g.Em(n);q.style.height=g.Em(p+s);if(s){q.style.verticalAlign=g.Em(-s)}return q}});h.mpadded.Augment({toPreviewHTML:function(u){u=this.PHTMLdefaultSpan(u,{childSpans:true,className:"MJXp-box",forceChild:true});var o=u.firstChild;var v=this.getValues("width","height","depth","lspace","voffset");var s=this.PHTMLdimen(v.lspace);var q=0,n=0,t=s.len,r=-s.len,p=0;if(v.width!==""){s=this.PHTMLdimen(v.width,"w",0);if(s.pm){r+=s.len}else{u.style.width=g.Em(s.len)}}if(v.height!==""){s=this.PHTMLdimen(v.height,"h",0);if(!s.pm){q+=-this.PHTMLbboxFor(0).h}q+=s.len}if(v.depth!==""){s=this.PHTMLdimen(v.depth,"d",0);if(!s.pm){n+=-this.PHTMLbboxFor(0).d;p+=-s.len}n+=s.len}if(v.voffset!==""){s=this.PHTMLdimen(v.voffset);q-=s.len;n+=s.len;p+=s.len}if(q){o.style.marginTop=g.Em(q)}if(n){o.style.marginBottom=g.Em(n)}if(t){o.style.marginLeft=g.Em(t)}if(r){o.style.marginRight=g.Em(r)}if(p){u.style.verticalAlign=g.Em(p)}return u},PHTMLdimen:function(q,r,n){if(n==null){n=-k}q=String(q);var o=q.match(/width|height|depth/);var p=(o?this.PHTML[o[0].charAt(0)]:(r?this.PHTML[r]:0));return{len:g.length2em(q,p)||0,pm:!!q.match(/^[-+]/)}}});h.munderover.Augment({toPreviewHTML:function(r){var t=this.getValues("displaystyle","accent","accentunder","align");var n=this.data[this.base];if(!t.displaystyle&&n!=null&&(n.movablelimits||n.CoreMO().Get("movablelimits"))){r=h.msubsup.prototype.toPreviewHTML.call(this,r);r.className=r.className.replace(/munderover/,"msubsup");return r}r=this.PHTMLdefaultSpan(r,{childSpans:true,className:"",noBBox:true});var p=this.PHTMLbboxFor(this.over),v=this.PHTMLbboxFor(this.under),u=this.PHTMLbboxFor(this.base),s=this.PHTML,o=p.acc;if(this.data[this.over]){r.lastChild.firstChild.style.marginLeft=p.l=r.lastChild.firstChild.style.marginRight=p.r=0;var q=e.Element("span",{},[["span",{className:"MJXp-over"}]]);q.firstChild.appendChild(r.lastChild);if(r.childNodes.length>(this.data[this.under]?1:0)){q.firstChild.appendChild(r.firstChild)}this.data[this.over].PHTMLhandleScriptlevel(q.firstChild.firstChild);if(o!=null){if(p.vec){q.firstChild.firstChild.firstChild.style.fontSize="60%";p.h*=0.6;p.d*=0.6;p.w*=0.6}o=o-p.d+0.1;if(u.t!=null){o+=u.t-u.h}q.firstChild.firstChild.style.marginBottom=g.Em(o)}if(r.firstChild){r.insertBefore(q,r.firstChild)}else{r.appendChild(q)}}if(this.data[this.under]){r.lastChild.firstChild.style.marginLeft=v.l=r.lastChild.firstChild.marginRight=v.r=0;this.data[this.under].PHTMLhandleScriptlevel(r.lastChild)}s.w=Math.max(0.8*p.w,0.8*v.w,u.w);s.h=0.8*(p.h+p.d+(o||0))+u.h;s.d=u.d+0.8*(v.h+v.d);return r}});h.msubsup.Augment({toPreviewHTML:function(q){q=this.PHTMLdefaultSpan(q,{noBBox:true});if(!this.data[this.base]){if(q.firstChild){q.insertBefore(e.Element("span"),q.firstChild)}else{q.appendChild(e.Element("span"))}}var s=this.data[this.base],p=this.data[this.sub],n=this.data[this.sup];if(!s){s={bbox:{h:0.8,d:0.2}}}q.firstChild.style.marginRight=".05em";var o=Math.max(0.4,s.PHTML.h-0.4),u=Math.max(0.2,s.PHTML.d+0.1);var t=this.PHTML;if(n&&p){var r=e.Element("span",{className:"MJXp-script-box",style:{height:g.Em(o+n.PHTML.h*0.8+u+p.PHTML.d*0.8),"vertical-align":g.Em(-u-p.PHTML.d*0.8)}},[["span",{},[["span",{},[["span",{style:{"margin-bottom":g.Em(-(n.PHTML.d-0.05))}}]]]]],["span",{},[["span",{},[["span",{style:{"margin-top":g.Em(-(n.PHTML.h-0.05))}}]]]]]]);p.PHTMLhandleScriptlevel(r.firstChild);n.PHTMLhandleScriptlevel(r.lastChild);r.firstChild.firstChild.firstChild.appendChild(q.lastChild);r.lastChild.firstChild.firstChild.appendChild(q.lastChild);q.appendChild(r);t.h=Math.max(s.PHTML.h,n.PHTML.h*0.8+o);t.d=Math.max(s.PHTML.d,p.PHTML.d*0.8+u);t.w=s.PHTML.w+Math.max(n.PHTML.w,p.PHTML.w)+0.07}else{if(n){q.lastChild.style.verticalAlign=g.Em(o);n.PHTMLhandleScriptlevel(q.lastChild);t.h=Math.max(s.PHTML.h,n.PHTML.h*0.8+o);t.d=Math.max(s.PHTML.d,n.PHTML.d*0.8-o);t.w=s.PHTML.w+n.PHTML.w+0.07}else{if(p){q.lastChild.style.verticalAlign=g.Em(-u);p.PHTMLhandleScriptlevel(q.lastChild);t.h=Math.max(s.PHTML.h,p.PHTML.h*0.8-u);t.d=Math.max(s.PHTML.d,p.PHTML.d*0.8+u);t.w=s.PHTML.w+p.PHTML.w+0.07}}}return q}});h.mfrac.Augment({toPreviewHTML:function(r){r=this.PHTMLdefaultSpan(r,{childSpans:true,className:"MJXp-box",forceChild:true,noBBox:true});var o=this.getValues("linethickness","displaystyle");if(!o.displaystyle){if(this.data[0]){this.data[0].PHTMLhandleScriptlevel(r.firstChild)}if(this.data[1]){this.data[1].PHTMLhandleScriptlevel(r.lastChild)}}var n=e.Element("span",{className:"MJXp-box"},[["span",{className:"MJXp-denom"},[["span",{},[["span",{className:"MJXp-rule",style:{height:"1em"}}]]],["span"]]]]);n.firstChild.lastChild.appendChild(r.lastChild);r.appendChild(n);var s=this.PHTMLbboxFor(0),p=this.PHTMLbboxFor(1),v=this.PHTML;v.w=Math.max(s.w,p.w)*0.8;v.h=s.h+s.d+0.1+0.25;v.d=p.h+p.d-0.25;v.l=v.r=0.125;o.linethickness=Math.max(0,g.length2em(o.linethickness||"0",0));if(o.linethickness){var u=n.firstChild.firstChild.firstChild;var q=g.Em(o.linethickness);u.style.borderTop="none";u.style.borderBottom=(o.linethickness<0.15?"1px":q)+" solid";u.style.margin=q+" 0";q=o.linethickness;n.style.marginTop=g.Em(3*q-1.2);r.style.verticalAlign=g.Em(1.5*q+0.1);v.h+=1.5*q-0.1;v.d+=1.5*q}else{n.style.marginTop="-.7em"}return r}});h.msqrt.Augment({toPreviewHTML:function(n){n=this.PHTMLdefaultSpan(n,{childSpans:true,className:"MJXp-box",forceChild:true,noBBox:true});this.PHTMLlayoutRoot(n,n.firstChild);return n},PHTMLlayoutRoot:function(u,n){var v=this.PHTMLbboxFor(0);var q=Math.ceil((v.h+v.d+0.14)*100),w=g.Em(14/q);var r=e.Element("span",{className:"MJXp-surd"},[["span",{style:{"font-size":q+"%","margin-top":w}},["\u221A"]]]);var s=e.Element("span",{className:"MJXp-root"},[["span",{className:"MJXp-rule",style:{"border-top":".08em solid"}}]]);var p=(1.2/2.2)*q/100;if(q>150){var o=Math.ceil(150/q*10);r.firstChild.className="MJXp-right MJXp-scale"+o;r.firstChild.style.marginLeft=g.Em(p*(o/10-1)/q*100);p=p*o/10;s.firstChild.style.borderTopWidth=g.Em(0.08/Math.sqrt(o/10))}s.appendChild(n);u.appendChild(r);u.appendChild(s);this.PHTML.h=v.h+0.18;this.PHTML.d=v.d;this.PHTML.w=v.w+p;return u}});h.mroot.Augment({toPreviewHTML:function(q){q=this.PHTMLdefaultSpan(q,{childSpans:true,className:"MJXp-box",forceChild:true,noBBox:true});var p=this.PHTMLbboxFor(1),n=q.removeChild(q.lastChild);var t=this.PHTMLlayoutRoot(e.Element("span"),q.firstChild);n.className="MJXp-script";var u=parseInt(t.firstChild.firstChild.style.fontSize);var o=0.55*(u/120)+p.d*0.8,s=-0.6*(u/120);if(u>150){s*=0.95*Math.ceil(150/u*10)/10}n.style.marginRight=g.Em(s);n.style.verticalAlign=g.Em(o);if(-s>p.w*0.8){n.style.marginLeft=g.Em(-s-p.w*0.8)}q.appendChild(n);q.appendChild(t);this.PHTML.w+=Math.max(0,p.w*0.8+s);this.PHTML.h=Math.max(this.PHTML.h,p.h*0.8+o);return q},PHTMLlayoutRoot:h.msqrt.prototype.PHTMLlayoutRoot});h.mfenced.Augment({toPreviewHTML:function(q){q=this.PHTMLcreateSpan(q);this.PHTMLhandleStyle(q);this.PHTMLhandleColor(q);this.addFakeNodes();this.PHTMLaddChild(q,"open",{});for(var p=0,n=this.data.length;ps){s=x.w}}}var o=this.PHTML;o.w=s;o.h=y/2+0.25;o.d=y/2-0.25;o.l=o.r=0.125;return E}});h.mlabeledtr.Augment({PHTMLdefaultSpan:function(q,o){if(!o){o={}}q=this.PHTMLcreateSpan(q);this.PHTMLhandleStyle(q);this.PHTMLhandleColor(q);if(this.isToken){this.PHTMLhandleToken(q)}for(var p=1,n=this.data.length;p/g,"")}catch(k){if(!k.restart){throw k}return MathJax.Callback.After(["HandleMML",this,l],k.restart)}n.setAttribute("data-mathml",i);j=f.addElement(n,"span",{isMathJax:true,unselectable:"on",className:"MJX_Assistive_MathML"+(h.root.Get("display")==="block"?" MJX_Assistive_MathML_Block":"")});j.innerHTML=i;n.style.position="relative";n.setAttribute("role","presentation");n.firstChild.setAttribute("aria-hidden","true");j.setAttribute("role","presentation")}l.i++}l.callback()}};b.Startup.signal.Post("AssistiveMML Ready")})(MathJax.Ajax,MathJax.Callback,MathJax.Hub,MathJax.HTML);MathJax.Callback.Queue(["Require",MathJax.Ajax,"[MathJax]/extensions/toMathML.js"],["loadComplete",MathJax.Ajax,"[MathJax]/extensions/AssistiveMML.js"],function(){MathJax.Hub.Register.StartupHook("End Config",["Config",MathJax.Extension.AssistiveMML])}); +MathJax.Ajax.loadComplete("[MathJax]/config/TeX-AMS-MML_HTMLorMML.js"); diff --git a/modules/MathJax/extensions/MathMenu.js b/modules/MathJax/extensions/MathMenu.js new file mode 100644 index 0000000..9c4fcc7 --- /dev/null +++ b/modules/MathJax/extensions/MathMenu.js @@ -0,0 +1,1802 @@ +/* + * /MathJax/extensions/MathMenu.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(f, n, p, e, q) { + var o = "2.6.1"; + var d = MathJax.Callback.Signal("menu"); + MathJax.Extension.MathMenu = { + version: o, + signal: d + }; + var s = function(t) { + return MathJax.Localization._.apply(MathJax.Localization, [ + ["MathMenu", t] + ].concat([].slice.call(arguments, 1))) + }; + var a = f.Browser.isPC, + k = f.Browser.isMSIE, + l = ((document.documentMode || 0) > 8); + var i = (a ? null : "5px"); + var r = f.CombineConfig("MathMenu", { + delay: 150, + showRenderer: true, + showMathPlayer: true, + showFontMenu: false, + showContext: false, + showDiscoverable: false, + showLocale: true, + showLocaleURL: false, + semanticsAnnotations: { + TeX: ["TeX", "LaTeX", "application/x-tex"], + StarMath: ["StarMath 5.0"], + Maple: ["Maple"], + ContentMathML: ["MathML-Content", "application/mathml-content+xml"], + OpenMath: ["OpenMath"] + }, + windowSettings: { + status: "no", + toolbar: "no", + locationbar: "no", + menubar: "no", + directories: "no", + personalbar: "no", + resizable: "yes", + scrollbars: "yes", + width: 400, + height: 300, + left: Math.round((screen.width - 400) / 2), + top: Math.round((screen.height - 300) / 3) + }, + styles: { + "#MathJax_About": { + position: "fixed", + left: "50%", + width: "auto", + "text-align": "center", + border: "3px outset", + padding: "1em 2em", + "background-color": "#DDDDDD", + color: "black", + cursor: "default", + "font-family": "message-box", + "font-size": "120%", + "font-style": "normal", + "text-indent": 0, + "text-transform": "none", + "line-height": "normal", + "letter-spacing": "normal", + "word-spacing": "normal", + "word-wrap": "normal", + "white-space": "nowrap", + "float": "none", + "z-index": 201, + "border-radius": "15px", + "-webkit-border-radius": "15px", + "-moz-border-radius": "15px", + "-khtml-border-radius": "15px", + "box-shadow": "0px 10px 20px #808080", + "-webkit-box-shadow": "0px 10px 20px #808080", + "-moz-box-shadow": "0px 10px 20px #808080", + "-khtml-box-shadow": "0px 10px 20px #808080", + filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')" + }, + "#MathJax_About.MathJax_MousePost": { + outline: "none" + }, + ".MathJax_Menu": { + position: "absolute", + "background-color": "white", + color: "black", + width: "auto", + padding: (a ? "2px" : "5px 0px"), + border: "1px solid #CCCCCC", + margin: 0, + cursor: "default", + font: "menu", + "text-align": "left", + "text-indent": 0, + "text-transform": "none", + "line-height": "normal", + "letter-spacing": "normal", + "word-spacing": "normal", + "word-wrap": "normal", + "white-space": "nowrap", + "float": "none", + "z-index": 201, + "border-radius": i, + "-webkit-border-radius": i, + "-moz-border-radius": i, + "-khtml-border-radius": i, + "box-shadow": "0px 10px 20px #808080", + "-webkit-box-shadow": "0px 10px 20px #808080", + "-moz-box-shadow": "0px 10px 20px #808080", + "-khtml-box-shadow": "0px 10px 20px #808080", + filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')" + }, + ".MathJax_MenuItem": { + padding: (a ? "2px 2em" : "1px 2em"), + background: "transparent" + }, + ".MathJax_MenuArrow": { + position: "absolute", + right: ".5em", + "padding-top": ".25em", + color: "#666666", + "font-family": (k ? "'Arial unicode MS'" : null), + "font-size": ".75em" + }, + ".MathJax_MenuActive .MathJax_MenuArrow": { + color: "white" + }, + ".MathJax_MenuArrow.RTL": { + left: ".5em", + right: "auto" + }, + ".MathJax_MenuCheck": { + position: "absolute", + left: ".7em", + "font-family": (k ? "'Arial unicode MS'" : null) + }, + ".MathJax_MenuCheck.RTL": { + right: ".7em", + left: "auto" + }, + ".MathJax_MenuRadioCheck": { + position: "absolute", + left: (a ? "1em" : ".7em") + }, + ".MathJax_MenuRadioCheck.RTL": { + right: (a ? "1em" : ".7em"), + left: "auto" + }, + ".MathJax_MenuLabel": { + padding: (a ? "2px 2em 4px 1.33em" : "1px 2em 3px 1.33em"), + "font-style": "italic" + }, + ".MathJax_MenuRule": { + "border-top": (a ? "1px solid #CCCCCC" : "1px solid #DDDDDD"), + margin: (a ? "4px 1px 0px" : "4px 3px") + }, + ".MathJax_MenuDisabled": { + color: "GrayText" + }, + ".MathJax_MenuActive": { + "background-color": (a ? "Highlight" : "#606872"), + color: (a ? "HighlightText" : "white") + }, + ".MathJax_MenuDisabled:focus, .MathJax_MenuLabel:focus": { + "background-color": "#E8E8E8" + }, + ".MathJax_ContextMenu:focus": { + outline: "none" + }, + ".MathJax_ContextMenu .MathJax_MenuItem:focus": { + outline: "none" + }, + "#MathJax_AboutClose": { + top: ".2em", + right: ".2em" + }, + ".MathJax_Menu .MathJax_MenuClose": { + top: "-10px", + left: "-10px" + }, + ".MathJax_MenuClose": { + position: "absolute", + cursor: "pointer", + display: "inline-block", + border: "2px solid #AAA", + "border-radius": "18px", + "-webkit-border-radius": "18px", + "-moz-border-radius": "18px", + "-khtml-border-radius": "18px", + "font-family": "'Courier New',Courier", + "font-size": "24px", + color: "#F0F0F0" + }, + ".MathJax_MenuClose span": { + display: "block", + "background-color": "#AAA", + border: "1.5px solid", + "border-radius": "18px", + "-webkit-border-radius": "18px", + "-moz-border-radius": "18px", + "-khtml-border-radius": "18px", + "line-height": 0, + padding: "8px 0 6px" + }, + ".MathJax_MenuClose:hover": { + color: "white!important", + border: "2px solid #CCC!important" + }, + ".MathJax_MenuClose:hover span": { + "background-color": "#CCC!important" + }, + ".MathJax_MenuClose:hover:focus": { + outline: "none" + } + } + }); + var m, j, b; + f.Register.StartupHook("MathEvents Ready", function() { + m = MathJax.Extension.MathEvents.Event.False; + j = MathJax.Extension.MathEvents.Hover; + b = MathJax.Extension.MathEvents.Event.KEY + }); + var h = MathJax.Object.Subclass({ + Keydown: function(t, u) { + switch (t.keyCode) { + case b.ESCAPE: + this.Remove(t, u); + break; + case b.RIGHT: + this.Right(t, u); + break; + case b.LEFT: + this.Left(t, u); + break; + case b.UP: + this.Up(t, u); + break; + case b.DOWN: + this.Down(t, u); + break; + case b.RETURN: + case b.SPACE: + this.Space(t, u); + break; + default: + return; + break + } + return m(t) + }, + Escape: function(t, u) {}, + Right: function(t, u) {}, + Left: function(t, u) {}, + Up: function(t, u) {}, + Down: function(t, u) {}, + Space: function(t, u) {} + }, {}); + var g = MathJax.Menu = h.Subclass({ + version: o, + items: [], + posted: false, + title: null, + margin: 5, + Init: function(t) { + this.items = [].slice.call(arguments, 0) + }, + With: function(t) { + if (t) { + f.Insert(this, t) + } + return this + }, + Post: function(u, I, G) { + if (!u) { + u = window.event || {} + } + var t = document.getElementById("MathJax_MenuFrame"); + if (!t) { + t = g.Background(this); + delete c.lastItem; + delete c.lastMenu; + delete g.skipUp; + d.Post(["post", g.jax]); + g.isRTL = (MathJax.Localization.fontDirection() === "rtl") + } + var v = n.Element("div", { + onmouseup: g.Mouseup, + ondblclick: m, + ondragstart: m, + onselectstart: m, + oncontextmenu: m, + menuItem: this, + className: "MathJax_Menu", + onkeydown: g.Keydown, + role: "menu" + }); + if (u.type === "contextmenu" || u.type === "mouseover") { + v.className += " MathJax_ContextMenu" + } + if (!G) { + MathJax.Localization.setCSS(v) + } + for (var B = 0, z = this.items.length; B < z; B++) { + this.items[B].Create(v) + } + if (g.isMobile) { + n.addElement(v, "span", { + className: "MathJax_MenuClose", + menu: I, + ontouchstart: g.Close, + ontouchend: m, + onmousedown: g.Close, + onmouseup: m + }, [ + ["span", {}, "\u00D7"] + ]) + } + t.appendChild(v); + this.posted = true; + if (v.offsetWidth) { + v.style.width = (v.offsetWidth + 2) + "px" + } + var H = u.pageX, + F = u.pageY; + if (!H && !F && "clientX" in u) { + H = u.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; + F = u.clientY + document.body.scrollTop + document.documentElement.scrollTop + } + if (!I) { + var w = g.CurrentNode() || u.target; + if ((u.type === "keydown" || (!H && !F)) && w) { + var C = window.pageXOffset || document.documentElement.scrollLeft; + var A = window.pageYOffset || document.documentElement.scrollTop; + var E = w.getBoundingClientRect(); + H = (E.right + E.left) / 2 + C; + F = (E.bottom + E.top) / 2 + A + } + if (H + v.offsetWidth > document.body.offsetWidth - this.margin) { + H = document.body.offsetWidth - v.offsetWidth - this.margin + } + if (g.isMobile) { + H = Math.max(5, H - Math.floor(v.offsetWidth / 2)); + F -= 20 + } + g.skipUp = u.isContextMenu + } else { + var D = "left", + L = I.offsetWidth; + H = (g.isMobile ? 30 : L - 2); + F = 0; + while (I && I !== t) { + H += I.offsetLeft; + F += I.offsetTop; + I = I.parentNode + } + if (!g.isMobile) { + if ((g.isRTL && H - L - v.offsetWidth > this.margin) || (!g.isRTL && H + v.offsetWidth > document.body.offsetWidth - this.margin)) { + D = "right"; + H = Math.max(this.margin, H - L - v.offsetWidth + 6) + } + } + if (!a) { + v.style["borderRadiusTop" + D] = 0; + v.style["WebkitBorderRadiusTop" + D] = 0; + v.style["MozBorderRadiusTop" + D] = 0; + v.style["KhtmlBorderRadiusTop" + D] = 0 + } + } + v.style.left = H + "px"; + v.style.top = F + "px"; + if (document.selection && document.selection.empty) { + document.selection.empty() + } + var K = window.pageXOffset || document.documentElement.scrollLeft; + var J = window.pageYOffset || document.documentElement.scrollTop; + g.Focus(v); + if (u.type === "keydown") { + g.skipMouseoverFromKey = true; + setTimeout(function() { + delete g.skipMouseoverFromKey + }, r.delay) + } + window.scrollTo(K, J); + return m(u) + }, + Remove: function(t, u) { + d.Post(["unpost", g.jax]); + var v = document.getElementById("MathJax_MenuFrame"); + if (v) { + v.parentNode.removeChild(v); + if (this.msieFixedPositionBug) { + detachEvent("onresize", g.Resize) + } + } + if (g.jax.hover) { + delete g.jax.hover.nofade; + j.UnHover(g.jax) + } + g.Unfocus(u); + if (t.type === "mousedown") { + g.CurrentNode().blur() + } + return m(t) + }, + Find: function(t) { + return this.FindN(1, t, [].slice.call(arguments, 1)) + }, + FindId: function(t) { + return this.FindN(0, t, [].slice.call(arguments, 1)) + }, + FindN: function(x, u, w) { + for (var v = 0, t = this.items.length; v < t; v++) { + if (this.items[v].name[x] === u) { + if (w.length) { + if (!this.items[v].submenu) { + return null + } + return this.items[v].submenu.FindN(x, w[0], w.slice(1)) + } + return this.items[v] + } + } + return null + }, + IndexOf: function(t) { + return this.IndexOfN(1, t) + }, + IndexOfId: function(t) { + return this.IndexOfN(0, t) + }, + IndexOfN: function(w, u) { + for (var v = 0, t = this.items.length; v < t; v++) { + if (this.items[v].name[w] === u) { + return v + } + } + return null + }, + Right: function(t, u) { + g.Right(t, u) + }, + Left: function(t, u) { + g.Left(t, u) + }, + Up: function(u, v) { + var t = v.lastChild; + t.menuItem.Activate(u, t) + }, + Down: function(u, v) { + var t = v.firstChild; + t.menuItem.Activate(u, t) + }, + Space: function(t, u) { + this.Remove(t, u) + } + }, { + config: r, + Remove: function(t) { + return g.Event(t, this, "Remove") + }, + Mouseover: function(t) { + return g.Event(t, this, "Mouseover") + }, + Mouseout: function(t) { + return g.Event(t, this, "Mouseout") + }, + Mousedown: function(t) { + return g.Event(t, this, "Mousedown") + }, + Mouseup: function(t) { + return g.Event(t, this, "Mouseup") + }, + Keydown: function(t) { + return g.Event(t, this, "Keydown") + }, + Touchstart: function(t) { + return g.Event(t, this, "Touchstart") + }, + Touchend: function(t) { + return g.Event(t, this, "Touchend") + }, + Close: function(t) { + return g.Event(t, this.menu || this.parentNode, (this.menu ? "Touchend" : "Remove")) + }, + Event: function(v, x, t, w) { + if (g.skipMouseover && t === "Mouseover" && !w) { + return m(v) + } + if (g.skipMouseoverFromKey && t === "Mouseover") { + delete g.skipMouseoverFromKey; + return m(v) + } + if (g.skipUp) { + if (t.match(/Mouseup|Touchend/)) { + delete g.skipUp; + return m(v) + } + if (t === "Touchstart" || (t === "Mousedown" && !g.skipMousedown)) { + delete g.skipUp + } + } + if (!v) { + v = window.event + } + var u = x.menuItem; + if (u && u[t]) { + return u[t](v, x) + } + return null + }, + BGSTYLE: { + position: "absolute", + left: 0, + top: 0, + "z-index": 200, + width: "100%", + height: "100%", + border: 0, + padding: 0, + margin: 0 + }, + Background: function(u) { + var v = n.addElement(document.body, "div", { + style: this.BGSTYLE, + id: "MathJax_MenuFrame" + }, [ + ["div", { + style: this.BGSTYLE, + menuItem: u, + onmousedown: this.Remove + }] + ]); + var t = v.firstChild; + if (g.msieBackgroundBug) { + t.style.backgroundColor = "white"; + t.style.filter = "alpha(opacity=0)" + } + if (g.msieFixedPositionBug) { + v.width = v.height = 0; + this.Resize(); + attachEvent("onresize", this.Resize) + } else { + t.style.position = "fixed" + } + return v + }, + Resize: function() { + setTimeout(g.SetWH, 0) + }, + SetWH: function() { + var t = document.getElementById("MathJax_MenuFrame"); + if (t) { + t = t.firstChild; + t.style.width = t.style.height = "1px"; + t.style.width = document.body.scrollWidth + "px"; + t.style.height = document.body.scrollHeight + "px" + } + }, + posted: false, + active: null, + GetNode: function(t) { + var u = document.getElementById(t.inputID + "-Frame"); + return u.isMathJax ? u : u.firstChild + }, + CurrentNode: function() { + return g.GetNode(g.jax) + }, + AllNodes: function() { + var u = MathJax.Hub.getAllJax(); + var v = []; + for (var w = 0, t; t = u[w]; w++) { + v.push(g.GetNode(t)) + } + return v + }, + ActiveNode: function() { + return g.active + }, + FocusNode: function(t) { + g.active = t; + t.focus() + }, + Focus: function(t) { + !g.posted ? g.Activate(t) : g.ActiveNode().tabIndex = -1; + t.tabIndex = 0; + g.FocusNode(t) + }, + Activate: function(t, u) { + g.UnsetTabIndex(); + g.posted = true + }, + Unfocus: function() { + g.ActiveNode().tabIndex = -1; + g.SetTabIndex(); + g.FocusNode(g.CurrentNode()); + g.posted = false + }, + MoveHorizontal: function(x, y, v) { + if (!x.shiftKey) { + return + } + var u = g.AllNodes(); + var t = u.length; + if (t === 0) { + return + } + var w = u[g.Mod(v(g.IndexOf(u, g.CurrentNode())), t)]; + if (w === g.CurrentNode()) { + return + } + g.menu.Remove(x, y); + g.jax = MathJax.Hub.getJaxFor(w); + g.FocusNode(w); + g.menu.Post(null) + }, + Right: function(t, u) { + g.MoveHorizontal(t, u, function(v) { + return v + 1 + }) + }, + Left: function(t, u) { + g.MoveHorizontal(t, u, function(v) { + return v - 1 + }) + }, + UnsetTabIndex: function() { + var u = g.AllNodes(); + for (var v = 0, t; t = u[v]; v++) { + if (t.tabIndex > 0) { + t.oldTabIndex = t.tabIndex + } + t.tabIndex = -1 + } + }, + SetTabIndex: function() { + var u = g.AllNodes(); + for (var v = 0, t; t = u[v]; v++) { + if (t.oldTabIndex !== undefined) { + t.tabIndex = t.oldTabIndex; + delete t.oldTabIndex + } else { + t.tabIndex = f.getTabOrder(t) + } + } + }, + Mod: function(t, u) { + return ((t % u) + u) % u + }, + IndexOf: (Array.prototype.indexOf ? function(t, u, v) { + return t.indexOf(u, v) + } : function(t, w, x) { + for (var v = (x || 0), u = t.length; v < u; v++) { + if (w === t[v]) { + return v + } + } + return -1 + }), + saveCookie: function() { + n.Cookie.Set("menu", this.cookie) + }, + getCookie: function() { + this.cookie = n.Cookie.Get("menu") + } + }); + MathJax.Menu.NAV = h; + var c = g.ITEM = h.Subclass({ + name: "", + node: null, + menu: null, + Attributes: function(t) { + return f.Insert({ + onmouseup: g.Mouseup, + ondragstart: m, + onselectstart: m, + onselectend: m, + ontouchstart: g.Touchstart, + ontouchend: g.Touchend, + className: "MathJax_MenuItem", + role: this.role, + menuItem: this + }, t) + }, + Create: function(v) { + if (!this.hidden) { + var u = this.Attributes(); + var t = this.Label(u, v); + n.addElement(v, "div", u, t) + } + }, + Name: function() { + return s(this.name[0], this.name[1]) + }, + Mouseover: function(t, u) { + if (u.parentNode === g.ActiveNode().parentNode) { + this.Deactivate(g.ActiveNode()) + } + this.Activate(t, u) + }, + Mouseout: function(t, u) { + this.Deactivate(u) + }, + Mouseup: function(t, u) { + return this.Remove(t, u) + }, + DeactivateSubmenus: function(y) { + var x = document.getElementById("MathJax_MenuFrame").childNodes, + u = c.GetMenuNode(y).childNodes; + for (var v = 0, t = u.length; v < t; v++) { + var w = u[v].menuItem; + if (w && w.submenu && w.submenu.posted && w !== y.menuItem) { + w.Deactivate(u[v]) + } + } + this.RemoveSubmenus(y, x) + }, + RemoveSubmenus: function(v, u) { + u = u || document.getElementById("MathJax_MenuFrame").childNodes; + var t = u.length - 1; + while (t >= 0 && c.GetMenuNode(v).menuItem !== u[t].menuItem) { + u[t].menuItem.posted = false; + u[t].parentNode.removeChild(u[t]); + t-- + } + }, + Touchstart: function(t, u) { + return this.TouchEvent(t, u, "Mousedown") + }, + Touchend: function(t, u) { + return this.TouchEvent(t, u, "Mouseup") + }, + TouchEvent: function(u, v, t) { + if (this !== c.lastItem) { + if (c.lastMenu) { + g.Event(u, c.lastMenu, "Mouseout") + } + g.Event(u, v, "Mouseover", true); + c.lastItem = this; + c.lastMenu = v + } + if (this.nativeTouch) { + return null + } + g.Event(u, v, t); + return false + }, + Remove: function(t, u) { + u = u.parentNode.menuItem; + return u.Remove(t, u) + }, + With: function(t) { + if (t) { + f.Insert(this, t) + } + return this + }, + isRTL: function() { + return g.isRTL + }, + rtlClass: function() { + return (this.isRTL() ? " RTL" : "") + } + }, { + GetMenuNode: function(t) { + return t.parentNode + } + }); + g.ENTRY = g.ITEM.Subclass({ + role: "menuitem", + Attributes: function(t) { + t = f.Insert({ + onmouseover: g.Mouseover, + onmouseout: g.Mouseout, + onmousedown: g.Mousedown, + onkeydown: g.Keydown, + "aria-disabled": !!this.disabled + }, t); + t = this.SUPER(arguments).Attributes.call(this, t); + if (this.disabled) { + t.className += " MathJax_MenuDisabled" + } + return t + }, + MoveVertical: function(t, D, v) { + var w = c.GetMenuNode(D); + var C = []; + for (var y = 0, B = w.menuItem.items, x; x = B[y]; y++) { + if (!x.hidden) { + C.push(x) + } + } + var A = g.IndexOf(C, this); + if (A === -1) { + return + } + var z = C.length; + var u = w.childNodes; + do { + A = g.Mod(v(A), z) + } while (C[A].hidden || !u[A].role || u[A].role === "separator"); + this.Deactivate(D); + C[A].Activate(t, u[A]) + }, + Up: function(u, t) { + this.MoveVertical(u, t, function(v) { + return v - 1 + }) + }, + Down: function(u, t) { + this.MoveVertical(u, t, function(v) { + return v + 1 + }) + }, + Right: function(u, t) { + this.MoveHorizontal(u, t, g.Right, !this.isRTL()) + }, + Left: function(u, t) { + this.MoveHorizontal(u, t, g.Left, this.isRTL()) + }, + MoveHorizontal: function(z, y, t, A) { + var w = c.GetMenuNode(y); + if (w.menuItem === g.menu && z.shiftKey) { + t(z, y) + } + if (A) { + return + } + if (w.menuItem !== g.menu) { + this.Deactivate(y) + } + var u = w.previousSibling.childNodes; + var x = u.length; + while (x--) { + var v = u[x]; + if (v.menuItem.submenu && v.menuItem.submenu === w.menuItem) { + g.Focus(v); + break + } + } + this.RemoveSubmenus(y) + }, + Space: function(t, u) { + this.Mouseup(t, u) + }, + Activate: function(t, u) { + this.Deactivate(u); + if (!this.disabled) { + u.className += " MathJax_MenuActive" + } + this.DeactivateSubmenus(u); + g.Focus(u) + }, + Deactivate: function(t) { + t.className = t.className.replace(/ MathJax_MenuActive/, "") + } + }); + g.ITEM.COMMAND = g.ENTRY.Subclass({ + action: function() {}, + Init: function(t, v, u) { + if (!(t instanceof Array)) { + t = [t, t] + } + this.name = t; + this.action = v; + this.With(u) + }, + Label: function(t, u) { + return [this.Name()] + }, + Mouseup: function(t, u) { + if (!this.disabled) { + this.Remove(t, u); + d.Post(["command", this]); + this.action.call(this, t) + } + return m(t) + } + }); + g.ITEM.SUBMENU = g.ENTRY.Subclass({ + submenu: null, + marker: "\u25BA", + markerRTL: "\u25C4", + Attributes: function(t) { + t = f.Insert({ + "aria-haspopup": "true" + }, t); + t = this.SUPER(arguments).Attributes.call(this, t); + return t + }, + Init: function(t, v) { + if (!(t instanceof Array)) { + t = [t, t] + } + this.name = t; + var u = 1; + if (!(v instanceof g.ITEM)) { + this.With(v), u++ + } + this.submenu = g.apply(g, [].slice.call(arguments, u)) + }, + Label: function(t, u) { + this.submenu.posted = false; + return [this.Name() + " ", ["span", { + className: "MathJax_MenuArrow" + this.rtlClass() + }, + [this.isRTL() ? this.markerRTL : this.marker] + ]] + }, + Timer: function(t, u) { + this.ClearTimer(); + t = { + type: t.type, + clientX: t.clientX, + clientY: t.clientY + }; + this.timer = setTimeout(e(["Mouseup", this, t, u]), r.delay) + }, + ClearTimer: function() { + if (this.timer) { + clearTimeout(this.timer) + } + }, + Touchend: function(u, w) { + var v = this.submenu.posted; + var t = this.SUPER(arguments).Touchend.apply(this, arguments); + if (v) { + this.Deactivate(w); + delete c.lastItem; + delete c.lastMenu + } + return t + }, + Mouseout: function(t, u) { + if (!this.submenu.posted) { + this.Deactivate(u) + } + this.ClearTimer() + }, + Mouseover: function(t, u) { + this.Activate(t, u) + }, + Mouseup: function(t, u) { + if (!this.disabled) { + if (!this.submenu.posted) { + this.ClearTimer(); + this.submenu.Post(t, u, this.ltr); + g.Focus(u) + } else { + this.DeactivateSubmenus(u) + } + } + return m(t) + }, + Activate: function(t, u) { + if (!this.disabled) { + this.Deactivate(u); + u.className += " MathJax_MenuActive" + } + if (!this.submenu.posted) { + this.DeactivateSubmenus(u); + if (!g.isMobile) { + this.Timer(t, u) + } + } + g.Focus(u) + }, + MoveVertical: function(v, u, t) { + this.ClearTimer(); + this.SUPER(arguments).MoveVertical.apply(this, arguments) + }, + MoveHorizontal: function(v, x, u, w) { + if (!w) { + this.SUPER(arguments).MoveHorizontal.apply(this, arguments); + return + } + if (this.disabled) { + return + } + if (!this.submenu.posted) { + this.Activate(v, x); + return + } + var t = c.GetMenuNode(x).nextSibling.childNodes; + if (t.length > 0) { + this.submenu.items[0].Activate(v, t[0]) + } + } + }); + g.ITEM.RADIO = g.ENTRY.Subclass({ + variable: null, + marker: (a ? "\u25CF" : "\u2713"), + role: "menuitemradio", + Attributes: function(u) { + var t = r.settings[this.variable] === this.value ? "true" : "false"; + u = f.Insert({ + "aria-checked": t + }, u); + u = this.SUPER(arguments).Attributes.call(this, u); + return u + }, + Init: function(u, t, v) { + if (!(u instanceof Array)) { + u = [u, u] + } + this.name = u; + this.variable = t; + this.With(v); + if (this.value == null) { + this.value = this.name[0] + } + }, + Label: function(u, v) { + var t = { + className: "MathJax_MenuRadioCheck" + this.rtlClass() + }; + if (r.settings[this.variable] !== this.value) { + t = { + style: { + display: "none" + } + } + } + return [ + ["span", t, [this.marker]], " " + this.Name() + ] + }, + Mouseup: function(w, x) { + if (!this.disabled) { + var y = x.parentNode.childNodes; + for (var u = 0, t = y.length; u < t; u++) { + var v = y[u].menuItem; + if (v && v.variable === this.variable) { + y[u].firstChild.style.display = "none" + } + } + x.firstChild.display = ""; + r.settings[this.variable] = this.value; + g.cookie[this.variable] = r.settings[this.variable]; + g.saveCookie(); + d.Post(["radio button", this]) + } + this.Remove(w, x); + if (this.action && !this.disabled) { + this.action.call(g, this) + } + return m(w) + } + }); + g.ITEM.CHECKBOX = g.ENTRY.Subclass({ + variable: null, + marker: "\u2713", + role: "menuitemcheckbox", + Attributes: function(u) { + var t = r.settings[this.variable] ? "true" : "false"; + u = f.Insert({ + "aria-checked": t + }, u); + u = this.SUPER(arguments).Attributes.call(this, u); + return u + }, + Init: function(u, t, v) { + if (!(u instanceof Array)) { + u = [u, u] + } + this.name = u; + this.variable = t; + this.With(v) + }, + Label: function(u, v) { + var t = { + className: "MathJax_MenuCheck" + this.rtlClass() + }; + if (!r.settings[this.variable]) { + t = { + style: { + display: "none" + } + } + } + return [ + ["span", t, [this.marker]], " " + this.Name() + ] + }, + Mouseup: function(t, u) { + if (!this.disabled) { + u.firstChild.display = (r.settings[this.variable] ? "none" : ""); + r.settings[this.variable] = !r.settings[this.variable]; + g.cookie[this.variable] = r.settings[this.variable]; + g.saveCookie(); + d.Post(["checkbox", this]) + } + this.Remove(t, u); + if (this.action && !this.disabled) { + this.action.call(g, this) + } + return m(t) + } + }); + g.ITEM.LABEL = g.ENTRY.Subclass({ + role: "menuitem", + Init: function(t, u) { + if (!(t instanceof Array)) { + t = [t, t] + } + this.name = t; + this.With(u) + }, + Label: function(t, u) { + t.className += " MathJax_MenuLabel"; + return [this.Name()] + }, + Activate: function(t, u) { + this.Deactivate(u); + g.Focus(u) + }, + Mouseup: function(t, u) {} + }); + g.ITEM.RULE = g.ITEM.Subclass({ + role: "separator", + Attributes: function(t) { + t = f.Insert({ + "aria-orientation": "vertical" + }, t); + t = this.SUPER(arguments).Attributes.call(this, t); + return t + }, + Label: function(t, u) { + t.className += " MathJax_MenuRule"; + return null + } + }); + g.About = function(x) { + var u = g.About.GetFont(); + var z = g.About.GetFormat(); + var t = ["MathJax.js v" + MathJax.fileversion, ["br"]]; + t.push(["div", { + style: { + "border-top": "groove 2px", + margin: ".25em 0" + } + }]); + g.About.GetJax(t, MathJax.InputJax, ["InputJax", "%1 Input Jax v%2"]); + g.About.GetJax(t, MathJax.OutputJax, ["OutputJax", "%1 Output Jax v%2"]); + g.About.GetJax(t, MathJax.ElementJax, ["ElementJax", "%1 Element Jax v%2"]); + t.push(["div", { + style: { + "border-top": "groove 2px", + margin: ".25em 0" + } + }]); + g.About.GetJax(t, MathJax.Extension, ["Extension", "%1 Extension v%2"], true); + t.push(["div", { + style: { + "border-top": "groove 2px", + margin: ".25em 0" + } + }], ["center", {}, + [f.Browser + " v" + f.Browser.version + (z ? " \u2014 " + s(z.replace(/ /g, ""), z) : "")] + ]); + g.About.div = g.Background(g.About); + var w = n.addElement(g.About.div, "div", { + id: "MathJax_About", + tabIndex: 0, + onkeydown: g.About.Keydown + }, [ + ["b", { + style: { + fontSize: "120%" + } + }, + ["MathJax"] + ], " v" + MathJax.version, ["br"], s(u.replace(/ /g, ""), "using " + u), ["br"], + ["br"], + ["span", { + style: { + display: "inline-block", + "text-align": "left", + "font-size": "80%", + "max-height": "20em", + overflow: "auto", + "background-color": "#E4E4E4", + padding: ".4em .6em", + border: "1px inset" + }, + tabIndex: 0 + }, t], + ["br"], + ["br"], + ["a", { + href: "http://www.mathjax.org/" + }, + ["www.mathjax.org"] + ], + ["span", { + className: "MathJax_MenuClose", + id: "MathJax_AboutClose", + onclick: g.About.Remove, + onkeydown: g.About.Keydown, + tabIndex: 0, + role: "button", + "aria-label": s("CloseAboutDialog", "Close about MathJax dialog") + }, + [ + ["span", {}, "\u00D7"] + ] + ] + ]); + if (x.type === "mouseup") { + w.className += " MathJax_MousePost" + } + w.focus(); + MathJax.Localization.setCSS(w); + var y = (document.documentElement || {}); + var v = window.innerHeight || y.clientHeight || y.scrollHeight || 0; + if (g.prototype.msieAboutBug) { + w.style.width = "20em"; + w.style.position = "absolute"; + w.style.left = Math.floor((document.documentElement.scrollWidth - w.offsetWidth) / 2) + "px"; + w.style.top = (Math.floor((v - w.offsetHeight) / 3) + document.body.scrollTop) + "px" + } else { + w.style.marginLeft = Math.floor(-w.offsetWidth / 2) + "px"; + w.style.top = Math.floor((v - w.offsetHeight) / 3) + "px" + } + }; + g.About.Remove = function(t) { + if (g.About.div) { + document.body.removeChild(g.About.div); + delete g.About.div + } + }; + g.About.Keydown = function(t) { + if (t.keyCode === b.ESCAPE || (this.id === "MathJax_AboutClose" && (t.keyCode === b.SPACE || t.keyCode === b.RETURN))) { + g.About.Remove(t); + g.CurrentNode().focus(); + m(t) + } + }, g.About.GetJax = function(u, z, x, w) { + var y = []; + for (var A in z) { + if (z.hasOwnProperty(A) && z[A]) { + if ((w && z[A].version) || (z[A].isa && z[A].isa(z))) { + y.push(s(x[0], x[1], (z[A].id || A), z[A].version)) + } + } + } + y.sort(); + for (var v = 0, t = y.length; v < t; v++) { + u.push(y[v], ["br"]) + } + return u + }; + g.About.GetFont = function() { + var t = MathJax.Hub.outputJax["jax/mml"][0] || {}; + var u = { + SVG: "web SVG", + CommonHTML: "web TeX", + "HTML-CSS": (t.imgFonts ? "image" : (t.webFonts ? "web" : "local") + " " + t.fontInUse) + }[t.id] || "generic"; + return u + " fonts" + }; + g.About.GetFormat = function() { + var t = MathJax.Hub.outputJax["jax/mml"][0] || {}; + if (t.id !== "HTML-CSS" || !t.webFonts || t.imgFonts) { + return + } + return t.allowWebFonts.replace(/otf/, "woff or otf") + " fonts" + }; + g.Help = function(t) { + p.Require("[MathJax]/extensions/HelpDialog.js", function() { + MathJax.Extension.Help.Dialog({ + type: t.type + }) + }) + }; + g.ShowSource = function(x) { + if (!x) { + x = window.event + } + var w = { + screenX: x.screenX, + screenY: x.screenY + }; + if (!g.jax) { + return + } + if (this.format === "MathML") { + var u = MathJax.ElementJax.mml; + if (u && typeof(u.mbase.prototype.toMathML) !== "undefined") { + try { + g.ShowSource.Text(g.jax.root.toMathML("", g.jax), x) + } catch (v) { + if (!v.restart) { + throw v + } + e.After([this, g.ShowSource, w], v.restart) + } + } else { + if (!p.loadingToMathML) { + p.loadingToMathML = true; + g.ShowSource.Window(x); + e.Queue(p.Require("[MathJax]/extensions/toMathML.js"), function() { + delete p.loadingToMathML; + if (!u.mbase.prototype.toMathML) { + u.mbase.prototype.toMathML = function() {} + } + }, [this, g.ShowSource, w]); + return + } + } + } else { + if (this.format === "Error") { + g.ShowSource.Text(g.jax.errorText, x) + } else { + if (r.semanticsAnnotations[this.format]) { + var t = g.jax.root.getAnnotation(this.format); + if (t.data[0]) { + g.ShowSource.Text(t.data[0].toString()) + } + } else { + if (g.jax.originalText == null) { + alert(s("NoOriginalForm", "No original form available")); + return + } + g.ShowSource.Text(g.jax.originalText, x) + } + } + } + }; + g.ShowSource.Window = function(u) { + if (!g.ShowSource.w) { + var v = [], + t = r.windowSettings; + for (var w in t) { + if (t.hasOwnProperty(w)) { + v.push(w + "=" + t[w]) + } + } + g.ShowSource.w = window.open("", "_blank", v.join(",")) + } + return g.ShowSource.w + }; + g.ShowSource.Text = function(y, v) { + var t = g.ShowSource.Window(v); + delete g.ShowSource.w; + y = y.replace(/^\s*/, "").replace(/\s*$/, ""); + y = y.replace(/&/g, "&").replace(//g, ">"); + var x = s("EqSource", "MathJax Equation Source"); + if (g.isMobile) { + t.document.open(); + t.document.write("" + x + ""); + t.document.write("
" + y + "
"); + t.document.write("
"); + t.document.write(""); + t.document.close() + } else { + t.document.open(); + t.document.write("" + x + ""); + t.document.write("
" + y + "
"); + t.document.write(""); + t.document.close(); + var u = t.document.body.firstChild; + setTimeout(function() { + var A = (t.outerHeight - t.innerHeight) || 30, + z = (t.outerWidth - t.innerWidth) || 30, + w, D; + z = Math.max(140, Math.min(Math.floor(0.5 * screen.width), u.offsetWidth + z + 25)); + A = Math.max(40, Math.min(Math.floor(0.5 * screen.height), u.offsetHeight + A + 25)); + if (g.prototype.msieHeightBug) { + A += 35 + } + t.resizeTo(z, A); + var C; + try { + C = v.screenX + } catch (B) {} + if (v && C != null) { + w = Math.max(0, Math.min(v.screenX - Math.floor(z / 2), screen.width - z - 20)); + D = Math.max(0, Math.min(v.screenY - Math.floor(A / 2), screen.height - A - 20)); + t.moveTo(w, D) + } + }, 50) + } + }; + g.Scale = function() { + var y = ["CommonHTML", "HTML-CSS", "SVG", "NativeMML", "PreviewHTML"], + t = y.length, + x = 100, + v, u; + for (v = 0; v < t; v++) { + u = q[y[v]]; + if (u) { + x = u.config.scale; + break + } + } + var w = prompt(s("ScaleMath", "Scale all mathematics (compared to surrounding text) by"), x + "%"); + if (w) { + if (w.match(/^\s*\d+(\.\d*)?\s*%?\s*$/)) { + w = parseFloat(w); + if (w) { + if (w !== x) { + for (v = 0; v < t; v++) { + u = q[y[v]]; + if (u) { + u.config.scale = w + } + } + g.cookie.scale = f.config.scale = w; + g.saveCookie(); + f.Queue(["Rerender", f]) + } + } else { + alert(s("NonZeroScale", "The scale should not be zero")) + } + } else { + alert(s("PercentScale", "The scale should be a percentage (e.g., 120%%)")) + } + } + }; + g.Zoom = function() { + if (!MathJax.Extension.MathZoom) { + p.Require("[MathJax]/extensions/MathZoom.js") + } + }; + g.Renderer = function() { + var u = f.outputJax["jax/mml"]; + if (u[0] !== r.settings.renderer) { + var x = f.Browser, + w, t = g.Renderer.Messages, + v; + switch (r.settings.renderer) { + case "NativeMML": + if (!r.settings.warnedMML) { + if (x.isChrome && x.version.substr(0, 3) !== "24.") { + w = t.MML.WebKit + } else { + if (x.isSafari && !x.versionAtLeast("5.0")) { + w = t.MML.WebKit + } else { + if (x.isMSIE) { + if (!x.hasMathPlayer) { + w = t.MML.MSIE + } + } else { + if (x.isEdge) { + w = t.MML.WebKit + } else { + w = t.MML[x] + } + } + } + } + v = "warnedMML" + } + break; + case "SVG": + if (!r.settings.warnedSVG) { + if (x.isMSIE && !l) { + w = t.SVG.MSIE + } + } + break + } + if (w) { + w = s(w[0], w[1]); + w += "\n\n"; + w += s("SwitchAnyway", "Switch the renderer anyway?\n\n(Press OK to switch, CANCEL to continue with the current renderer)"); + g.cookie.renderer = u[0].id; + g.saveCookie(); + if (!confirm(w)) { + g.cookie.renderer = r.settings.renderer = n.Cookie.Get("menu").renderer; + g.saveCookie(); + return + } + if (v) { + g.cookie.warned = r.settings.warned = true + } + g.cookie.renderer = r.settings.renderer; + g.saveCookie() + } + f.Queue(["setRenderer", f, r.settings.renderer, "jax/mml"], ["Rerender", f]) + } + }; + g.Renderer.Messages = { + MML: { + WebKit: ["WebkitNativeMMLWarning", "Your browser doesn't seem to support MathML natively, so switching to MathML output may cause the mathematics on the page to become unreadable."], + MSIE: ["MSIENativeMMLWarning", "Internet Explorer requires the MathPlayer plugin in order to process MathML output."], + Opera: ["OperaNativeMMLWarning", "Opera's support for MathML is limited, so switching to MathML output may cause some expressions to render poorly."], + Safari: ["SafariNativeMMLWarning", "Your browser's native MathML does not implement all the features used by MathJax, so some expressions may not render properly."], + Firefox: ["FirefoxNativeMMLWarning", "Your browser's native MathML does not implement all the features used by MathJax, so some expressions may not render properly."] + }, + SVG: { + MSIE: ["MSIESVGWarning", "SVG is not implemented in Internet Explorer prior to IE9 or when it is emulating IE8 or below. Switching to SVG output will cause the mathematics to not display properly."] + } + }; + g.AssistiveMML = function(v, t) { + var u = MathJax.Extension.AssistiveMML; + if (!u) { + if (!t) { + p.Require("[MathJax]/extensions/AssistiveMML.js", ["AssistiveMML", g, v, true]) + } + return + } + MathJax.Hub.Queue([(r.settings.assistiveMML ? "Add" : "Remove") + "AssistiveMathML", u]) + }; + g.Font = function() { + var t = q["HTML-CSS"]; + if (!t) { + return + } + document.location.reload() + }; + g.Locale = function() { + MathJax.Localization.setLocale(r.settings.locale); + MathJax.Hub.Queue(["Reprocess", MathJax.Hub]) + }; + g.LoadLocale = function() { + var t = prompt(s("LoadURL", "Load translation data from this URL:")); + if (t) { + if (!t.match(/\.js$/)) { + alert(s("BadURL", "The URL should be for a javascript file that defines MathJax translation data. Javascript file names should end with '.js'")) + } + p.Require(t, function(u) { + if (u != p.STATUS.OK) { + alert(s("BadData", "Failed to load translation data from %1", t)) + } + }) + } + }; + g.MPEvents = function(v) { + var u = r.settings.discoverable, + t = g.MPEvents.Messages; + if (!l) { + if (r.settings.mpMouse && !confirm(s.apply(s, t.IE8warning))) { + delete g.cookie.mpContext; + delete r.settings.mpContext; + delete g.cookie.mpMouse; + delete r.settings.mpMouse; + g.saveCookie(); + return + } + r.settings.mpContext = r.settings.mpMouse; + g.cookie.mpContext = g.cookie.mpMouse = r.settings.mpMouse; + g.saveCookie(); + MathJax.Hub.Queue(["Rerender", MathJax.Hub]) + } else { + if (!u && v.name[1] === "Menu Events" && r.settings.mpContext) { + alert(s.apply(s, t.IE9warning)) + } + } + }; + g.MPEvents.Messages = { + IE8warning: ["IE8warning", "This will disable the MathJax menu and zoom features, but you can Alt-Click on an expression to obtain the MathJax menu instead.\n\nReally change the MathPlayer settings?"], + IE9warning: ["IE9warning", "The MathJax contextual menu will be disabled, but you can Alt-Click on an expression to obtain the MathJax menu instead."] + }; + f.Browser.Select({ + MSIE: function(t) { + var u = (document.compatMode === "BackCompat"); + var v = t.versionAtLeast("8.0") && document.documentMode > 7; + g.Augment({ + margin: 20, + msieBackgroundBug: ((document.documentMode || 0) < 9), + msieFixedPositionBug: (u || !v), + msieAboutBug: u, + msieHeightBug: ((document.documentMode || 0) < 9) + }); + if (l) { + delete r.styles["#MathJax_About"].filter; + delete r.styles[".MathJax_Menu"].filter + } + }, + Firefox: function(t) { + g.skipMouseover = t.isMobile && t.versionAtLeast("6.0"); + g.skipMousedown = t.isMobile + } + }); + g.isMobile = f.Browser.isMobile; + g.noContextMenu = f.Browser.noContextMenu; + g.CreateLocaleMenu = function() { + if (!g.menu) { + return + } + var y = g.menu.Find("Language").submenu, + v = y.items; + var u = [], + A = MathJax.Localization.strings; + for (var z in A) { + if (A.hasOwnProperty(z)) { + u.push(z) + } + } + u = u.sort(); + y.items = []; + for (var w = 0, t = u.length; w < t; w++) { + var x = A[u[w]].menuTitle; + if (x) { + x += " (" + u[w] + ")" + } else { + x = u[w] + } + y.items.push(c.RADIO([u[w], x], "locale", { + action: g.Locale + })) + } + y.items.push(v[v.length - 2], v[v.length - 1]) + }; + g.CreateAnnotationMenu = function() { + if (!g.menu) { + return + } + var v = g.menu.Find("Show Math As", "Annotation").submenu; + var u = r.semanticsAnnotations; + for (var t in u) { + if (u.hasOwnProperty(t)) { + v.items.push(c.COMMAND([t, t], g.ShowSource, { + hidden: true, + nativeTouch: true, + format: t + })) + } + } + }; + f.Register.StartupHook("End Config", function() { + r.settings = f.config.menuSettings; + if (typeof(r.settings.showRenderer) !== "undefined") { + r.showRenderer = r.settings.showRenderer + } + if (typeof(r.settings.showFontMenu) !== "undefined") { + r.showFontMenu = r.settings.showFontMenu + } + if (typeof(r.settings.showContext) !== "undefined") { + r.showContext = r.settings.showContext + } + g.getCookie(); + g.menu = g(c.SUBMENU(["Show", "Show Math As"], c.COMMAND(["MathMLcode", "MathML Code"], g.ShowSource, { + nativeTouch: true, + format: "MathML" + }), c.COMMAND(["Original", "Original Form"], g.ShowSource, { + nativeTouch: true + }), c.SUBMENU(["Annotation", "Annotation"], { + disabled: true + }), c.RULE(), c.CHECKBOX(["texHints", "Show TeX hints in MathML"], "texHints"), c.CHECKBOX(["semantics", "Add original form as annotation"], "semantics")), c.RULE(), c.SUBMENU(["Settings", "Math Settings"], c.SUBMENU(["ZoomTrigger", "Zoom Trigger"], c.RADIO(["Hover", "Hover"], "zoom", { + action: g.Zoom + }), c.RADIO(["Click", "Click"], "zoom", { + action: g.Zoom + }), c.RADIO(["DoubleClick", "Double-Click"], "zoom", { + action: g.Zoom + }), c.RADIO(["NoZoom", "No Zoom"], "zoom", { + value: "None" + }), c.RULE(), c.LABEL(["TriggerRequires", "Trigger Requires:"]), c.CHECKBOX((f.Browser.isMac ? ["Option", "Option"] : ["Alt", "Alt"]), "ALT"), c.CHECKBOX(["Command", "Command"], "CMD", { + hidden: !f.Browser.isMac + }), c.CHECKBOX(["Control", "Control"], "CTRL", { + hidden: f.Browser.isMac + }), c.CHECKBOX(["Shift", "Shift"], "Shift")), c.SUBMENU(["ZoomFactor", "Zoom Factor"], c.RADIO("125%", "zscale"), c.RADIO("133%", "zscale"), c.RADIO("150%", "zscale"), c.RADIO("175%", "zscale"), c.RADIO("200%", "zscale"), c.RADIO("250%", "zscale"), c.RADIO("300%", "zscale"), c.RADIO("400%", "zscale")), c.RULE(), c.SUBMENU(["Renderer", "Math Renderer"], { + hidden: !r.showRenderer + }, c.RADIO(["HTML-CSS", "HTML-CSS"], "renderer", { + action: g.Renderer + }), c.RADIO(["CommonHTML", "Common HTML"], "renderer", { + action: g.Renderer, + value: "CommonHTML" + }), c.RADIO(["PreviewHTML", "Preview HTML"], "renderer", { + action: g.Renderer, + value: "PreviewHTML" + }), c.RADIO(["MathML", "MathML"], "renderer", { + action: g.Renderer, + value: "NativeMML" + }), c.RADIO(["SVG", "SVG"], "renderer", { + action: g.Renderer + }), c.RADIO(["PlainSource", "Plain Source"], "renderer", { + action: g.Renderer, + value: "PlainSource" + }), c.RULE(), c.CHECKBOX(["FastPreview", "Fast Preview"], "FastPreview"), c.CHECKBOX(["AssistiveMML", "Assistive MathML"], "assistiveMML", { + action: g.AssistiveMML + }), c.CHECKBOX(["InTabOrder", "Include in Tab Order"], "inTabOrder")), c.SUBMENU("MathPlayer", { + hidden: !f.Browser.isMSIE || !r.showMathPlayer, + disabled: !f.Browser.hasMathPlayer + }, c.LABEL(["MPHandles", "Let MathPlayer Handle:"]), c.CHECKBOX(["MenuEvents", "Menu Events"], "mpContext", { + action: g.MPEvents, + hidden: !l + }), c.CHECKBOX(["MouseEvents", "Mouse Events"], "mpMouse", { + action: g.MPEvents, + hidden: !l + }), c.CHECKBOX(["MenuAndMouse", "Mouse and Menu Events"], "mpMouse", { + action: g.MPEvents, + hidden: l + })), c.SUBMENU(["FontPrefs", "Font Preference"], { + hidden: !r.showFontMenu + }, c.LABEL(["ForHTMLCSS", "For HTML-CSS:"]), c.RADIO(["Auto", "Auto"], "font", { + action: g.Font + }), c.RULE(), c.RADIO(["TeXLocal", "TeX (local)"], "font", { + action: g.Font + }), c.RADIO(["TeXWeb", "TeX (web)"], "font", { + action: g.Font + }), c.RADIO(["TeXImage", "TeX (image)"], "font", { + action: g.Font + }), c.RULE(), c.RADIO(["STIXLocal", "STIX (local)"], "font", { + action: g.Font + }), c.RADIO(["STIXWeb", "STIX (web)"], "font", { + action: g.Font + }), c.RULE(), c.RADIO(["AsanaMathWeb", "Asana Math (web)"], "font", { + action: g.Font + }), c.RADIO(["GyrePagellaWeb", "Gyre Pagella (web)"], "font", { + action: g.Font + }), c.RADIO(["GyreTermesWeb", "Gyre Termes (web)"], "font", { + action: g.Font + }), c.RADIO(["LatinModernWeb", "Latin Modern (web)"], "font", { + action: g.Font + }), c.RADIO(["NeoEulerWeb", "Neo Euler (web)"], "font", { + action: g.Font + })), c.SUBMENU(["ContextMenu", "Contextual Menu"], { + hidden: !r.showContext + }, c.RADIO(["MathJax", "MathJax"], "context"), c.RADIO(["Browser", "Browser"], "context")), c.COMMAND(["Scale", "Scale All Math ..."], g.Scale), c.RULE().With({ + hidden: !r.showDiscoverable, + name: ["", "discover_rule"] + }), c.CHECKBOX(["Discoverable", "Highlight on Hover"], "discoverable", { + hidden: !r.showDiscoverable + })), c.SUBMENU(["Locale", "Language"], { + hidden: !r.showLocale, + ltr: true + }, c.RADIO("en", "locale", { + action: g.Locale + }), c.RULE().With({ + hidden: !r.showLocaleURL, + name: ["", "localURL_rule"] + }), c.COMMAND(["LoadLocale", "Load from URL ..."], g.LoadLocale, { + hidden: !r.showLocaleURL + })), c.RULE(), c.COMMAND(["About", "About MathJax"], g.About), c.COMMAND(["Help", "MathJax Help"], g.Help)); + if (g.isMobile) { + (function() { + var u = r.settings; + var t = g.menu.Find("Math Settings", "Zoom Trigger").submenu; + t.items[0].disabled = t.items[1].disabled = true; + if (u.zoom === "Hover" || u.zoom == "Click") { + u.zoom = "None" + } + t.items = t.items.slice(0, 4); + if (navigator.appVersion.match(/[ (]Android[) ]/)) { + g.ITEM.SUBMENU.Augment({ + marker: "\u00BB" + }) + } + })() + } + g.CreateLocaleMenu(); + g.CreateAnnotationMenu() + }); + g.showRenderer = function(t) { + g.cookie.showRenderer = r.showRenderer = t; + g.saveCookie(); + g.menu.Find("Math Settings", "Math Renderer").hidden = !t + }; + g.showMathPlayer = function(t) { + g.cookie.showMathPlayer = r.showMathPlayer = t; + g.saveCookie(); + g.menu.Find("Math Settings", "MathPlayer").hidden = !t + }; + g.showFontMenu = function(t) { + g.cookie.showFontMenu = r.showFontMenu = t; + g.saveCookie(); + g.menu.Find("Math Settings", "Font Preference").hidden = !t + }; + g.showContext = function(t) { + g.cookie.showContext = r.showContext = t; + g.saveCookie(); + g.menu.Find("Math Settings", "Contextual Menu").hidden = !t + }; + g.showDiscoverable = function(t) { + g.cookie.showDiscoverable = r.showDiscoverable = t; + g.saveCookie(); + g.menu.Find("Math Settings", "Highlight on Hover").hidden = !t; + g.menu.Find("Math Settings", "discover_rule").hidden = !t + }; + g.showLocale = function(t) { + g.cookie.showLocale = r.showLocale = t; + g.saveCookie(); + g.menu.Find("Language").hidden = !t + }; + MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready", function() { + if (!MathJax.OutputJax["HTML-CSS"].config.imageFont) { + g.menu.Find("Math Settings", "Font Preference", "TeX (image)").disabled = true + } + }); + e.Queue(f.Register.StartupHook("End Config", {}), ["Styles", p, r.styles], ["Post", f.Startup.signal, "MathMenu Ready"], ["loadComplete", p, "[MathJax]/extensions/MathMenu.js"]) +})(MathJax.Hub, MathJax.HTML, MathJax.Ajax, MathJax.CallBack, MathJax.OutputJax); diff --git a/modules/MathJax/extensions/MathZoom.js b/modules/MathJax/extensions/MathZoom.js new file mode 100644 index 0000000..ff180ee --- /dev/null +++ b/modules/MathJax/extensions/MathZoom.js @@ -0,0 +1,19 @@ +/* + * /MathJax/extensions/MathZoom.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(a,d,f,c,j){var k="2.6.0";var i=a.CombineConfig("MathZoom",{styles:{"#MathJax_Zoom":{position:"absolute","background-color":"#F0F0F0",overflow:"auto",display:"block","z-index":301,padding:".5em",border:"1px solid black",margin:0,"font-weight":"normal","font-style":"normal","text-align":"left","text-indent":0,"text-transform":"none","line-height":"normal","letter-spacing":"normal","word-spacing":"normal","word-wrap":"normal","white-space":"nowrap","float":"none","-webkit-box-sizing":"content-box","-moz-box-sizing":"content-box","box-sizing":"content-box","box-shadow":"5px 5px 15px #AAAAAA","-webkit-box-shadow":"5px 5px 15px #AAAAAA","-moz-box-shadow":"5px 5px 15px #AAAAAA","-khtml-box-shadow":"5px 5px 15px #AAAAAA",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')"},"#MathJax_ZoomOverlay":{position:"absolute",left:0,top:0,"z-index":300,display:"inline-block",width:"100%",height:"100%",border:0,padding:0,margin:0,"background-color":"white",opacity:0,filter:"alpha(opacity=0)"},"#MathJax_ZoomFrame":{position:"relative",display:"inline-block",height:0,width:0},"#MathJax_ZoomEventTrap":{position:"absolute",left:0,top:0,"z-index":302,display:"inline-block",border:0,padding:0,margin:0,"background-color":"white",opacity:0,filter:"alpha(opacity=0)"}}});var e,b,g;MathJax.Hub.Register.StartupHook("MathEvents Ready",function(){g=MathJax.Extension.MathEvents.Event;e=MathJax.Extension.MathEvents.Event.False;b=MathJax.Extension.MathEvents.Hover});var h=MathJax.Extension.MathZoom={version:k,settings:a.config.menuSettings,scrollSize:18,HandleEvent:function(n,l,m){if(h.settings.CTRL&&!n.ctrlKey){return true}if(h.settings.ALT&&!n.altKey){return true}if(h.settings.CMD&&!n.metaKey){return true}if(h.settings.Shift&&!n.shiftKey){return true}if(!h[l]){return true}return h[l](n,m)},Click:function(m,l){if(this.settings.zoom==="Click"){return this.Zoom(m,l)}},DblClick:function(m,l){if(this.settings.zoom==="Double-Click"||this.settings.zoom==="DoubleClick"){return this.Zoom(m,l)}},Hover:function(m,l){if(this.settings.zoom==="Hover"){this.Zoom(m,l);return true}return false},Zoom:function(o,u){this.Remove();b.ClearHoverTimer();g.ClearSelection();var s=MathJax.OutputJax[u.jaxID];var p=s.getJaxFromMath(u);if(p.hover){b.UnHover(p)}var q=this.findContainer(u);var l=Math.floor(0.85*q.clientWidth),t=Math.max(document.body.clientHeight,document.documentElement.clientHeight);if(this.getOverflow(q)!=="visible"){t=Math.min(q.clientHeight,t)}t=Math.floor(0.85*t);var n=d.Element("span",{id:"MathJax_ZoomFrame"},[["span",{id:"MathJax_ZoomOverlay",onmousedown:this.Remove}],["span",{id:"MathJax_Zoom",onclick:this.Remove,style:{visibility:"hidden",fontSize:this.settings.zscale}},[["span",{style:{display:"inline-block","white-space":"nowrap"}}]]]]);var z=n.lastChild,w=z.firstChild,r=n.firstChild;u.parentNode.insertBefore(n,u);u.parentNode.insertBefore(u,n);if(w.addEventListener){w.addEventListener("mousedown",this.Remove,true)}var m=z.offsetWidth||z.clientWidth;l-=m;t-=m;z.style.maxWidth=l+"px";z.style.maxHeight=t+"px";if(this.msieTrapEventBug){var y=d.Element("span",{id:"MathJax_ZoomEventTrap",onmousedown:this.Remove});n.insertBefore(y,z)}if(this.msieZIndexBug){var v=d.addElement(document.body,"img",{src:"about:blank",id:"MathJax_ZoomTracker",width:0,height:0,style:{width:0,height:0,position:"relative"}});n.style.position="relative";n.style.zIndex=i.styles["#MathJax_ZoomOverlay"]["z-index"];n=v}var x=s.Zoom(p,w,u,l,t);if(this.msiePositionBug){if(this.msieSizeBug){z.style.height=x.zH+"px";z.style.width=x.zW+"px"}if(z.offsetHeight>t){z.style.height=t+"px";z.style.width=(x.zW+this.scrollSize)+"px"}if(z.offsetWidth>l){z.style.width=l+"px";z.style.height=(x.zH+this.scrollSize)+"px"}}if(this.operaPositionBug){z.style.width=Math.min(l,x.zW)+"px"}if(z.offsetWidth>m&&z.offsetWidth-m=9);h.msiePositionBug=!m;h.msieSizeBug=l.versionAtLeast("7.0")&&(!document.documentMode||n===7||n===8);h.msieZIndexBug=(n<=7);h.msieInlineBlockAlignBug=(n<=7);h.msieTrapEventBug=!window.addEventListener;if(document.compatMode==="BackCompat"){h.scrollSize=52}if(m){delete i.styles["#MathJax_Zoom"].filter}},Opera:function(l){h.operaPositionBug=true;h.operaRefreshBug=true}});h.topImg=(h.msieInlineBlockAlignBug?d.Element("img",{style:{width:0,height:0,position:"relative"},src:"about:blank"}):d.Element("span",{style:{width:0,height:0,display:"inline-block"}}));if(h.operaPositionBug||h.msieTopBug){h.topImg.style.border="1px solid"}MathJax.Callback.Queue(["StartupHook",MathJax.Hub.Register,"Begin Styles",{}],["Styles",f,i.styles],["Post",a.Startup.signal,"MathZoom Ready"],["loadComplete",f,"[MathJax]/extensions/MathZoom.js"])})(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.OutputJax["HTML-CSS"],MathJax.OutputJax.NativeMML); diff --git a/modules/MathJax/jax/output/HTML-CSS/jax.js b/modules/MathJax/jax/output/HTML-CSS/jax.js new file mode 100644 index 0000000..5d5d79c --- /dev/null +++ b/modules/MathJax/jax/output/HTML-CSS/jax.js @@ -0,0 +1,19 @@ +/* + * /MathJax/jax/output/HTML-CSS/jax.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(h,b,d){var g,i=b.Browser.isMobile;var e=function(){var k=[].slice.call(arguments,0);k[0][0]=["HTML-CSS",k[0][0]];return MathJax.Message.Set.apply(MathJax.Message,k)};var f=MathJax.Object.Subclass({timeout:(i?15:8)*1000,comparisonFont:["sans-serif","monospace","script","Times","Courier","Arial","Helvetica"],testSize:["40px","50px","60px","30px","20px"],FedoraSTIXcheck:{family:"STIXSizeOneSym",testString:"abcABC",noStyleChar:true},Init:function(){this.div=MathJax.HTML.addElement(document.body,"div",{style:{position:"absolute",width:0,height:0,overflow:"hidden",padding:0,border:0,margin:0}},[["div",{id:"MathJax_Font_Test",style:{position:"absolute",visibility:"hidden",top:0,left:0,width:"auto",padding:0,border:0,margin:0,whiteSpace:"nowrap",textAlign:"left",textIndent:0,textTransform:"none",lineHeight:"normal",letterSpacing:"normal",wordSpacing:"normal",fontSize:this.testSize[0],fontWeight:"normal",fontStyle:"normal",fontSizeAdjust:"none"}},[""]]]).firstChild;this.text=this.div.firstChild},findFont:function(p,l){var o=null;if(l&&this.testCollection(l)){o=l}else{for(var n=0,k=p.length;n=p.HTMLCSSlast+p.HTMLCSSchunk){this.postTranslate(p,true);p.HTMLCSSchunk=Math.floor(p.HTMLCSSchunk*this.config.EqnChunkFactor);p.HTMLCSSdelay=true}return false},savePreview:function(k){var l=k.MathJax.preview;if(l){k.MathJax.tmpPreview=document.createElement("span");l.parentNode.replaceChild(k.MathJax.tmpPreview,l)}},restorePreview:function(k){var l=k.MathJax.tmpPreview;if(l){l.parentNode.replaceChild(k.MathJax.preview,l);delete k.MathJax.tmpPreview}},getMetrics:function(k){var l=k.HTMLCSS;this.em=g.mbase.prototype.em=l.em*l.scale;this.outerEm=l.em;this.scale=l.scale;this.cwidth=l.cwidth;this.linebreakWidth=l.lineWidth},postTranslate:function(l,s){var p=l.jax[this.id],t,n,q,o;for(q=l.HTMLCSSlast,o=l.HTMLCSSeqn;qk){w.style.width=(s+100)+"px"}}}p=w.firstChild.firstChild.style;if(x.H!=null&&x.H>x.h){p.marginTop=d.Em(x.H-Math.max(x.h,d.FONTDATA.lineH))}if(x.D!=null&&x.D>x.d){p.marginBottom=d.Em(x.D-Math.max(x.d,d.FONTDATA.lineD))}if(x.lw<0){p.paddingLeft=d.Em(-x.lw)}if(x.rw>x.w){p.marginRight=d.Em(x.rw-x.w)}w.style.position="absolute";if(!n){v.style.position="absolute"}var u=w.offsetWidth,r=w.offsetHeight,y=v.offsetHeight,q=v.offsetWidth;w.style.position=v.style.position="";return{Y:-j.getBBox(w).h,mW:q,mH:y,zW:u,zH:r}},initImg:function(k){},initHTML:function(l,k){},initFont:function(k){var m=d.FONTDATA.FONTS,l=d.config.availableFonts;if(l&&l.length&&d.Font.testFont(m[k])){m[k].available=true;if(m[k].familyFixed){m[k].family=m[k].familyFixed;delete m[k].familyFixed}return null}if(!this.allowWebFonts){return null}m[k].isWebFont=true;if(d.FontFaceBug){m[k].family=k;if(d.msieFontCSSBug){m[k].family+="-Web"}}return h.Styles({"@font-face":this.Font.fontFace(k)})},Remove:function(k){var l=document.getElementById(k.inputID+"-Frame");if(l){if(k.HTMLCSS.display){l=l.parentNode}l.parentNode.removeChild(l)}delete k.HTMLCSS},getHD:function(l,m){if(l.bbox&&this.config.noReflows&&!m){return{h:l.bbox.h,d:l.bbox.d}}var k=l.style.position;l.style.position="absolute";this.HDimg.style.height="0px";l.appendChild(this.HDspan);var n={h:l.offsetHeight};this.HDimg.style.height=n.h+"px";n.d=l.offsetHeight-n.h;n.h-=n.d;n.h/=this.em;n.d/=this.em;l.removeChild(this.HDspan);l.style.position=k;return n},getW:function(o){var l,n,m=(o.bbox||{}).w,p=o;if(o.bbox&&this.config.noReflows&&o.bbox.exactW!==false){if(!o.bbox.exactW){if(o.style.paddingLeft){m+=this.unEm(o.style.paddingLeft)*(o.scale||1)}if(o.style.paddingRight){m+=this.unEm(o.style.paddingRight)*(o.scale||1)}}return m}if(o.bbox&&o.bbox.exactW){return m}if((o.bbox&&m>=0&&!this.initialSkipBug&&!this.msieItalicWidthBug)||this.negativeBBoxes||!o.firstChild){l=o.offsetWidth;n=o.parentNode.offsetHeight}else{if(o.bbox&&m<0&&this.msieNegativeBBoxBug){l=-o.offsetWidth,n=o.parentNode.offsetHeight}else{var k=o.style.position;o.style.position="absolute";p=this.startMarker;o.insertBefore(p,o.firstChild);o.appendChild(this.endMarker);l=this.endMarker.offsetLeft-p.offsetLeft;o.removeChild(this.endMarker);o.removeChild(p);o.style.position=k}}if(n!=null){o.parentNode.HH=n/this.em}return l/this.em},Measured:function(m,l){var n=m.bbox;if(n.width==null&&n.w&&!n.isMultiline){var k=this.getW(m);n.rw+=k-n.w;n.w=k;n.exactW=true}if(!l){l=m.parentNode}if(!l.bbox){l.bbox=n}return m},Remeasured:function(l,k){k.bbox=this.Measured(l,k).bbox},MeasureSpans:function(o){var r=[],t,q,n,u,k,p,l,s;for(q=0,n=o.length;q=0&&!this.initialSkipBug)||(u.w<0&&this.msieNegativeBBoxBug)){r.push([t])}else{if(this.initialSkipBug){k=this.startMarker.cloneNode(true);p=this.endMarker.cloneNode(true);t.insertBefore(k,t.firstChild);t.appendChild(p);r.push([t,k,p,t.style.position]);t.style.position="absolute"}else{p=this.endMarker.cloneNode(true);t.appendChild(p);r.push([t,null,p])}}}for(q=0,n=r.length;q=0&&!this.initialSkipBug)||this.negativeBBoxes||!t.firstChild){l=t.offsetWidth;s.HH=s.offsetHeight/this.em}else{if(u.w<0&&this.msieNegativeBBoxBug){l=-t.offsetWidth,s.HH=s.offsetHeight/this.em}else{l=r[q][2].offsetLeft-((r[q][1]||{}).offsetLeft||0)}}l/=this.em;u.rw+=l-u.w;u.w=l;u.exactW=true;if(!s.bbox){s.bbox=u}}for(q=0,n=r.length;q=0){p.style.width=this.Em(q);p.style.display="inline-block";p.style.overflow="hidden"}else{if(this.msieNegativeSpaceBug){p.style.height=""}p.style.marginLeft=this.Em(q);if(d.safariNegativeSpaceBug&&p.parentNode.firstChild==p){this.createBlank(p,0,true)}}if(m&&m!==g.COLOR.TRANSPARENT){p.style.backgroundColor=m;p.style.position="relative"}return p},createRule:function(r,n,p,s,l){if(n<-p){p=-n}var m=d.TeX.min_rule_thickness,o=1;if(s>0&&s*this.em0&&(n+p)*this.emn+p){k.borderTop=this.Px(n+p)+" "+l;k.width=this.Em(s);k.height=(this.msieRuleBug&&n+p>0?this.Em(n+p):0)}else{k.borderLeft=this.Px(s)+" "+l;k.width=(this.msieRuleBug&&s>0?this.Em(s):0);k.height=this.Em(n+p)}var q=this.addElement(r,"span",{style:k,noAdjust:true,HH:n+p,isMathJax:true,bbox:{h:n,d:p,w:s,rw:s,lw:0,exactW:true}});if(r.isBox||r.className=="mspace"){r.bbox=q.bbox,r.HH=n+p}return q},createFrame:function(s,q,r,u,x,l){if(q<-r){r=-q}var p=2*x;if(this.msieFrameSizeBug){if(uC.w){d.createBlank(u,C.rw-C.w+0.1)}}if(!this.msieClipRectBug&&!C.noclip&&!o){var B=3/this.em;var A=(C.H==null?C.h:C.H),m=(C.D==null?C.d:C.D);var E=w-A-B,p=w+m+B,n=-1000,k=C.rw+1000;u.style.clip="rect("+this.Em(E)+" "+this.Em(k)+" "+this.Em(p)+" "+this.Em(n)+")"}}u.style.top=this.Em(-q-w);u.style.left=this.Em(s+F);if(C&&z){if(C.H!=null&&(z.H==null||C.H+q>z.H)){z.H=C.H+q}if(C.D!=null&&(z.D==null||C.D-q>z.D)){z.D=C.D-q}if(C.h+q>z.h){z.h=C.h+q}if(C.d-q>z.d){z.d=C.d-q}if(z.H!=null&&z.H<=z.h){delete z.H}if(z.D!=null&&z.D<=z.d){delete z.D}if(C.w+s>z.w){z.w=C.w+s;if(z.width==null){v.style.width=this.Em(z.w)}}if(C.rw+s>z.rw){z.rw=C.rw+s}if(C.lw+s=n-0.01||(s==p-1&&!l.stretch)){if(l.HW[s][2]){q*=l.HW[s][2]}if(l.HW[s][3]){k=l.HW[s][3]}var r=this.addElement(u,"span");this.createChar(r,[k,l.HW[s][1]],q,o);u.bbox=r.bbox;u.offset=0.65*u.bbox.w;u.scale=q;return}}if(l.stretch){this["extendDelimiter"+l.dir](u,t,l.stretch,q,o)}},extendDelimiterV:function(A,t,E,F,w){var o=this.createStack(A,true);var v=this.createBox(o),u=this.createBox(o);this.createChar(v,(E.top||E.ext),F,w);this.createChar(u,(E.bot||E.ext),F,w);var m={bbox:{w:0,lw:0,rw:0}},D=m,p;var B=v.bbox.h+v.bbox.d+u.bbox.h+u.bbox.d;var r=-v.bbox.h;this.placeBox(v,0,r,true);r-=v.bbox.d;if(E.mid){D=this.createBox(o);this.createChar(D,E.mid,F,w);B+=D.bbox.h+D.bbox.d}if(E.min&&tB){m=this.Element("span");this.createChar(m,E.ext,F,w);var C=m.bbox.h+m.bbox.d,l=C-0.05,x,q,z=(E.mid?2:1);q=x=Math.min(Math.ceil((t-B)/(z*l)),this.maxStretchyParts);if(!E.fullExtenders){l=(t-B)/(z*x)}var s=(x/(x+1))*(C-l);l=C-s;r+=s+l-m.bbox.h;while(z-->0){while(x-->0){if(!this.msieCloneNodeBug){p=m.cloneNode(true)}else{p=this.Element("span");this.createChar(p,E.ext,F,w)}p.bbox=m.bbox;r-=l;this.placeBox(this.addBox(o,p),0,r,true)}r+=s-m.bbox.d;if(E.mid&&z){this.placeBox(D,0,r-D.bbox.h,true);x=q;r+=-(D.bbox.h+D.bbox.d)+s+l-m.bbox.h}}}else{r+=(B-t)/2;if(E.mid){this.placeBox(D,0,r-D.bbox.h,true);r+=-(D.bbox.h+D.bbox.d)}r+=(B-t)/2}this.placeBox(u,0,r-u.bbox.h,true);r-=u.bbox.h+u.bbox.d;A.bbox={w:Math.max(v.bbox.w,m.bbox.w,u.bbox.w,D.bbox.w),lw:Math.min(v.bbox.lw,m.bbox.lw,u.bbox.lw,D.bbox.lw),rw:Math.max(v.bbox.rw,m.bbox.rw,u.bbox.rw,D.bbox.rw),h:0,d:-r,exactW:true};A.scale=F;A.offset=0.55*A.bbox.w;A.isMultiChar=true;this.setStackWidth(o,A.bbox.w)},extendDelimiterH:function(B,o,E,G,y){var r=this.createStack(B,true);var p=this.createBox(r),C=this.createBox(r);this.createChar(p,(E.left||E.rep),G,y);this.createChar(C,(E.right||E.rep),G,y);var l=this.Element("span");this.createChar(l,E.rep,G,y);var D={bbox:{h:-this.BIGDIMEN,d:-this.BIGDIMEN}},m;this.placeBox(p,-p.bbox.lw,0,true);var u=(p.bbox.rw-p.bbox.lw)+(C.bbox.rw-C.bbox.lw)-0.05,t=p.bbox.rw-p.bbox.lw-0.025,v;if(E.mid){D=this.createBox(r);this.createChar(D,E.mid,G,y);u+=D.bbox.w}if(E.min&&ou){var F=l.bbox.rw-l.bbox.lw,q=F-0.05,z,s,A=(E.mid?2:1);s=z=Math.min(Math.ceil((o-u)/(A*q)),this.maxStretchyParts);if(!E.fillExtenders){q=(o-u)/(A*z)}v=(z/(z+1))*(F-q);q=F-v;t-=l.bbox.lw+v;while(A-->0){while(z-->0){if(!this.cloneNodeBug){m=l.cloneNode(true)}else{m=this.Element("span");this.createChar(m,E.rep,G,y)}m.bbox=l.bbox;this.placeBox(this.addBox(r,m),t,0,true);t+=q}if(E.mid&&A){this.placeBox(D,t,0,true);t+=D.bbox.w-v;z=s}}}else{t-=(u-o)/2;if(E.mid){this.placeBox(D,t,0,true);t+=D.bbox.w}t-=(u-o)/2}this.placeBox(C,t,0,true);B.bbox={w:t+C.bbox.rw,lw:0,rw:t+C.bbox.rw,h:Math.max(p.bbox.h,l.bbox.h,C.bbox.h,D.bbox.h),d:Math.max(p.bbox.d,l.bbox.d,C.bbox.d,D.bbox.d),exactW:true};B.scale=G;B.isMultiChar=true;this.setStackWidth(r,B.bbox.w)},createChar:function(s,p,n,k){s.isMathJax=true;var r=s,t="",o={fonts:[p[1]],noRemap:true};if(k&&k===g.VARIANT.BOLD){o.fonts=[p[1]+"-bold",p[1]]}if(typeof(p[1])!=="string"){o=p[1]}if(p[0] instanceof Array){for(var q=0,l=p[0].length;q=55296&&w<56319){A++;w=(((w-55296)<<10)+(r.charCodeAt(A)-56320))+65536;if(this.FONTDATA.RemapPlane1){var D=this.FONTDATA.RemapPlane1(w,o);w=D.n;o=D.variant}}else{var t,q,u=this.FONTDATA.RANGES;for(t=0,q=u.length;t=u[t].low&&w<=u[t].high){if(u[t].remap&&u[t].remap[w]){w=p+u[t].remap[w]}else{w=w-u[t].low+p;if(u[t].add){w+=u[t].add}}if(o["variant"+u[t].offset]){o=this.FONTDATA.VARIANT[o["variant"+u[t].offset]]}break}}}if(o.remap&&o.remap[w]){w=o.remap[w];if(o.remap.variant){o=this.FONTDATA.VARIANT[o.remap.variant]}}else{if(this.FONTDATA.REMAP[w]&&!o.noRemap){w=this.FONTDATA.REMAP[w]}}if(w instanceof Array){o=this.FONTDATA.VARIANT[w[1]];w=w[0]}if(typeof(w)==="string"){r=w+r.substr(A+1);x=r.length;A=-1;continue}s=this.lookupChar(o,w);B=s[w];if(l||(!this.checkFont(s,k.style)&&!B[5].img)){if(y.length){this.addText(k,y);y=""}var v=!!k.style.fontFamily||!!z.style.fontStyle||!!z.style.fontWeight||!s.directory||l;l=false;if(k!==z){v=!this.checkFont(s,z.style);k=z}if(v){k=this.addElement(z,"span",{isMathJax:true,subSpan:true})}this.handleFont(k,s,k!==z)}y=this.handleChar(k,s,B,w,y);if(!(B[5]||{}).space){if(B[0]/1000>z.bbox.h){z.bbox.h=B[0]/1000}if(B[1]/1000>z.bbox.d){z.bbox.d=B[1]/1000}}if(z.bbox.w+B[3]/1000z.bbox.rw){z.bbox.rw=z.bbox.w+B[4]/1000}z.bbox.w+=B[2]/1000;if((B[5]||{}).isUnknown){z.bbox.exactW=false}}if(y.length){this.addText(k,y)}if(z.scale&&z.scale!==1){z.bbox.h*=z.scale;z.bbox.d*=z.scale;z.bbox.w*=z.scale;z.bbox.lw*=z.scale;z.bbox.rw*=z.scale}if(r.length==1&&s.skew&&s.skew[w]){z.bbox.skew=s.skew[w]}},checkFont:function(k,l){var m=(l.fontWeight||"normal");if(m.match(/^\d+$/)){m=(parseInt(m)>=600?"bold":"normal")}return(k.family.replace(/'/g,"")===l.fontFamily.replace(/'/g,"")&&(k.style||"normal")===(l.fontStyle||"normal")&&(k.weight||"normal")===m)},handleFont:function(m,k,o){m.style.fontFamily=k.family;if(!k.directory){m.style.fontSize=Math.floor(d.config.scale/d.scale+0.5)+"%"}if(!(d.FontFaceBug&&k.isWebFont)){var l=k.style||"normal",n=k.weight||"normal";if(l!=="normal"||o){m.style.fontStyle=l}if(n!=="normal"||o){m.style.fontWeight=n}}},handleChar:function(l,k,s,r,q){var p=s[5];if(p.space){if(q.length){this.addText(l,q)}d.createShift(l,s[2]/1000);return""}if(p.img){return this.handleImg(l,k,s,r,q)}if(p.isUnknown&&this.FONTDATA.DELIMITERS[r]){if(q.length){this.addText(l,q)}var o=l.scale;d.createDelimiter(l,r,0,1,k);if(this.FONTDATA.DELIMITERS[r].dir==="V"){l.style.verticalAlign=this.Em(l.bbox.d);l.bbox.h+=l.bbox.d;l.bbox.d=0}l.scale=o;s[0]=l.bbox.h*1000;s[1]=l.bbox.d*1000;s[2]=l.bbox.w*1000;s[3]=l.bbox.lw*1000;s[4]=l.bbox.rw*1000;return""}if(p.c==null){if(r<=65535){p.c=String.fromCharCode(r)}else{var m=r-65536;p.c=String.fromCharCode((m>>10)+55296)+String.fromCharCode((m&1023)+56320)}}if(d.ffFontOptimizationBug&&s[4]-s[2]>125){l.style.textRendering="optimizeLegibility"}if(p.rfix){this.addText(l,q+p.c);d.createShift(l,p.rfix/1000);return""}if(s[2]||!this.msieAccentBug||q.length){return q+p.c}d.createShift(l,s[3]/1000);d.createShift(l,(s[4]-s[3])/1000);this.addText(l,p.c);d.createShift(l,-s[4]/1000);return""},handleImg:function(l,k,p,o,m){return m},lookupChar:function(p,s){var o,k;if(!p.FONTS){var r=this.FONTDATA.FONTS;var q=(p.fonts||this.FONTDATA.VARIANT.normal.fonts);if(!(q instanceof Array)){q=[q]}if(p.fonts!=q){p.fonts=q}p.FONTS=[];for(o=0,k=q.length;o=0;n--){if(l.Ranges[n][2]==o){l.Ranges.splice(n,1)}}this.loadFont(l.directory+"/"+o+".js")}}}},loadFont:function(l){var k=MathJax.Callback.Queue();k.Push(["Require",h,this.fontDir+"/"+l]);if(this.imgFonts){if(!MathJax.isPacked){l=l.replace(/\/([^\/]*)$/,d.imgPacked+"/$1")}k.Push(["Require",h,this.webfontDir+"/png/"+l])}b.RestartAfter(k.Push({}))},loadWebFont:function(k){k.available=k.isWebFont=true;if(d.FontFaceBug){k.family=k.name;if(d.msieFontCSSBug){k.family+="-Web"}}b.RestartAfter(this.Font.loadWebFont(k))},loadWebFontError:function(l,k){b.Startup.signal.Post("HTML-CSS Jax - disable web fonts");l.isWebFont=false;if(this.config.imageFont&&this.config.imageFont===this.fontInUse){this.imgFonts=true;b.Startup.signal.Post("HTML-CSS Jax - switch to image fonts");b.Startup.signal.Post("HTML-CSS Jax - using image fonts");e(["WebFontNotAvailable","Web-Fonts not available -- using image fonts instead"],null,3000);h.Require(this.directory+"/imageFonts.js",k)}else{this.allowWebFonts=false;k()}},Element:MathJax.HTML.Element,addElement:MathJax.HTML.addElement,TextNode:MathJax.HTML.TextNode,addText:MathJax.HTML.addText,ucMatch:MathJax.HTML.ucMatch,BIGDIMEN:10000000,ID:0,idPostfix:"",GetID:function(){this.ID++;return this.ID},MATHSPACE:{veryverythinmathspace:1/18,verythinmathspace:2/18,thinmathspace:3/18,mediummathspace:4/18,thickmathspace:5/18,verythickmathspace:6/18,veryverythickmathspace:7/18,negativeveryverythinmathspace:-1/18,negativeverythinmathspace:-2/18,negativethinmathspace:-3/18,negativemediummathspace:-4/18,negativethickmathspace:-5/18,negativeverythickmathspace:-6/18,negativeveryverythickmathspace:-7/18},TeX:{x_height:0.430554,quad:1,num1:0.676508,num2:0.393732,num3:0.44373,denom1:0.685951,denom2:0.344841,sup1:0.412892,sup2:0.362892,sup3:0.288888,sub1:0.15,sub2:0.247217,sup_drop:0.386108,sub_drop:0.05,delim1:2.39,delim2:1,axis_height:0.25,rule_thickness:0.06,big_op_spacing1:0.111111,big_op_spacing2:0.166666,big_op_spacing3:0.2,big_op_spacing4:0.6,big_op_spacing5:0.1,scriptspace:0.1,nulldelimiterspace:0.12,delimiterfactor:901,delimitershortfall:0.3,min_rule_thickness:1.25},NBSP:"\u00A0",rfuzz:0});MathJax.Hub.Register.StartupHook("mml Jax Ready",function(){g=MathJax.ElementJax.mml;g.mbase.Augment({toHTML:function(o){o=this.HTMLcreateSpan(o);if(this.type!="mrow"){o=this.HTMLhandleSize(o)}for(var l=0,k=this.data.length;ll.d){l.d=m.d}if(m.h>l.h){l.h=m.h}if(m.D!=null&&m.D>l.D){l.D=m.D}if(m.H!=null&&m.H>l.H){l.H=m.H}if(n.style.paddingLeft){l.w+=d.unEm(n.style.paddingLeft)*(n.scale||1)}if(l.w+m.lwl.rw){l.rw=l.w+m.rw}l.w+=m.w;if(n.style.paddingRight){l.w+=d.unEm(n.style.paddingRight)*(n.scale||1)}if(m.width){l.width=m.width;l.minWidth=m.minWidth}if(m.tw){l.tw=m.tw}if(m.ic){l.ic=m.ic}else{delete l.ic}if(l.exactW&&!m.exactW){l.exactW=m.exactW}},HTMLemptyBBox:function(k){k.h=k.d=k.H=k.D=k.rw=-d.BIGDIMEN;k.w=0;k.lw=d.BIGDIMEN;return k},HTMLcleanBBox:function(k){if(k.h===this.BIGDIMEN){k.h=k.d=k.H=k.D=k.w=k.rw=k.lw=0}if(k.D<=k.d){delete k.D}if(k.H<=k.h){delete k.H}},HTMLzeroBBox:function(){return{h:0,d:0,w:0,lw:0,rw:0}},HTMLcanStretch:function(l){if(this.isEmbellished()){var k=this.Core();if(k&&k!==this){return k.HTMLcanStretch(l)}}return false},HTMLstretchH:function(l,k){return this.HTMLspanElement()},HTMLstretchV:function(l,k,m){return this.HTMLspanElement()},HTMLnotEmpty:function(k){while(k){if((k.type!=="mrow"&&k.type!=="texatom")||k.data.length>1){return true}k=k.data[0]}return false},HTMLmeasureChild:function(l,k){if(this.data[l]){d.Measured(this.data[l].toHTML(k),k)}else{k.bbox=this.HTMLzeroBBox()}},HTMLboxChild:function(l,k){if(!this.data[l]){this.SetData(l,g.mrow())}return this.data[l].toHTML(k)},HTMLcreateSpan:function(k){if(this.spanID){var l=this.HTMLspanElement();if(l&&(l.parentNode===k||(l.parentNode||{}).parentNode===k)){while(l.firstChild){l.removeChild(l.firstChild)}l.bbox=this.HTMLzeroBBox();l.scale=1;l.isMultChar=l.HH=null;l.style.cssText="";return l}}if(this.href){k=d.addElement(k,"a",{href:this.href,isMathJax:true})}k=d.addElement(k,"span",{className:this.type,isMathJax:true});if(d.imgHeightBug){k.style.display="inline-block"}if(this["class"]){k.className+=" "+this["class"]}if(!this.spanID){this.spanID=d.GetID()}k.id=(this.id||"MathJax-Span-"+this.spanID)+d.idPostfix;k.bbox=this.HTMLzeroBBox();this.styles={};if(this.style){k.style.cssText=this.style;if(k.style.fontSize){this.mathsize=k.style.fontSize;k.style.fontSize=""}this.styles={border:d.getBorders(k),padding:d.getPadding(k)};if(this.styles.border){k.style.border=""}if(this.styles.padding){k.style.padding=""}}if(this.href){k.parentNode.bbox=k.bbox}this.HTMLaddAttributes(k);return k},HTMLaddAttributes:function(n){if(this.attrNames){var s=this.attrNames,o=g.nocopyAttributes,r=b.config.ignoreMMLattributes;var p=(this.type==="mstyle"?g.math.prototype.defaults:this.defaults);for(var l=0,k=s.length;l0){o+=2*z;u-=z}if(x>0){x+=2*z;k-=z}s=-o-u;if(t){s-=t.right;k-=t.bottom;r+=t.left;p+=t.right;A.h+=t.top;A.d+=t.bottom;A.w+=t.left+t.right;A.lw-=t.left;A.rw+=t.right}if(v){x+=v.top+v.bottom;o+=v.left+v.right;s-=v.right;k-=v.bottom;r+=v.left;p+=v.right;A.h+=v.top;A.d+=v.bottom;A.w+=v.left+v.right;A.lw-=v.left;A.rw+=v.right}if(p){w.style.paddingRight=d.Em(p)}var n=d.Element("span",{id:"MathJax-Color-"+this.spanID+d.idPostfix,isMathJax:true,style:{display:"inline-block",backgroundColor:y.mathbackground,width:d.Em(o),height:d.Em(x),verticalAlign:d.Em(k),marginLeft:d.Em(u),marginRight:d.Em(s)}});d.setBorders(n,t);if(A.width){n.style.width=A.width;n.style.marginRight="-"+A.width}if(d.msieInlineBlockAlignBug){n.style.position="relative";n.style.width=n.style.height=0;n.style.verticalAlign=n.style.marginLeft=n.style.marginRight="";n.style.border=n.style.padding="";if(t&&d.msieBorderWidthBug){x+=t.top+t.bottom;o+=t.left+t.right}n.style.width=d.Em(r+z);d.placeBox(d.addElement(n,"span",{noAdjust:true,isMathJax:true,style:{display:"inline-block",position:"absolute",overflow:"hidden",background:(y.mathbackground||"transparent"),width:d.Em(o),height:d.Em(x)}}),u,A.h+z);d.setBorders(n.firstChild,t)}w.parentNode.insertBefore(n,w);if(d.msieColorPositionBug){w.style.position="relative"}return n}return null},HTMLremoveColor:function(){var k=document.getElementById("MathJax-Color-"+this.spanID+d.idPostfix);if(k){k.parentNode.removeChild(k)}},HTMLhandleSpace:function(o){if(this.useMMLspacing){if(this.type!=="mo"){return}var m=this.getValues("scriptlevel","lspace","rspace");if(m.scriptlevel<=0||this.hasValue("lspace")||this.hasValue("rspace")){var l=this.HTMLgetMu(o);m.lspace=Math.max(0,d.length2em(m.lspace,l));m.rspace=Math.max(0,d.length2em(m.rspace,l));var k=this,n=this.Parent();while(n&&n.isEmbellished()&&n.Core()===k){k=n;n=n.Parent();o=k.HTMLspanElement()}if(m.lspace){o.style.paddingLeft=d.Em(m.lspace)}if(m.rspace){o.style.paddingRight=d.Em(m.rspace)}}}else{var p=this.texSpacing();if(p!==""){this.HTMLgetScale();p=d.length2em(p,this.scale)/(o.scale||1)*this.mscale;if(o.style.paddingLeft){p+=d.unEm(o.style.paddingLeft)}o.style.paddingLeft=d.Em(p)}}},HTMLgetScale:function(){if(this.scale){return this.scale*this.mscale}var m=1,k=this.getValues("scriptlevel","fontsize");k.mathsize=(this.isToken?this:this.Parent()).Get("mathsize");if(this.style){var l=this.HTMLspanElement();if(l.style.fontSize!=""){k.fontsize=l.style.fontSize}}if(k.fontsize&&!this.mathsize){k.mathsize=k.fontsize}if(k.scriptlevel!==0){if(k.scriptlevel>2){k.scriptlevel=2}m=Math.pow(this.Get("scriptsizemultiplier"),k.scriptlevel);k.scriptminsize=d.length2em(this.Get("scriptminsize"));if(m2){l.scriptlevel=2}k=Math.sqrt(Math.pow(l.scriptsizemultiplier,l.scriptlevel))}return k},HTMLgetVariant:function(){var k=this.getValues("mathvariant","fontfamily","fontweight","fontstyle");k.hasVariant=this.Get("mathvariant",true);if(!k.hasVariant){k.family=k.fontfamily;k.weight=k.fontweight;k.style=k.fontstyle}if(this.style){var m=this.HTMLspanElement();if(!k.family&&m.style.fontFamily){k.family=m.style.fontFamily}if(!k.weight&&m.style.fontWeight){k.weight=m.style.fontWeight}if(!k.style&&m.style.fontStyle){k.style=m.style.fontStyle}}if(k.weight&&k.weight.match(/^\d+$/)){k.weight=(parseInt(k.weight)>600?"bold":"normal")}var l=k.mathvariant;if(this.variantForm){l="-"+d.fontInUse+"-variant"}if(k.family&&!k.hasVariant){if(!k.weight&&k.mathvariant.match(/bold/)){k.weight="bold"}if(!k.style&&k.mathvariant.match(/italic/)){k.style="italic"}return{FONTS:[],fonts:[],noRemap:true,defaultFont:{family:k.family,style:k.style,weight:k.weight}}}if(k.weight==="bold"){l={normal:g.VARIANT.BOLD,italic:g.VARIANT.BOLDITALIC,fraktur:g.VARIANT.BOLDFRAKTUR,script:g.VARIANT.BOLDSCRIPT,"sans-serif":g.VARIANT.BOLDSANSSERIF,"sans-serif-italic":g.VARIANT.SANSSERIFBOLDITALIC}[l]||l}else{if(k.weight==="normal"){l={bold:g.VARIANT.normal,"bold-italic":g.VARIANT.ITALIC,"bold-fraktur":g.VARIANT.FRAKTUR,"bold-script":g.VARIANT.SCRIPT,"bold-sans-serif":g.VARIANT.SANSSERIF,"sans-serif-bold-italic":g.VARIANT.SANSSERIFITALIC}[l]||l}}if(k.style==="italic"){l={normal:g.VARIANT.ITALIC,bold:g.VARIANT.BOLDITALIC,"sans-serif":g.VARIANT.SANSSERIFITALIC,"bold-sans-serif":g.VARIANT.SANSSERIFBOLDITALIC}[l]||l}else{if(k.style==="normal"){l={italic:g.VARIANT.NORMAL,"bold-italic":g.VARIANT.BOLD,"sans-serif-italic":g.VARIANT.SANSSERIF,"sans-serif-bold-italic":g.VARIANT.BOLDSANSSERIF}[l]||l}}if(!(l in d.FONTDATA.VARIANT)){l="normal"}return d.FONTDATA.VARIANT[l]},HTMLdrawBBox:function(k){var m=k.bbox;var l=d.Element("span",{style:{"font-size":k.style.fontSize,display:"inline-block",opacity:0.25,"margin-left":d.Em(-m.w)}},[["span",{style:{height:d.Em(m.h),width:d.Em(m.w),"background-color":"red",display:"inline-block"}}],["span",{style:{height:d.Em(m.d),width:d.Em(m.w),"margin-left":d.Em(-m.w),"vertical-align":d.Em(-m.d),"background-color":"green",display:"inline-block"}}]]);if(k.nextSibling){k.parentNode.insertBefore(l,k.nextSibling)}else{k.parentNode.appendChild(l)}}},{HTMLautoload:function(){var k=d.autoloadDir+"/"+this.type+".js";b.RestartAfter(h.Require(k))},HTMLautoloadFile:function(k){var l=d.autoloadDir+"/"+k+".js";b.RestartAfter(h.Require(l))},HTMLstretchH:function(l,k){this.HTMLremoveColor();return this.toHTML(l,k)},HTMLstretchV:function(l,k,m){this.HTMLremoveColor();return this.toHTML(l,k,m)}});g.chars.Augment({toHTML:function(n,m,l,o){var r=this.data.join("").replace(/[\u2061-\u2064]/g,"");if(l){r=l(r,o)}if(m.fontInherit){var q=Math.floor(d.config.scale/d.scale+0.5)+"%";d.addElement(n,"span",{style:{"font-size":q}},[r]);if(m.bold){n.lastChild.style.fontWeight="bold"}if(m.italic){n.lastChild.style.fontStyle="italic"}n.bbox=null;var p=d.getHD(n),k=d.getW(n);n.bbox={h:p.h,d:p.d,w:k,lw:0,rw:k,exactW:true}}else{this.HTMLhandleVariant(n,m,r)}}});g.entity.Augment({toHTML:function(n,m,l,o){var r=this.toString().replace(/[\u2061-\u2064]/g,"");if(l){r=l(r,o)}if(m.fontInherit){var q=Math.floor(d.config.scale/d.scale+0.5)+"%";d.addElement(n,"span",{style:{"font-size":q}},[r]);if(m.bold){n.lastChild.style.fontWeight="bold"}if(m.italic){n.lastChild.style.fontStyle="italic"}delete n.bbox;var p=d.getHD(n),k=d.getW(n);n.bbox={h:p.h,d:p.d,w:k,lw:0,rw:k,exactW:true}}else{this.HTMLhandleVariant(n,m,r)}}});g.mi.Augment({toHTML:function(o){o=this.HTMLhandleSize(this.HTMLcreateSpan(o));o.bbox=null;var n=this.HTMLgetVariant();for(var l=0,k=this.data.length;lp.w&&q.length===1&&!n.noIC){p.ic=p.rw-p.w;d.createBlank(o,p.ic/this.mscale);p.w=p.rw}this.HTMLhandleSpace(o);this.HTMLhandleColor(o);this.HTMLhandleDir(o);return o}});g.mn.Augment({toHTML:function(o){o=this.HTMLhandleSize(this.HTMLcreateSpan(o));o.bbox=null;var n=this.HTMLgetVariant();for(var l=0,k=this.data.length;lv.bbox.w){v.bbox.ic=v.bbox.rw-v.bbox.w;d.createBlank(v,v.bbox.ic/this.mscale);v.bbox.w=v.bbox.rw}}this.HTMLhandleSpace(v);this.HTMLhandleColor(v);this.HTMLhandleDir(v);return v},HTMLcanStretch:function(o){if(!this.Get("stretchy")){return false}var p=this.data.join("");if(p.length>1){return false}var m=this.CoreParent();if(m&&m.isa(g.munderover)&&this.CoreText(m.data[m.base]).length===1){var n=m.data[m.over],l=m.data[m.under];if(n&&this===n.CoreMO()&&m.Get("accent")){p=d.FONTDATA.REMAPACCENT[p]||p}else{if(l&&this===l.CoreMO()&&m.Get("accentunder")){p=d.FONTDATA.REMAPACCENTUNDER[p]||p}}}p=d.FONTDATA.DELIMITERS[p.charCodeAt(0)];var k=(p&&p.dir===o.substr(0,1));this.forceStretch=(k&&(this.Get("minsize",true)||this.Get("maxsize",true)));return k},HTMLstretchV:function(m,n,o){this.HTMLremoveColor();var r=this.getValues("symmetric","maxsize","minsize");var p=this.HTMLspanElement(),s=this.HTMLgetMu(p),q;var l=this.HTMLgetScale(),k=d.TeX.axis_height*l;if(r.symmetric){q=2*Math.max(n-k,o+k)}else{q=n+o}r.maxsize=d.length2em(r.maxsize,s,p.bbox.h+p.bbox.d);r.minsize=d.length2em(r.minsize,s,p.bbox.h+p.bbox.d);q=Math.max(r.minsize,Math.min(r.maxsize,q));if(q!=r.minsize){q=[Math.max(q*d.TeX.delimiterfactor/1000,q-d.TeX.delimitershortfall),q]}p=this.HTMLcreateSpan(m);d.createDelimiter(p,this.data.join("").charCodeAt(0),q,l);if(r.symmetric){q=(p.bbox.h+p.bbox.d)/2+k}else{q=(p.bbox.h+p.bbox.d)*n/(n+o)}d.positionDelimiter(p,q);this.HTMLhandleSpace(p);this.HTMLhandleColor(p);return p},HTMLstretchH:function(o,k){this.HTMLremoveColor();var m=this.getValues("maxsize","minsize","mathvariant","fontweight");if((m.fontweight==="bold"||parseInt(m.fontweight)>=600)&&!this.Get("mathvariant",true)){m.mathvariant=g.VARIANT.BOLD}var n=this.HTMLspanElement(),l=this.HTMLgetMu(n),p=n.scale;m.maxsize=d.length2em(m.maxsize,l,n.bbox.w);m.minsize=d.length2em(m.minsize,l,n.bbox.w);k=Math.max(m.minsize,Math.min(m.maxsize,k));n=this.HTMLcreateSpan(o);d.createDelimiter(n,this.data.join("").charCodeAt(0),k,p,m.mathvariant);this.HTMLhandleSpace(n);this.HTMLhandleColor(n);return n}});g.mtext.Augment({toHTML:function(o){o=this.HTMLhandleSize(this.HTMLcreateSpan(o));var n=this.HTMLgetVariant();if(d.config.mtextFontInherit||this.Parent().type==="merror"){var p=this.Get("mathvariant");if(p==="monospace"){o.className+=" MJX-monospace"}else{if(p.match(/sans-serif/)){o.className+=" MJX-sans-serif"}}n={bold:n.bold,italic:n.italic,fontInherit:true}}for(var l=0,k=this.data.length;ld.linebreakWidth)||this.hasNewline()},HTMLstretchH:function(m,k){this.HTMLremoveColor();var l=this.HTMLspanElement();this.data[this.core].HTMLstretchH(l,k);this.HTMLcomputeBBox(l,true);this.HTMLhandleColor(l);return l},HTMLstretchV:function(m,l,n){this.HTMLremoveColor();var k=this.HTMLspanElement();this.data[this.core].HTMLstretchV(k,l,n);this.HTMLcomputeBBox(k,true);this.HTMLhandleColor(k);return k}});g.mstyle.Augment({toHTML:function(l,k,m){l=this.HTMLcreateSpan(l);if(this.data[0]!=null){var n=this.data[0].toHTML(l);if(m!=null){this.data[0].HTMLstretchV(l,k,m)}else{if(k!=null){this.data[0].HTMLstretchH(l,k)}}l.bbox=n.bbox}this.HTMLhandleSpace(l);this.HTMLhandleColor(l);return l},HTMLstretchH:g.mbase.HTMLstretchH,HTMLstretchV:g.mbase.HTMLstretchV});g.mfrac.Augment({toHTML:function(D){D=this.HTMLcreateSpan(D);var m=d.createStack(D);var r=d.createBox(m),o=d.createBox(m);d.MeasureSpans([this.HTMLboxChild(0,r),this.HTMLboxChild(1,o)]);var k=this.getValues("displaystyle","linethickness","numalign","denomalign","bevelled");var I=this.HTMLgetScale(),C=k.displaystyle;var G=d.TeX.axis_height*I;if(k.bevelled){var F=(C?0.4:0.15);var s=Math.max(r.bbox.h+r.bbox.d,o.bbox.h+o.bbox.d)+2*F;var E=d.createBox(m);d.createDelimiter(E,47,s);d.placeBox(r,0,(r.bbox.d-r.bbox.h)/2+G+F);d.placeBox(E,r.bbox.w-F/2,(E.bbox.d-E.bbox.h)/2+G);d.placeBox(o,r.bbox.w+E.bbox.w-F,(o.bbox.d-o.bbox.h)/2+G-F)}else{var l=Math.max(r.bbox.w,o.bbox.w);var y=d.thickness2em(k.linethickness,this.scale)*this.mscale,A,z,x,w;var B=d.TeX.min_rule_thickness/this.em;if(C){x=d.TeX.num1;w=d.TeX.denom1}else{x=(y===0?d.TeX.num3:d.TeX.num2);w=d.TeX.denom2}x*=I;w*=I;if(y===0){A=Math.max((C?7:3)*d.TeX.rule_thickness,2*B);z=(x-r.bbox.d)-(o.bbox.h-w);if(zy){l=((s.bbox.h+s.bbox.d)-(y-A))/2}var B=d.FONTDATA.DELIMITERS[d.FONTDATA.RULECHAR];if(!B||oK){K=r[M].bbox.w}if(!N[M]&&K>n){n=K}}}if(F==null&&H!=null){n=H}else{if(n==-d.BIGDIMEN){n=K}}for(M=K=0,I=this.data.length;MK){K=w.bbox.w}}}var E=d.TeX.rule_thickness*this.mscale,G=d.FONTDATA.TeX_factor;var v,s,A,z,u,C,J,O=0;p=r[this.base]||{bbox:this.HTMLzeroBBox()};if(p.bbox.ic){O=1.3*p.bbox.ic+0.05}for(M=0,I=this.data.length;MK){L.bbox.skew+=(K-w.bbox.w-v)/2}}}else{A=d.TeX.big_op_spacing1*P*G;z=d.TeX.big_op_spacing3*P*G;J=Math.max(A,z-Math.max(0,w.bbox.d))}J=Math.max(J,1.5/this.em);v+=O/2;s=p.bbox.h+w.bbox.d+J;w.bbox.h+=u}else{if(M==this.under){if(B){J=3*E*P*G;u=0}else{A=d.TeX.big_op_spacing2*P*G;z=d.TeX.big_op_spacing4*P*G;J=Math.max(A,z-w.bbox.h)}J=Math.max(J,1.5/this.em);v-=O/2;s=-(p.bbox.d+w.bbox.h+J);w.bbox.d+=u}}d.placeBox(w,v,s)}}this.HTMLhandleSpace(L);this.HTMLhandleColor(L);return L},HTMLstretchH:g.mbase.HTMLstretchH,HTMLstretchV:g.mbase.HTMLstretchV});g.msubsup.Augment({toHTML:function(K,I,C){K=this.HTMLcreateSpan(K);var N=this.HTMLgetScale(),H=this.HTMLgetMu(K);var w=d.createStack(K),l,n=[];var o=d.createBox(w);if(this.data[this.base]){n.push(this.data[this.base].toHTML(o));if(C!=null){this.data[this.base].HTMLstretchV(o,I,C)}else{if(I!=null){this.data[this.base].HTMLstretchH(o,I)}}}else{o.bbox=this.HTMLzeroBBox()}var L=d.TeX.x_height*N,B=d.TeX.scriptspace*N*0.75;var k,x;if(this.HTMLnotEmpty(this.data[this.sup])){k=d.createBox(w);n.push(this.data[this.sup].toHTML(k))}if(this.HTMLnotEmpty(this.data[this.sub])){x=d.createBox(w);n.push(this.data[this.sub].toHTML(x))}d.MeasureSpans(n);if(k){k.bbox.w+=B;k.bbox.rw=Math.max(k.bbox.w,k.bbox.rw)}if(x){x.bbox.w+=B;x.bbox.rw=Math.max(x.bbox.w,x.bbox.rw)}d.placeBox(o,0,0);var m=N;if(k){m=this.data[this.sup].HTMLgetScale()}else{if(x){m=this.data[this.sub].HTMLgetScale()}}var F=d.TeX.sup_drop*m,E=d.TeX.sub_drop*m;var z=o.bbox.h-F,y=o.bbox.d+E,M=0,G;if(o.bbox.ic){o.bbox.w-=o.bbox.ic;M=1.3*o.bbox.ic+0.05}if(this.data[this.base]&&I==null&&C==null&&(this.data[this.base].type==="mi"||this.data[this.base].type==="mo")){if(this.data[this.base].data.join("").length===1&&n[0].scale===1&&!this.data[this.base].Get("largeop")){z=y=0}}var J=this.getValues("subscriptshift","superscriptshift");J.subscriptshift=(J.subscriptshift===""?0:d.length2em(J.subscriptshift,H));J.superscriptshift=(J.superscriptshift===""?0:d.length2em(J.superscriptshift,H));if(!k){if(x){y=Math.max(y,d.TeX.sub1*N,x.bbox.h-(4/5)*L,J.subscriptshift);d.placeBox(x,o.bbox.w,-y,x.bbox)}}else{if(!x){l=this.getValues("displaystyle","texprimestyle");G=d.TeX[(l.displaystyle?"sup1":(l.texprimestyle?"sup3":"sup2"))];z=Math.max(z,G*N,k.bbox.d+(1/4)*L,J.superscriptshift);d.placeBox(k,o.bbox.w+M,z,k.bbox)}else{y=Math.max(y,d.TeX.sub2*N);var A=d.TeX.rule_thickness*N;if((z-k.bbox.d)-(x.bbox.h-y)<3*A){y=3*A-z+k.bbox.d+x.bbox.h;F=(4/5)*L-(z-k.bbox.d);if(F>0){z+=F;y-=F}}d.placeBox(k,o.bbox.w+M,Math.max(z,J.superscriptshift));d.placeBox(x,o.bbox.w,-Math.max(y,J.subscriptshift))}}this.HTMLhandleSpace(K);this.HTMLhandleColor(K);return K},HTMLstretchH:g.mbase.HTMLstretchH,HTMLstretchV:g.mbase.HTMLstretchV});g.mmultiscripts.Augment({toHTML:g.mbase.HTMLautoload});g.mtable.Augment({toHTML:g.mbase.HTMLautoload});g["annotation-xml"].Augment({toHTML:g.mbase.HTMLautoload});g.annotation.Augment({toHTML:function(k){return this.HTMLcreateSpan(k)}});g.math.Augment({toHTML:function(B,y,q){var r,t,u,n,k=B;if(!q||q===d.PHASE.I){var z=d.addElement(B,"nobr",{isMathJax:true});B=this.HTMLcreateSpan(z);var l=this.Get("alttext");if(l&&!B.getAttribute("aria-label")){B.setAttribute("aria-label",l)}if(!B.getAttribute("role")){B.setAttribute("role","math")}r=d.createStack(B);t=d.createBox(r);r.style.fontSize=z.parentNode.style.fontSize;z.parentNode.style.fontSize="";if(this.data[0]!=null){g.mbase.prototype.displayAlign=b.config.displayAlign;g.mbase.prototype.displayIndent=b.config.displayIndent;if(String(b.config.displayIndent).match(/^0($|[a-z%])/i)){g.mbase.prototype.displayIndent="0"}u=this.data[0].toHTML(t);u.bbox.exactW=false}}else{B=B.firstChild.firstChild;if(this.href){B=B.firstChild}r=B.firstChild;if(r.style.position!=="relative"){r=r.nextSibling}t=r.firstChild;u=t.firstChild}n=((!q||q===d.PHASE.II)?d.Measured(u,t):u);if(!q||q===d.PHASE.III){d.placeBox(t,0,0);B.style.width=d.Em(Math.max(0,Math.round(n.bbox.w*this.em)+0.25)/d.outerEm);B.style.display="inline-block";var x=1/d.em,D=d.em/d.outerEm;d.em/=D;B.bbox.h*=D;B.bbox.d*=D;B.bbox.w*=D;B.bbox.lw*=D;B.bbox.rw*=D;if(B.bbox.H){B.bbox.H*=D}if(B.bbox.D){B.bbox.D*=D}if(n&&n.bbox.width!=null){B.style.minWidth=(n.bbox.minWidth||B.style.width);B.style.width=n.bbox.width;t.style.width=r.style.width=k.style.width="100%"}var A=this.HTMLhandleColor(B);if(n){d.createRule(B,(n.bbox.h+x)*D,(n.bbox.d+x)*D,0)}if(!this.isMultiline&&this.Get("display")==="block"&&B.bbox.width==null){var m=this.getValues("indentalignfirst","indentshiftfirst","indentalign","indentshift");if(m.indentalignfirst!==g.INDENTALIGN.INDENTALIGN){m.indentalign=m.indentalignfirst}if(m.indentalign===g.INDENTALIGN.AUTO){m.indentalign=this.displayAlign}if(m.indentshiftfirst!==g.INDENTSHIFT.INDENTSHIFT){m.indentshift=m.indentshiftfirst}if(m.indentshift==="auto"){m.indentshift="0"}var C=d.length2em(m.indentshift,1,d.scale*d.cwidth);if(this.displayIndent!=="0"){var v=d.length2em(this.displayIndent,1,d.scale*d.cwidth);C+=(m.indentalign===g.INDENTALIGN.RIGHT?-v:v)}y.style.textAlign=m.indentalign;if(C){b.Insert(B.style,({left:{marginLeft:d.Em(C)},right:{marginRight:d.Em(-C)},center:{marginLeft:d.Em(C),marginRight:d.Em(-C)}})[m.indentalign]);if(A){var s=parseFloat(A.style.marginLeft||"0")+C,o=parseFloat(A.style.marginRight||"0")-C;A.style.marginLeft=d.Em(s);A.style.marginRight=d.Em(o+(m.indentalign==="right"?B.bbox.w+C-B.bbox.w:0));if(d.msieColorBug&&m.indentalign==="right"){if(parseFloat(A.style.marginLeft)>0){var w=MathJax.HTML.addElement(A.parentNode,"span");w.style.marginLeft=d.Em(o+Math.min(0,B.bbox.w+C));A.nextSibling.style.marginRight="0em"}A.nextSibling.style.marginLeft="0em";A.style.marginRight=A.style.marginLeft="0em"}}}}}return B},HTMLspanElement:g.mbase.prototype.HTMLspanElement});g.TeXAtom.Augment({toHTML:function(o,m,q){o=this.HTMLcreateSpan(o);if(this.data[0]!=null){if(this.texClass===g.TEXCLASS.VCENTER){var k=d.createStack(o);var p=d.createBox(k);var r=this.data[0].toHTML(p);if(q!=null){d.Remeasured(this.data[0].HTMLstretchV(p,m,q),p)}else{if(m!=null){d.Remeasured(this.data[0].HTMLstretchH(p,m),p)}else{d.Measured(r,p)}}var l=d.TeX.axis_height*this.HTMLgetScale();d.placeBox(p,0,l-(p.bbox.h+p.bbox.d)/2+p.bbox.d)}else{var n=this.data[0].toHTML(o,m,q);if(q!=null){n=this.data[0].HTMLstretchV(p,m,q)}else{if(m!=null){n=this.data[0].HTMLstretchH(p,m)}}o.bbox=n.bbox}}this.HTMLhandleSpace(o);this.HTMLhandleColor(o);return o},HTMLstretchH:g.mbase.HTMLstretchH,HTMLstretchV:g.mbase.HTMLstretchV});b.Register.StartupHook("onLoad",function(){setTimeout(MathJax.Callback(["loadComplete",d,"jax.js"]),0)})});b.Register.StartupHook("End Config",function(){b.Browser.Select({MSIE:function(k){var o=(document.documentMode||0);var n=k.versionAtLeast("7.0");var m=k.versionAtLeast("8.0")&&o>7;var l=(document.compatMode==="BackCompat");if(o<9){d.config.styles[".MathJax .MathJax_HitBox"]["background-color"]="white";d.config.styles[".MathJax .MathJax_HitBox"].opacity=0;d.config.styles[".MathJax .MathJax_HitBox"].filter="alpha(opacity=0)"}d.Augment({PaddingWidthBug:true,msieAccentBug:true,msieColorBug:(o<8),msieColorPositionBug:true,msieRelativeWidthBug:l,msieDisappearingBug:(o>=8),msieMarginScaleBug:(o<8),msiePaddingWidthBug:true,msieBorderWidthBug:l,msieFrameSizeBug:(o<=8),msieInlineBlockAlignBug:(!m||l),msiePlaceBoxBug:(m&&!l),msieClipRectBug:!m,msieNegativeSpaceBug:l,msieRuleBug:(o<7),cloneNodeBug:(m&&k.version==="8.0"),msieItalicWidthBug:true,initialSkipBug:(o<8),msieNegativeBBoxBug:(o>=8),msieIE6:!n,msieItalicWidthBug:true,FontFaceBug:(o<9),msieFontCSSBug:k.isIE9,allowWebFonts:(o>=9?"woff":"eot")})},Firefox:function(l){var m=false;if(l.versionAtLeast("3.5")){var k=String(document.location).replace(/[^\/]*$/,"");if(document.location.protocol!=="file:"||b.config.root.match(/^https?:\/\//)||(b.config.root+"/").substr(0,k.length)===k){m="otf"}}d.Augment({ffVerticalAlignBug:!l.versionAtLeast("20.0"),AccentBug:true,allowWebFonts:m,ffFontOptimizationBug:true})},Safari:function(p){var n=p.versionAtLeast("3.0");var m=p.versionAtLeast("3.1");var k=navigator.appVersion.match(/ Safari\/\d/)&&navigator.appVersion.match(/ Version\/\d/)&&navigator.vendor.match(/Apple/);var l=(navigator.appVersion.match(/ Android (\d+)\.(\d+)/));var q=(m&&p.isMobile&&((navigator.platform.match(/iPad|iPod|iPhone/)&&!p.versionAtLeast("5.0"))||(l!=null&&(l[1]<2||(l[1]==2&&l[2]<2)))));d.Augment({config:{styles:{".MathJax img, .MathJax nobr, .MathJax a":{"max-width":"5000em","max-height":"5000em"}}},Em:((p.webkit||0)>=538?d.EmRounded:d.Em),rfuzz:0.011,AccentBug:true,AdjustSurd:true,negativeBBoxes:true,safariNegativeSpaceBug:true,safariVerticalAlignBug:!m,safariTextNodeBug:!n,forceReflow:true,FontFaceBug:true,allowWebFonts:(m&&!q?"otf":false)});if(k){d.Augment({webFontDefault:(p.isMobile?"sans-serif":"serif")})}if(p.isPC){d.Augment({adjustAvailableFonts:d.removeSTIXfonts,checkWebFontsTwice:true})}if(q){var o=b.config["HTML-CSS"];if(o){o.availableFonts=[];o.preferredFont=null}else{b.config["HTML-CSS"]={availableFonts:[],preferredFont:null}}}},Chrome:function(k){d.Augment({Em:d.EmRounded,cloneNodeBug:true,rfuzz:-0.02,AccentBug:true,AdjustSurd:true,FontFaceBug:k.versionAtLeast("32.0"),negativeBBoxes:true,safariNegativeSpaceBug:true,safariWebFontSerif:[""],forceReflow:true,allowWebFonts:(k.versionAtLeast("4.0")?"otf":"svg")})},Opera:function(k){k.isMini=(navigator.appVersion.match("Opera Mini")!=null);d.config.styles[".MathJax .merror"]["vertical-align"]=null;d.config.styles[".MathJax span"]["z-index"]=0;d.Augment({operaHeightBug:true,operaVerticalAlignBug:true,operaFontSizeBug:k.versionAtLeast("10.61"),initialSkipBug:true,FontFaceBug:true,PaddingWidthBug:true,allowWebFonts:(k.versionAtLeast("10.0")&&!k.isMini?"otf":false),adjustAvailableFonts:d.removeSTIXfonts})},Konqueror:function(k){d.Augment({konquerorVerticalAlignBug:true})}})});MathJax.Hub.Register.StartupHook("End Cookie",function(){if(b.config.menuSettings.zoom!=="None"){h.Require("[MathJax]/extensions/MathZoom.js")}})})(MathJax.Ajax,MathJax.Hub,MathJax.OutputJax["HTML-CSS"]); diff --git a/modules/TestPage.html b/modules/TestPage.html index df87584..7f3c17f 100644 --- a/modules/TestPage.html +++ b/modules/TestPage.html @@ -1,40 +1,39 @@
-