diff options
author | Olivier Roques <olivier@oroques.dev> | 2020-09-22 22:32:49 +0200 |
---|---|---|
committer | Olivier Roques <olivier@oroques.dev> | 2020-09-22 22:32:49 +0200 |
commit | 31c7c34c8fe11acacb02e83e5c5b457704f65cd9 (patch) | |
tree | 8fb7b0c664fd8006825b16ff86934621ab3cb137 /layouts | |
parent | ed987fa67df89d3f712eaf63ec8e6e10c7679a78 (diff) |
Add script to enable inline math expression
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/math.html | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/layouts/partials/math.html b/layouts/partials/math.html index 94a1ae3..19c0502 100644 --- a/layouts/partials/math.html +++ b/layouts/partials/math.html @@ -1,3 +1,17 @@ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css" integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X" crossorigin="anonymous"> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js" integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4" crossorigin="anonymous"></script> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js" integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script> + +<!-- Script to enable inline math expressions --> +<script> + document.addEventListener("DOMContentLoaded", function() { + renderMathInElement(document.body, { + delimiters: [ + {left: "$$", right: "$$", display: true}, + {left: "\\[", right: "\\]", display: true}, + {left: "$", right: "$", display: false}, + {left: "\\(", right: "\\)", display: false} + ] + }); + }); +</script> |