diff options
author | Francesco <tomaselli.fr@gmail.com> | 2024-04-28 23:17:39 +0200 |
---|---|---|
committer | Francesco <tomaselli.fr@gmail.com> | 2024-04-28 23:17:39 +0200 |
commit | 572c118f10c4d360ff11cf612db087c1926e17eb (patch) | |
tree | cc110ad0f60d4582e8813294e9925ec68024bc4b /layouts/partials/math.html | |
parent | 3a01ad518912644e3211f774600fbe0b9b9a2aa9 (diff) |
Updated Readme and replaced MathJax with Katex
Diffstat (limited to 'layouts/partials/math.html')
-rw-r--r-- | layouts/partials/math.html | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/layouts/partials/math.html b/layouts/partials/math.html index 59a0b2d..c54c8d5 100644 --- a/layouts/partials/math.html +++ b/layouts/partials/math.html @@ -1,9 +1,16 @@ -<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script> +<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.css"> +<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.js"></script> + +<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/contrib/auto-render.min.js" + onload="renderMathInElement(document.body);"></script> + <script> - MathJax = { - tex: { - displayMath: [['\\[', '\\]'], ['$$', '$$']], - inlineMath: [['\\[', '\\]'], ['$', '$']] - } - }; + document.addEventListener("DOMContentLoaded", function () { + renderMathInElement(document.body, { + delimiters: [ + { left: "$$", right: "$$", display: true }, + { left: "$", right: "$", display: false } + ] + }); + }); </script>
\ No newline at end of file |