diff options
author | Jimmy Cai <jimmehcai@gmail.com> | 2020-12-24 12:57:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-24 12:57:01 +0300 |
commit | 39dd18e6036e04afb3b4f0804e41302875738baf (patch) | |
tree | 48dd4896107041cd8c33473680a62dc6f141d261 /layouts | |
parent | de79b8a4703b1c3460a946cca34619afb07ff1fe (diff) |
feat(math): add inline math support (#88)
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/article/components/math.html | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/layouts/partials/article/components/math.html b/layouts/partials/article/components/math.html index 6c4d3fd..0f85127 100644 --- a/layouts/partials/article/components/math.html +++ b/layouts/partials/article/components/math.html @@ -5,4 +5,17 @@ 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.querySelector(`.article-content`));"></script>
\ No newline at end of file + onload="StackLaTeX()"></script> + +<script> + function StackLaTeX() { + renderMathInElement(document.querySelector(`.article-content`), { + delimiters: [ + { left: "$$", right: "$$", display: true }, + { left: "$", right: "$", display: false }, + { left: "\\(", right: "\\)", display: false }, + { left: "\\[", right: "\\]", display: true } + ] + }); + } +</script>
\ No newline at end of file |