|
30 | 30 | <meta property="og:image:height" content="200" />
|
31 | 31 |
|
32 | 32 | <!-- KaTeX -->
|
33 |
| - <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" |
34 |
| - integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous" /> |
35 |
| - <script src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.js" |
36 |
| - integrity="sha384-9Nhn55MVVN0/4OFx7EE5kpFBPsEMZxKTCnA+4fqDmg12eCTqGi6+BB2LjY8brQxJ" crossorigin="anonymous"></script> |
| 33 | + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.css" |
| 34 | + integrity="sha384-zh0CIslj+VczCZtlzBcjt5ppRcsAmDnRem7ESsYwWwg3m/OaJ2l4x7YBZl9Kxxib" crossorigin="anonymous"/> |
| 35 | + <script src="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.js" |
| 36 | + integrity="sha384-Rma6DA2IPUwhNxmrB/7S3Tno0YY7sFu9WSYMCuulLhIqYSGZ2gKCJWIqhBWqMQfh" crossorigin="anonymous"></script> |
37 | 37 | <!-- KaTeX auto-render extention: https://katex.org/docs/autorender.html -->
|
38 |
| - <script src=" https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" |
39 |
| - integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"></script> |
| 38 | + <script src=" https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" |
| 39 | + integrity="sha384-hCXGrW6PitJEwbkoStFjeJxv+fSOOQKOPbJxSfM6G5sWZjAyWhXiTIIAmQqnlLlh" crossorigin="anonymous"></script> |
| 40 | + <!-- KaTeX copy-tex extention: https://github.com/KaTeX/KaTeX/tree/main/contrib/copy-tex --> |
| 41 | + <script src=" https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/copy-tex.min.js" |
| 42 | + integrity="sha384-HORx6nWi8j5/mYA+y57/9/CZc5z8HnEw4WUZWy5yOn9ToKBv1l58vJaufFAn9Zzi" crossorigin="anonymous"></script> |
40 | 43 | <script>
|
41 | 44 | var macros = {
|
42 |
| - "\\P": "\\mathbb{P}" |
43 |
| - }, delimiters = [ |
44 |
| - { left: "$$", right: "$$", display: true}, // Technically, this does not work. See below. |
45 |
| - { left: "\\[", right: "\\]", display: true}, |
46 |
| - { left: "$", right: "$", display: false}, |
47 |
| - { left: "\\(", right: "\\)", display: false} |
48 |
| - ]; |
| 45 | + "\\PP": "\\mathbb{P}", "\\AA": "\\mathbb{A}", "\\NN": "\\mathbb{N}", "\\ZZ": "\\mathbb{Z}", |
| 46 | + "\\kk": "\\mathbb{k}", "\\QQ": "\\mathbb{Q}", "\\RR": "\\mathbb{R}", "\\CC": "\\mathbb{C}", |
| 47 | + }; |
49 | 48 |
|
50 |
| - document.addEventListener("DOMContentLoaded", function() { |
51 |
| - renderMathInElement(document.body, { delimiters: delimiters, macros: macros }); |
| 49 | + function renderKaTeX() { |
| 50 | + renderMathInElement(document.body, { macros: macros }); |
| 51 | + // KaTeX auto-renders $$..$$, \\(..\\), \\[..\\], and equation, align, gather, and CD envs, but not $..$! |
| 52 | + renderMathInElement(document.body, { macros: macros, delimiters: [{ left: "$", right: "$", display: false }] }); |
| 53 | + } |
52 | 54 |
|
53 |
| - // Currently GitHub pages overrides math-engine: mathjax in _config, hence $$..$$ are converted to to scripts tags. |
54 |
| - // See: https://github.com/github/pages-gem/pull/545 |
55 |
| - document.querySelectorAll("script[type='math/tex']").forEach(function(el) { |
56 |
| - el.outerHTML = katex.renderToString(el.textContent, { displayMode: false, macros: macros }); |
57 |
| - }); |
58 |
| - |
59 |
| - document.querySelectorAll("script[type='math/tex; mode=display']").forEach(function(el) { |
60 |
| - el.outerHTML = katex.renderToString(el.textContent.replace(/%.*/g, ''), { displayMode: true, macros: macros }); |
61 |
| - }); |
62 |
| - }); |
| 55 | + document.addEventListener("DOMContentLoaded", renderKaTeX); |
63 | 56 | </script>
|
64 | 57 | <style>.katex { font-size: 1.15em; }</style>
|
65 |
| - <!-- KaTeX copy-tex extention: https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-tex --> |
66 |
| - <link href=" https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/copy-tex.css" rel=" stylesheet" type=" text/css" /> |
67 |
| - <script src=" https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/copy-tex.min.js" |
68 |
| - integrity="sha384-XhWAe6BtVcvEdS3FFKT7Mcft4HJjPqMQvi5V4YhzH9Qxw497jC13TupOEvjoIPy7" crossorigin="anonymous"></script> |
69 | 58 |
|
70 | 59 | {%- if site.gtag %}
|
71 | 60 | <!-- Global site tag (gtag.js) - Google Analytics -->
|
|
0 commit comments