aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby <[email protected]>2023-03-10 02:22:21 -0500
committerBobby <[email protected]>2023-03-10 02:22:21 -0500
commit4d1ee5092ae59b2e40d5d7d22e78a5abce3e3159 (patch)
tree0ec72cb9fb8edb93582ed2319db15a4be5b677e3
parente4694056d80874bb5087edd98a5c87d057778813 (diff)
downloadthatcomputerscientist-4d1ee5092ae59b2e40d5d7d22e78a5abce3e3159.tar.xz
thatcomputerscientist-4d1ee5092ae59b2e40d5d7d22e78a5abce3e3159.zip
Update mathjax config to support IE6
-rw-r--r--templates/blog/partials/mathjax.html30
1 files changed, 25 insertions, 5 deletions
diff --git a/templates/blog/partials/mathjax.html b/templates/blog/partials/mathjax.html
index 59bf879b..3697590d 100644
--- a/templates/blog/partials/mathjax.html
+++ b/templates/blog/partials/mathjax.html
@@ -1,8 +1,30 @@
{% load static %}
-<script type="text/javascript" src="{% static 'js/MathJax/MathJax.js' %}?config=TeX-AMS-MML_HTMLorMML"></script>
+<script
+ type="text/javascript"
+ src="{% static 'js/MathJax/MathJax.js' %}?config=default"
+></script>
<script type="text/x-mathjax-config">
+ var BROWSER = MathJax.Hub.Browser;
+
+ var canUseMML = (BROWSER.isFirefox && BROWSER.versionAtLeast("1.5")) ||
+ (BROWSER.isMSIE && BROWSER.hasMathPlayer) ||
+ (BROWSER.isSafari && BROWSER.versionAtLeast("5.0")) ||
+ (BROWSER.isOpera && BROWSER.versionAtLeast("9.52") &&
+ !BROWSER.versionAtLeast("14.0"));
+
+ var CONFIG = MathJax.Hub.CombineConfig("default",{
+ prefer: {
+ MSIE:"HTML", Firefox:"HTML", Opera:"HTML", Chrome:"CommonHTML", Safari:"HTML",
+ other:"HTML"
+ }
+ });
+
+ var jax = CONFIG.prefer[BROWSER] || CONFIG.prefer.other;
+ if (jax === "HTML") jax = "HTML-CSS"; else if (jax === "MML") jax = "NativeMML";
+ if (jax === "NativeMML" && !canUseMML) jax = CONFIG.prefer.other;
+
MathJax.Hub.Config({
- jax: ["input/TeX","output/HTML-CSS", "output/NativeMML", "output/PreviewHTML"],
+ jax: ["input/TeX","output/"+jax],
extensions: ["tex2jax.js"],
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
@@ -15,8 +37,6 @@
},
"fast-preview": { disabled: true },
showProcessingMessages: false,
- showMathMenu: false,
- showMathMenuMSIE: false,
"HTML-CSS": { imageFont: null }
});
-</script> \ No newline at end of file
+</script>