From 55c59f0ef598ac36714c66a356e36c4e010cd2cf Mon Sep 17 00:00:00 2001
From: Peter Krautzberger
Date: Wed, 26 Nov 2014 21:41:20 +0100
Subject: [PATCH 1/7] created mml3-mml2 extension for #921
---
unpacked/extensions/MathML/mml3-mml2.js | 128 ++++++++++++++++++++++++
1 file changed, 128 insertions(+)
create mode 100644 unpacked/extensions/MathML/mml3-mml2.js
diff --git a/unpacked/extensions/MathML/mml3-mml2.js b/unpacked/extensions/MathML/mml3-mml2.js
new file mode 100644
index 000000000..ec2c41e38
--- /dev/null
+++ b/unpacked/extensions/MathML/mml3-mml2.js
@@ -0,0 +1,128 @@
+/*************************************************************
+ *
+ * MathJax/extensions/MathML/mml3-mml2.js
+ *
+ * This file implements an XSLT transform to convert some MathML 3
+ * constructs to constructs MathJax can render. The transform is
+ * performed in a pre-filter for the MathML input jax, so that the
+ * Show Math As menu will still show the Original MathML correctly,
+ * but the transformed MathML can be obtained from the regular MathML menu.
+ *
+ * To load it, include
+ *
+ * MathML: {
+ * extensions: ["mml3-mml2.js"]
+ * }
+ *
+ * in your configuration.
+ *
+ * A portion of this file is taken from ctop.xsl 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-2014 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"] = {
+ version: "2.4.0"
+};
+
+MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () {
+
+ var MATHML = MathJax.InputJax.MathML,
+ PARSE = MATHML.Parse.prototype;
+
+ MATHML.prefilterHooks.Add(function (data) {
+ if (!MATHML.ctopXSLT) return;
+
+ // Parse the 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 ctop stylesheet.
+ var newdoc = MATHML.ctopXSLT.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 taken from ctop.xsl and mml3mml2.xsl
+ * (https://web-xslt.googlecode.com/svn/trunk/ctop/)
+ * which is Copyright (c) David Carlisle 2001, 2002, 2008, 2009, 2013.
+ * 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 ctopStylesheet = ' ) ( ] [ } { ) ( ] [ } { \ ) ( } { > < ∋ ∈ top right ;color: ; background-color: ;
0 decimalpoint
decimalpoint . decimalpoint * 0.1em 0.15em 0.2em 0.15em 0 / \ ) ( : = ) ';
+ /*
+ * End of ctop.xsl amd mml3mml2.csl material.
+ */
+
+ var ctop;
+ if (window.XSLTProcessor) {
+ // standard method: just use an XSLTProcessor and parse the stylesheet
+ if (!MATHML.ParseXML) {MATHML.ParseXML = MATHML.createParser()}
+ MATHML.ctopXSLT = new XSLTProcessor();
+ MATHML.ctopXSLT.importStylesheet(MATHML.ParseXML(ctopStylesheet));
+ } 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
+ ctop = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
+ ctop.loadXML(ctopStylesheet);
+ var xslt = new ActiveXObject("Msxml2.XSLTemplate");
+ xslt.stylesheet = ctop;
+ MATHML.ctopXSLT = {
+ ctop: xslt.createProcessor(),
+ transformToDocument: function(doc) {
+ this.ctop.input = doc;
+ this.ctop.transform();
+ return this.ctop.output;
+ }
+ }
+ } else {
+ // For Internet Explorer <= 8, use transformNode
+ ctop = MATHML.createMSParser();
+ ctop.async = false;
+ ctop.loadXML(ctopStylesheet);
+ MATHML.ctopXSLT = {
+ ctop: ctop,
+ transformToDocument: function(doc) {
+ return doc.documentElement.transformNode(this.ctop);
+ }
+ }
+ }
+ } else {
+ // No XSLT support. Do not change the content.
+ MATHML.ctopXSLT = null;
+ }
+
+ MathJax.Hub.Startup.signal.Post("MathML content-mathml Ready");
+});
+
+MathJax.Ajax.loadComplete("[MathJax]/extensions/MathML/mml3-mml2.js");
From 37fb13fb6fba744d4aaac9073b018d72b2ab17d0 Mon Sep 17 00:00:00 2001
From: Peter Krautzberger
Date: Wed, 26 Nov 2014 21:48:34 +0100
Subject: [PATCH 2/7] fix references to content-mathml extension
---
unpacked/extensions/MathML/mml3-mml2.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/unpacked/extensions/MathML/mml3-mml2.js b/unpacked/extensions/MathML/mml3-mml2.js
index ec2c41e38..ea79d94a3 100644
--- a/unpacked/extensions/MathML/mml3-mml2.js
+++ b/unpacked/extensions/MathML/mml3-mml2.js
@@ -41,7 +41,7 @@
*/
-MathJax.Extension["MathML/content-mathml"] = {
+MathJax.Extension["MathML/mml3-mml2"] = {
version: "2.4.0"
};
@@ -122,7 +122,7 @@ MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () {
MATHML.ctopXSLT = null;
}
- MathJax.Hub.Startup.signal.Post("MathML content-mathml Ready");
+ MathJax.Hub.Startup.signal.Post("MathML mml3-mml2 Ready");
});
MathJax.Ajax.loadComplete("[MathJax]/extensions/MathML/mml3-mml2.js");
From 1807d55d22c1b6d9fed37e22212261e0fcc6c9a6 Mon Sep 17 00:00:00 2001
From: Peter Krautzberger
Date: Thu, 27 Nov 2014 15:29:27 +0100
Subject: [PATCH 3/7] switch hascolspan to false() as in
http://www.w3.org/Math/draft-spec/doctop.js
---
unpacked/extensions/MathML/mml3-mml2.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/unpacked/extensions/MathML/mml3-mml2.js b/unpacked/extensions/MathML/mml3-mml2.js
index ea79d94a3..e5fa3acfe 100644
--- a/unpacked/extensions/MathML/mml3-mml2.js
+++ b/unpacked/extensions/MathML/mml3-mml2.js
@@ -78,7 +78,7 @@ MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () {
* 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 ctopStylesheet = ' ) ( ] [ } { ) ( ] [ } { \ ) ( } { > < ∋ ∈ top right ;color: ; background-color: ;
0 decimalpoint
decimalpoint . decimalpoint * 0.1em 0.15em 0.2em 0.15em 0 / \ ) ( : = ) ';
+ var ctopStylesheet = ' ) ( ] [ } { ) ( ] [ } { \ ) ( } { > < ∋ ∈ top right ;color: ; background-color: ;
0 decimalpoint
decimalpoint . decimalpoint * 0.1em 0.15em 0.2em 0.15em 0 / \ ) ( : = ) ';
/*
* End of ctop.xsl amd mml3mml2.csl material.
*/
From 905ce5ffa8cf9b440fba1e15db22428f3b0aca6c Mon Sep 17 00:00:00 2001
From: Peter Krautzberger
Date: Fri, 5 Dec 2014 23:35:22 +0100
Subject: [PATCH 4/7] renaming extension; pull in David Carlisle's new and
improves xsl
---
unpacked/extensions/MathML/mml3-mml2.js | 128 ------------------------
unpacked/extensions/MathML/mml3.js | 128 ++++++++++++++++++++++++
2 files changed, 128 insertions(+), 128 deletions(-)
delete mode 100644 unpacked/extensions/MathML/mml3-mml2.js
create mode 100644 unpacked/extensions/MathML/mml3.js
diff --git a/unpacked/extensions/MathML/mml3-mml2.js b/unpacked/extensions/MathML/mml3-mml2.js
deleted file mode 100644
index e5fa3acfe..000000000
--- a/unpacked/extensions/MathML/mml3-mml2.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/*************************************************************
- *
- * MathJax/extensions/MathML/mml3-mml2.js
- *
- * This file implements an XSLT transform to convert some MathML 3
- * constructs to constructs MathJax can render. The transform is
- * performed in a pre-filter for the MathML input jax, so that the
- * Show Math As menu will still show the Original MathML correctly,
- * but the transformed MathML can be obtained from the regular MathML menu.
- *
- * To load it, include
- *
- * MathML: {
- * extensions: ["mml3-mml2.js"]
- * }
- *
- * in your configuration.
- *
- * A portion of this file is taken from ctop.xsl 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-2014 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/mml3-mml2"] = {
- version: "2.4.0"
-};
-
-MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () {
-
- var MATHML = MathJax.InputJax.MathML,
- PARSE = MATHML.Parse.prototype;
-
- MATHML.prefilterHooks.Add(function (data) {
- if (!MATHML.ctopXSLT) return;
-
- // Parse the 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 ctop stylesheet.
- var newdoc = MATHML.ctopXSLT.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 taken from ctop.xsl and mml3mml2.xsl
- * (https://web-xslt.googlecode.com/svn/trunk/ctop/)
- * which is Copyright (c) David Carlisle 2001, 2002, 2008, 2009, 2013.
- * 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 ctopStylesheet = ' ) ( ] [ } { ) ( ] [ } { \ ) ( } { > < ∋ ∈ top right ;color: ; background-color: ;
0 decimalpoint
decimalpoint . decimalpoint * 0.1em 0.15em 0.2em 0.15em 0 / \ ) ( : = ) ';
- /*
- * End of ctop.xsl amd mml3mml2.csl material.
- */
-
- var ctop;
- if (window.XSLTProcessor) {
- // standard method: just use an XSLTProcessor and parse the stylesheet
- if (!MATHML.ParseXML) {MATHML.ParseXML = MATHML.createParser()}
- MATHML.ctopXSLT = new XSLTProcessor();
- MATHML.ctopXSLT.importStylesheet(MATHML.ParseXML(ctopStylesheet));
- } 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
- ctop = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
- ctop.loadXML(ctopStylesheet);
- var xslt = new ActiveXObject("Msxml2.XSLTemplate");
- xslt.stylesheet = ctop;
- MATHML.ctopXSLT = {
- ctop: xslt.createProcessor(),
- transformToDocument: function(doc) {
- this.ctop.input = doc;
- this.ctop.transform();
- return this.ctop.output;
- }
- }
- } else {
- // For Internet Explorer <= 8, use transformNode
- ctop = MATHML.createMSParser();
- ctop.async = false;
- ctop.loadXML(ctopStylesheet);
- MATHML.ctopXSLT = {
- ctop: ctop,
- transformToDocument: function(doc) {
- return doc.documentElement.transformNode(this.ctop);
- }
- }
- }
- } else {
- // No XSLT support. Do not change the content.
- MATHML.ctopXSLT = null;
- }
-
- MathJax.Hub.Startup.signal.Post("MathML mml3-mml2 Ready");
-});
-
-MathJax.Ajax.loadComplete("[MathJax]/extensions/MathML/mml3-mml2.js");
diff --git a/unpacked/extensions/MathML/mml3.js b/unpacked/extensions/MathML/mml3.js
new file mode 100644
index 000000000..541406b93
--- /dev/null
+++ b/unpacked/extensions/MathML/mml3.js
@@ -0,0 +1,128 @@
+/*************************************************************
+ *
+ * MathJax/extensions/MathML/mml3.js
+ *
+ * This file implements an XSLT transform to convert some MathML 3
+ * constructs to constructs MathJax can render. The transform is
+ * performed in a pre-filter for the MathML input jax, so that the
+ * Show Math As menu will still show the Original MathML correctly,
+ * but the transformed MathML can be obtained from the regular MathML menu.
+ *
+ * To load it, include
+ *
+ * MathML: {
+ * extensions: ["mml3.js"]
+ * }
+ *
+ * in your configuration.
+ *
+ * A portion of this file is taken from ctop.xsl which is
+ * Copyright (c) David Carlisle 2001, 2002, 2008, 2009, 2013, 2014
+ * 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-2014 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/mml3"] = {
+ version: "2.4.0"
+};
+
+MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () {
+
+ var MATHML = MathJax.InputJax.MathML,
+ PARSE = MATHML.Parse.prototype;
+
+ MATHML.prefilterHooks.Add(function (data) {
+ if (!MATHML.ctopXSLT) return;
+
+ // Parse the 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 ctop stylesheet.
+ var newdoc = MATHML.ctopXSLT.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 taken from mml3mj.xsl
+ * (https://web-xslt.googlecode.com/svn/trunk/ctop/)
+ * which is Copyright (c) David Carlisle 2001, 2002, 2008, 2009, 2013, 2014.
+ * 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 ctopStylesheet = ') ( ] [ } { ) ( ] [ } { \ ) ( } { > < ∋ ∈ top right ;color: ; background-color: ;
0 decimalpoint
decimalpoint . decimalpoint * 0.1em 0.15em 0.2em 0.15em 0 / \ ) ( : = top ) ';
+ /*
+ * End of mml3mj.xsl material.
+ */
+
+ var ctop;
+ if (window.XSLTProcessor) {
+ // standard method: just use an XSLTProcessor and parse the stylesheet
+ if (!MATHML.ParseXML) {MATHML.ParseXML = MATHML.createParser()}
+ MATHML.ctopXSLT = new XSLTProcessor();
+ MATHML.ctopXSLT.importStylesheet(MATHML.ParseXML(ctopStylesheet));
+ } 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
+ ctop = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
+ ctop.loadXML(ctopStylesheet);
+ var xslt = new ActiveXObject("Msxml2.XSLTemplate");
+ xslt.stylesheet = ctop;
+ MATHML.ctopXSLT = {
+ ctop: xslt.createProcessor(),
+ transformToDocument: function(doc) {
+ this.ctop.input = doc;
+ this.ctop.transform();
+ return this.ctop.output;
+ }
+ }
+ } else {
+ // For Internet Explorer <= 8, use transformNode
+ ctop = MATHML.createMSParser();
+ ctop.async = false;
+ ctop.loadXML(ctopStylesheet);
+ MATHML.ctopXSLT = {
+ ctop: ctop,
+ transformToDocument: function(doc) {
+ return doc.documentElement.transformNode(this.ctop);
+ }
+ }
+ }
+ } else {
+ // No XSLT support. Do not change the content.
+ MATHML.ctopXSLT = null;
+ }
+
+ MathJax.Hub.Startup.signal.Post("MathML mml3 Ready");
+});
+
+MathJax.Ajax.loadComplete("[MathJax]/extensions/MathML/mml3.js");
From ac50815d5804514bc150c365bfe641d8bc7044b7 Mon Sep 17 00:00:00 2001
From: Peter Krautzberger
Date: Tue, 16 Dec 2014 10:39:17 +0100
Subject: [PATCH 5/7] update stylesheet to pull in latest fixes from David
Carlisle
---
unpacked/extensions/MathML/mml3.js | 56 +++++++++++++++---------------
1 file changed, 28 insertions(+), 28 deletions(-)
diff --git a/unpacked/extensions/MathML/mml3.js b/unpacked/extensions/MathML/mml3.js
index 541406b93..27dd8a4db 100644
--- a/unpacked/extensions/MathML/mml3.js
+++ b/unpacked/extensions/MathML/mml3.js
@@ -3,7 +3,7 @@
* MathJax/extensions/MathML/mml3.js
*
* This file implements an XSLT transform to convert some MathML 3
- * constructs to constructs MathJax can render. The transform is
+ * constructs to constructs MathJax can bit render. The transform is
* performed in a pre-filter for the MathML input jax, so that the
* Show Math As menu will still show the Original MathML correctly,
* but the transformed MathML can be obtained from the regular MathML menu.
@@ -16,8 +16,8 @@
*
* in your configuration.
*
- * A portion of this file is taken from ctop.xsl which is
- * Copyright (c) David Carlisle 2001, 2002, 2008, 2009, 2013, 2014
+ * A portion of this file is taken from mml3mj.xsl which is
+ * Copyright (c) David Carlisle 2008-2014
* 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.
@@ -51,14 +51,14 @@ MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () {
PARSE = MATHML.Parse.prototype;
MATHML.prefilterHooks.Add(function (data) {
- if (!MATHML.ctopXSLT) return;
+ if (!MATHML.mml3XSLT) return;
// Parse the 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 ctop stylesheet.
- var newdoc = MATHML.ctopXSLT.transformToDocument(doc);
+ // 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.
@@ -73,56 +73,56 @@ MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () {
/*
* The following is taken from mml3mj.xsl
- * (https://web-xslt.googlecode.com/svn/trunk/ctop/)
- * which is Copyright (c) David Carlisle 2001, 2002, 2008, 2009, 2013, 2014.
+ * (https://web-xslt.googlecode.com/svn/trunk/ctop/mml3mj.xsl)
+ * which is Copyright (c) David Carlisle 2008-2014.
* 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 ctopStylesheet = ') ( ] [ } { ) ( ] [ } { \ ) ( } { > < ∋ ∈ top right ;color: ; background-color: ;
0 decimalpoint
decimalpoint . decimalpoint * 0.1em 0.15em 0.2em 0.15em 0 / \ ) ( : = top ) ';
+ var mml3Stylesheet = ' this[\'node-set\'] = function (x) { return x; } ) ( ] [ } { ) ( ] [ } { \ ) ( } { > < ∋ ∈ top right ;color: ; background-color: ;
0 decimalpoint
decimalpoint . decimalpoint * 0.1em 0.15em 0.2em 0.15em 0 / \ ) ( / \ : = top ) ';
/*
* End of mml3mj.xsl material.
*/
- var ctop;
+ var mml3;
if (window.XSLTProcessor) {
// standard method: just use an XSLTProcessor and parse the stylesheet
if (!MATHML.ParseXML) {MATHML.ParseXML = MATHML.createParser()}
- MATHML.ctopXSLT = new XSLTProcessor();
- MATHML.ctopXSLT.importStylesheet(MATHML.ParseXML(ctopStylesheet));
+ 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
- ctop = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
- ctop.loadXML(ctopStylesheet);
+ mml3 = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
+ mml3.loadXML(mml3Stylesheet);
var xslt = new ActiveXObject("Msxml2.XSLTemplate");
- xslt.stylesheet = ctop;
- MATHML.ctopXSLT = {
- ctop: xslt.createProcessor(),
+ xslt.stylesheet = mml3;
+ MATHML.mml3XSLT = {
+ mml3: xslt.createProcessor(),
transformToDocument: function(doc) {
- this.ctop.input = doc;
- this.ctop.transform();
- return this.ctop.output;
+ this.mml3.input = doc;
+ this.mml3.transform();
+ return this.mml3.output;
}
}
} else {
// For Internet Explorer <= 8, use transformNode
- ctop = MATHML.createMSParser();
- ctop.async = false;
- ctop.loadXML(ctopStylesheet);
- MATHML.ctopXSLT = {
- ctop: ctop,
+ mml3 = MATHML.createMSParser();
+ mml3.async = false;
+ mml3.loadXML(mml3Stylesheet);
+ MATHML.mml3XSLT = {
+ mml3: mml3,
transformToDocument: function(doc) {
- return doc.documentElement.transformNode(this.ctop);
+ return doc.documentElement.transformNode(this.mml3);
}
}
}
} else {
// No XSLT support. Do not change the content.
- MATHML.ctopXSLT = null;
+ MATHML.mml3XSLT = null;
}
- MathJax.Hub.Startup.signal.Post("MathML mml3 Ready");
+ MathJax.Hub.Startup.signal.Post("MathML mml3.js Ready");
});
MathJax.Ajax.loadComplete("[MathJax]/extensions/MathML/mml3.js");
From f785418e8a62e63271046038c79ee1c28d51031a Mon Sep 17 00:00:00 2001
From: Peter Krautzberger
Date: Wed, 17 Dec 2014 09:19:01 +0100
Subject: [PATCH 6/7] pull in update from ctop/mml3.xslt that adds left/\right
mlongdiv notation
---
unpacked/extensions/MathML/mml3.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/unpacked/extensions/MathML/mml3.js b/unpacked/extensions/MathML/mml3.js
index 27dd8a4db..d1514b8a7 100644
--- a/unpacked/extensions/MathML/mml3.js
+++ b/unpacked/extensions/MathML/mml3.js
@@ -78,7 +78,7 @@ MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () {
* 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 mml3Stylesheet = ' this[\'node-set\'] = function (x) { return x; } ) ( ] [ } { ) ( ] [ } { \ ) ( } { > < ∋ ∈ top right ;color: ; background-color: ;
0 decimalpoint
decimalpoint . decimalpoint * 0.1em 0.15em 0.2em 0.15em 0 / \ ) ( / \ : = top ) ';
+ var mml3Stylesheet = ' this[\'node-set\'] = function (x) { return x; } ) ( ] [ } { ) ( ] [ } { \ ) ( } { > < ∋ ∈ top right ;color: ; background-color: ;
0 decimalpoint
decimalpoint . decimalpoint * 0.1em 0.15em 0.2em 0.15em 0 ) ( / \\ : = top ) ';
/*
* End of mml3mj.xsl material.
*/
From 12d8eef96b59dff257b49fe8ca3ebf72f651ca94 Mon Sep 17 00:00:00 2001
From: Peter Krautzberger
Date: Mon, 29 Dec 2014 16:14:34 +0100
Subject: [PATCH 7/7] import fixes for RTL+elementary math; source:
https://code.google.com/p/web-xslt/
---
unpacked/extensions/MathML/mml3.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/unpacked/extensions/MathML/mml3.js b/unpacked/extensions/MathML/mml3.js
index d1514b8a7..a887b2e7a 100644
--- a/unpacked/extensions/MathML/mml3.js
+++ b/unpacked/extensions/MathML/mml3.js
@@ -78,7 +78,7 @@ MathJax.Hub.Register.StartupHook("MathML Jax Ready",function () {
* 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 mml3Stylesheet = ' this[\'node-set\'] = function (x) { return x; } ) ( ] [ } { ) ( ] [ } { \ ) ( } { > < ∋ ∈ top right ;color: ; background-color: ;
0 decimalpoint
decimalpoint . decimalpoint * 0.1em 0.15em 0.2em 0.15em 0 ) ( / \\ : = top ) ';
+ var mml3Stylesheet = ' this[\'node-set\'] = function (x) { return x; } ) ( ] [ } { ) ( ] [ } { \ ) ( } { > < ∋ ∈ top right
0 decimalpoint
decimalpoint . decimalpoint * 0.1em 0.15em 0.2em 0.15em 0 ) ( / \\ : = top ) ';
/*
* End of mml3mj.xsl material.
*/