Socialify

Folder ..

Viewing mathjax.html
57 lines (53 loc) • 1.4 KB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{% load static %}
<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/" + jax],
  extensions: ["tex2jax.js"],
  TeX: {
    extensions: [
      "AMSmath.js",
      "AMSsymbols.js",
      "noErrors.js",
      "noUndefined.js",
    ],
  },
  "HTML-CSS": { availableFonts: ["TeX"] },
  tex2jax: {
    inlineMath: [
      ["$", "$"],
      ["\\(", "\\)"],
    ],
    displayMath: [
      ["$$", "$$"],
      ["\\[", "\\]"],
    ],
    processEscapes: true,
  },
  "fast-preview": { disabled: true },
  showProcessingMessages: false,
  "HTML-CSS": { imageFont: null },
});
</script>