From 11011d7c373c655830053b155eeaf632c2658ac7 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 24 Jun 2021 17:50:34 +1000 Subject: Updated. - added mathjax (freed) - added rss.py - updated publish.el - etc. --- js/mathjax/extensions/MathML/content-mathml.js | 1745 ++++++++++++++++++++++++ js/mathjax/extensions/MathML/mml3.js | 786 +++++++++++ 2 files changed, 2531 insertions(+) create mode 100644 js/mathjax/extensions/MathML/content-mathml.js create mode 100644 js/mathjax/extensions/MathML/mml3.js (limited to 'js/mathjax/extensions/MathML') diff --git a/js/mathjax/extensions/MathML/content-mathml.js b/js/mathjax/extensions/MathML/content-mathml.js new file mode 100644 index 0000000..250ce43 --- /dev/null +++ b/js/mathjax/extensions/MathML/content-mathml.js @@ -0,0 +1,1745 @@ +// @license magnet:?xt=urn:btih:8e4f440f4c65981c5bf93c76d35135ba5064d8b7dn=apache-2.0.txt Apache-2.0 +/* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ + +/************************************************************* + * + * MathJax/extensions/MathML/content-mathml.js + * + * This file provides methods to convert Content-MathML to + * Presentation MathML for processing by MathJax. The transform is + * performed in a DOM filter for the MathML input jax, so that the + * Show Math As menu will still show the Original MathML as Content MathML, + * but the Presentation MathML can be obtained from the main MathML menu. + * + * To load it, include + * + * MathML: { + * extensions: ["content-mathml.js"] + * } + * + * in your configuration. + * + * A portion of this file is taken from ctop.js which is + * Copyright (c) David Carlisle 2001, 2002, 2008, 2009, 2013, + * and is used by permission of David Carlisle, who has agreed to allow us + * to release it under the Apache2 license (see below). That portion is + * indicated via comments. + * + * The remainder falls under the copyright that follows. + * --------------------------------------------------------------------- + * + * Copyright (c) 2013-2020 The MathJax Consortium + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +MathJax.Extension["MathML/content-mathml"] = (function(HUB) { + /* + * Content MathML to Presentation MathML conversion + * + * based on David Carlisle's ctop.js - https://web-xslt.googlecode.com/svn/trunk/ctop/ctop.js + * + */ + + + var isMSIE = HUB.Browser.isMSIE; + + if (isMSIE) { + try {document.namespaces.add("m","http://www.w3.org/1998/Math/MathML")} catch (err) {} + } + + var CONFIG = HUB.CombineConfig("MathML.content-mathml",{ + // render `a+(-b)` as `a-b`? + collapsePlusMinus: true, + + /* mathvariant to use with corresponding type attribute */ + cistyles: { + vector: 'bold-italic', + matrix: 'bold-upright' + }, + + /* Symbol names to translate to characters + */ + symbols: { + gamma: '\u03B3' + } + + }); + + var CToP = { + version: "2.7.9", + settings: CONFIG, + + /* Transform the given elements from Content MathML to Presentation MathML and replace the original elements + */ + transformElements: function(elements) { + for (var i = 0, l = elements.length; i= 0) element = CToP.cloneNode(element,true); // removes namespaces + var mathNode = CToP.cloneNode(element); + for (var j = 0, l = element.childNodes.length; jn instead of -n + // + element.appendChild(document.createTextNode(textContent.substr(1))); + var mrow = CToP.createElement('mrow'); + CToP.appendToken(mrow,'mo','\u2212'); + mrow.appendChild(element); + element = mrow; + } else { + element.appendChild(document.createTextNode(textContent)); + } + parentNode.appendChild(element); + return element; + }, + + /* Transform a Content MathML node to Presentation MathML node(s), and attach it to the parent + */ + applyTransform: function(parentNode,contentMMLNode,precedence) { + if (!contentMMLNode) { + var merror = CToP.createElement('merror'); + CToP.appendToken(merror,'mtext','Missing child node'); + parentNode.appendChild(merror); + return; + } + var nodeName = contentMMLNode.nodeName.replace(/.*:/,''); + if (contentMMLNode.nodeType === 1) { + if (CToP.tokens[nodeName]) { + CToP.tokens[nodeName](parentNode,contentMMLNode,precedence); + } else if (contentMMLNode.childNodes.length === 0) { + var mml = CToP.MML[nodeName]; + if (mml && mml.isa && mml.isa(CToP.mbase)) { + parentNode.appendChild(CToP.cloneNode(contentMMLNode)); + } else { + CToP.appendToken(parentNode,'mi',nodeName); + } + } else { + var clonedChild = CToP.cloneNode(contentMMLNode); + parentNode.appendChild(clonedChild); + for (var j = 0, l = contentMMLNode.childNodes.length; j1) { + CToP.applyTransform(mrow,args[0],tokenPrecedence); + } + CToP.appendToken(mrow,'mo',name); + if (args.length>0) { + var z = args[(args.length === 1)?0:1]; + CToP.applyTransform(mrow,z,tokenPrecedence); + } + if (needsBrackets) { + CToP.appendToken(mrow,'mo',')'); + } + parentNode.appendChild(mrow); + } + }, + + /* Transform an infix operator + * + * (function factory) + */ + infix: function(name,tokenPrecedence) { + return function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + var mrow = CToP.createElement('mrow'); + var needsBrackets = precedence>tokenPrecedence; + if (needsBrackets) { + CToP.appendToken(mrow,'mo','('); + } + for (var j = 0, l = args.length; j0) { + CToP.appendToken(mrow,'mo',name); + } + CToP.applyTransform(mrow,args[j],tokenPrecedence); + } + if (needsBrackets) { + CToP.appendToken(mrow,'mo',')'); + } + parentNode.appendChild(mrow); + } + }, + + /* Transform an iterated operation, e.g. summation + * + * (function factory + */ + iteration: function(name,limitSymbol) { + return function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + var mrow = CToP.createElement('mrow'); + var mo = CToP.createElement('mo'); + CToP.setTextContent(mo,name); + var munderover = CToP.createElement('munderover'); + munderover.appendChild(mo); + var mrow1 = CToP.createElement('mrow'); + var i, j, num_qualifiers, num_bvars, children, bvar, num_children, num_args; + for (i = 0, num_qualifiers = qualifiers.length; i',1), + lt: CToP.transforms.infix('<',1), + geq: CToP.transforms.infix('\u2265',1), + leq: CToP.transforms.infix('\u2264',1), + equivalent: CToP.transforms.infix('\u2261',1), + approx: CToP.transforms.infix('\u2248',1), + subset: CToP.transforms.infix('\u2286',2), + prsubset: CToP.transforms.infix('\u2282',2), + cartesianproduct: CToP.transforms.infix('\u00D7',2), + "cartesian_product": CToP.transforms.infix('\u00D7',2), + vectorproduct: CToP.transforms.infix('\u00D7',2), + scalarproduct: CToP.transforms.infix('.',2), + outerproduct: CToP.transforms.infix('\u2297',2), + sum: CToP.transforms.iteration('\u2211','='), + product: CToP.transforms.iteration('\u220F','='), + forall: CToP.transforms.bind('\u2200','.',','), + exists: CToP.transforms.bind('\u2203','.',','), + lambda: CToP.transforms.bind('\u03BB','.',','), + limit: CToP.transforms.iteration('lim','\u2192'), + sdev: CToP.transforms.fn('\u03c3'), + determinant: CToP.transforms.fn('det'), + max: CToP.transforms.minmax('max'), + min: CToP.transforms.minmax('min'), + real: CToP.transforms.fn('\u211b'), + imaginary: CToP.transforms.fn('\u2111'), + set: CToP.transforms.set('{','}'), + list: CToP.transforms.set('(',')'), + + exp: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + var msup = CToP.createElement('msup'); + CToP.appendToken(msup,'mi','e'); + CToP.applyTransform(msup,args[0],0); + parentNode.appendChild(msup); + }, + + union: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + if (bvars.length) { + CToP.transforms.iteration('\u22C3','=')(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence); + } else { + CToP.transforms.infix('\u222A',2)(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence); + } + }, + + intersect: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + if (bvars.length) { + CToP.transforms.iteration('\u22C2','=')(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence); + } else { + var mrow = CToP.createElement('mrow'); + var needsBrackets = precedence>2; + if (needsBrackets) { + CToP.appendToken(mrow,'mo','('); + } + for (var j = 0, l = args.length; j0) { + CToP.appendToken(mrow,'mo','\u2229'); + if (args[j].nodeName === 'apply') { + var child = CToP.getChildren(args[j])[0]; + argBrackets = child.nodeName === 'union'; + } + } + if (argBrackets) { + CToP.appendToken(mrow,'mo','('); + } + CToP.applyTransform(mrow,args[j],2); + if (argBrackets) { + CToP.appendToken(mrow,'mo',')'); + } + } + if (needsBrackets) { + CToP.appendToken(mrow,'mo',')'); + } + parentNode.appendChild(mrow); + } + }, + + floor: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + var mrow = CToP.createElement('mrow'); + CToP.appendToken(mrow,'mo','\u230a'); + CToP.applyTransform(mrow,args[0],0); + CToP.appendToken(mrow,'mo','\u230b'); + parentNode.appendChild(mrow); + }, + + conjugate: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + var mover = CToP.createElement('mover'); + CToP.applyTransform(mover,args[0],0); + CToP.appendToken(mover,'mo','\u00af'); + parentNode.appendChild(mover); + }, + + abs: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + var mrow = CToP.createElement('mrow'); + CToP.appendToken(mrow,'mo','|'); + CToP.applyTransform(mrow,args[0],0); + CToP.appendToken(mrow,'mo','|'); + parentNode.appendChild(mrow); + }, + + and: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + if (bvars.length || qualifiers.length) { + CToP.transforms.iteration('\u22c0','=')(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,4); + } else { + CToP.transforms.infix('\u2227',2)(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence); + } + }, + + or: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + if (bvars.length || qualifiers.length) { + CToP.transforms.iteration('\u22c1','=')(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,4); + } else { + CToP.transforms.infix('\u2228',2)(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence); + } + }, + + xor: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + if (bvars.length || qualifiers.length) { + CToP.transforms.iteration('xor','=')(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,4); + } else { + CToP.transforms.infix('xor',2)(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence); + } + }, + + card: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + var mrow = CToP.createElement('mrow'); + CToP.appendToken(mrow,'mo','|'); + CToP.applyTransform(mrow,args[0],0); + CToP.appendToken(mrow,'mo','|'); + parentNode.appendChild(mrow); + }, + + mean: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + if (args.length === 1) { + var mover = CToP.createElement('mover'); + CToP.applyTransform(mover,args[0],0); + CToP.appendToken(mover,'mo','\u00af'); + parentNode.appendChild(mover); + } else { + parentNode.appendChild(CToP.createmfenced(args,'\u27e8','\u27e9')); + } + }, + + moment: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + var degree, momentabout, children, i, j, l; + + for (i = 0, l = qualifiers.length; i1) { + argrow.appendChild(CToP.createmfenced(args,'(',')')); + } else { + CToP.applyTransform(argrow,args[0],0); + } + if (degree) { + var msup = CToP.createElement('msup'); + msup.appendChild(argrow); + children = CToP.getChildren(degree); + for (j = 0, l = children.length; j3; + if (needsBrackets) { + CToP.appendToken(mrow,'mo','('); + } + for (var j = 0, l = args.length; j0) { + CToP.appendToken(mrow,'mo',(args[j].nodeName === 'cn') ? "\u00D7" :"\u2062"); + } + CToP.applyTransform(mrow,args[j],3); + } + if (needsBrackets) { + CToP.appendToken(mrow,'mo',')'); + } + parentNode.appendChild(mrow); + }, + + plus: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + var mrow = CToP.createElement('mrow'); + var needsBrackets = precedence>2; + if (needsBrackets) { + CToP.appendToken(mrow,'mo','('); + } + for (var j = 0, l = args.length; j0) { + var n; + if (CToP.settings.collapsePlusMinus) { + if (arg.nodeName === 'cn' && !(children.length) && (n = Number(CToP.getTextContent(arg))) <0) { + CToP.appendToken(mrow,'mo','\u2212'); + CToP.appendToken(mrow,'mn', -n); + } else if (arg.nodeName === 'apply' && children.length === 2 && children[0].nodeName === 'minus') { + CToP.appendToken(mrow,'mo','\u2212'); + CToP.applyTransform(mrow,children[1],2); + } else if (arg.nodeName === 'apply' && children.length>2 && children[0].nodeName === 'times' && children[1].nodeName === 'cn' && (n = Number(CToP.getTextContent(children[1]))) < 0) { + CToP.appendToken(mrow,'mo','\u2212'); + children[1].textContent = -n; // OK to change MathML since it is being discarded afterward + CToP.applyTransform(mrow,arg,2); + } else{ + CToP.appendToken(mrow,'mo','+'); + CToP.applyTransform(mrow,arg,2); + } + } else { + CToP.appendToken(mrow,'mo','+'); + CToP.applyTransform(mrow,arg,2); + } + } else { + CToP.applyTransform(mrow,arg,2); + } + } + if (needsBrackets) { + CToP.appendToken(mrow,'mo',')'); + } + parentNode.appendChild(mrow); + }, + + transpose: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + var msup = CToP.createElement('msup'); + CToP.applyTransform(msup,args[0],precedence); + CToP.appendToken(msup,'mi','T'); + parentNode.appendChild(msup); + }, + + power: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + var msup = CToP.createElement('msup'); + CToP.applyTransform(msup,args[0],3); + CToP.applyTransform(msup,args[1],precedence); + parentNode.appendChild(msup); + }, + + selector: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + var msub = CToP.createElement('msub'); + var mrow = args ? args[0]: CToP.createElement('mrow'); + CToP.applyTransform(msub,mrow,0); + var mrow2 = CToP.createElement('mrow'); + for (var i = 1, l = args.length; i1) { + CToP.applyTransform(mrow,args[1],0); + } + } + CToP.appendToken(mrow,'mo','\u230B'); + parentNode.appendChild(mrow); + }, + + factorial: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + var mrow = CToP.createElement('mrow'); + CToP.applyTransform(mrow,args[0],4); + CToP.appendToken(mrow,'mo','!'); + parentNode.appendChild(mrow); + }, + + root: function(parentNode,contentMMLNode,firstArg,args,bvars,qualifiers,precedence) { + var mr; + if (firstArg.nodeName === 'root' && (qualifiers.length === 0 || (qualifiers[0].nodeName === 'degree' && CToP.getTextContent(qualifiers[0]) === '2'))) { + mr = CToP.createElement('msqrt'); + for (var i = 0, l = args.length; i1) { + var msup = CToP.createElement('msup'); + CToP.applyTransform(msup,bvar,0); + CToP.appendToken(msup,'mn',degree); + bottomrow.appendChild(msup); + } else { + CToP.applyTransform(bottomrow,bvar,0); + } + } + for (i = 0, l = lambdaSequence.length; i0) { + if (hadFirst) { + CToP.appendToken(degreeRow,'mo','+'); + } + CToP.appendToken(degreeRow,'mn',degree); + } + } + + if (args.length) { + differendNode = args[0]; + } + + for (i = 0, l = bvars.length; i but use MATHML.Parse's preProcessMath to apply the normal preprocessing. + if (!MATHML.ParseXML) {MATHML.ParseXML = MATHML.createParser()} + var doc = MATHML.ParseXML(PARSE.preProcessMath(data.math)); + + // Now transform the using the mml3 stylesheet. + var newdoc = MATHML.mml3XSLT.transformToDocument(doc); + + if ((typeof newdoc) === "string") { + // Internet Explorer returns a string, so just use it. + data.math = newdoc; + } else if (window.XMLSerializer) { + // Serialize the again. We could directly provide the DOM content + // but other prefilterHooks may assume data.math is still a string. + var serializer = new XMLSerializer(); + data.math = serializer.serializeToString(newdoc.documentElement, doc); + } + }); + + /* + * The following is derived from mml3mj.xsl + * (https://github.com/davidcarlisle/web-xslt/blob/master/ctop/mml3mj.xsl) + * which is Copyright (c) David Carlisle 2008-2015. + * It is used by permission of David Carlisle, who has agreed to allow it to + * be released under the Apache License, Version 2.0. + */ + var BROWSER = MathJax.Hub.Browser; + var exslt = ''; + if (BROWSER.isEdge || BROWSER.isMSIE) { + exslt = 'urn:schemas-microsoft-com:xslt' + } else { + exslt = 'http://exslt.org/common'; + } + var mml3Stylesheet = + '' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + '' + + ' ' + + ' ltr' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + '' + + ' )' + + '' + + ' (' + + '' + + '' + + ' ]' + + '' + + '' + + ' [' + + '' + + '' + + ' }' + + '' + + '' + + ' {' + + '' + + '' + + ' ' + + '' + + ' )' + + '' + + ' (' + + '' + + '' + + ' ]' + + '' + + '' + + ' [' + + '' + + '' + + ' }' + + '' + + '' + + ' {' + + '' + + ' ' + + ' ' + + ' \' + + ' ' + + ' ' + + '' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ')' + + '(' + + '}' + + '{' + + '>' + + '<' + + '' + + '' + + '' + + ' top right' + + '' + + '' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' 0' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' decimalpoint' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' decimalpoint' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' .' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' decimalpoint' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' *' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' 0.1em' + + ' 0.15em' + + ' 0.2em' + + ' ' + + ' 0.15em' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' 0' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' )' + + ' ' + + ' (' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' /' + + ' ' + + ' \' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' :' + + ' ' + + ' =' + + ' ' + + ' ' + + ' ' + + ' ' + + ' top' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' )' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + ' ' + + ''; + + /* + * End of mml3mj.xsl material. + */ + + var mml3; + if (window.XSLTProcessor) { + // standard method: just use an XSLTProcessor and parse the stylesheet + if (!MATHML.ParseXML) {MATHML.ParseXML = MATHML.createParser()} + MATHML.mml3XSLT = new XSLTProcessor(); + MATHML.mml3XSLT.importStylesheet(MATHML.ParseXML(mml3Stylesheet)); + } else if (MathJax.Hub.Browser.isMSIE) { + // nonstandard methods for Internet Explorer + if (MathJax.Hub.Browser.versionAtLeast("9.0") || (document.documentMode||0) >= 9) { + // For Internet Explorer >= 9, use createProcessor + mml3 = new ActiveXObject("Msxml2.FreeThreadedDOMDocument"); + mml3.loadXML(mml3Stylesheet); + var xslt = new ActiveXObject("Msxml2.XSLTemplate"); + xslt.stylesheet = mml3; + MATHML.mml3XSLT = { + mml3: xslt.createProcessor(), + transformToDocument: function(doc) { + this.mml3.input = doc; + this.mml3.transform(); + return this.mml3.output; + } + } + } else { + // For Internet Explorer <= 8, use transformNode + mml3 = MATHML.createMSParser(); + mml3.async = false; + mml3.loadXML(mml3Stylesheet); + MATHML.mml3XSLT = { + mml3: mml3, + transformToDocument: function(doc) { + return doc.documentElement.transformNode(this.mml3); + } + } + } + } else { + // No XSLT support. Do not change the content. + MATHML.mml3XSLT = null; + } + + // Tweak CSS to avoid some browsers rearranging HTML output + MathJax.Ajax.Styles({ + ".MathJax .mi, .MathJax .mo, .MathJax .mn, .MathJax .mtext": { + direction: "ltr", + display: "inline-block" + }, + ".MathJax .ms, .MathJax .mspace, .MathJax .mglyph": { + direction: "ltr", + display: "inline-block" + } + }); + + MathJax.Hub.Startup.signal.Post("MathML mml3.js Ready"); +}); + +MathJax.Ajax.loadComplete("[MathJax]/extensions/MathML/mml3.js"); +// @license-end -- cgit v1.2.3