aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/layouts/partials/katex.html
diff options
context:
space:
mode:
authorJean-Pierre Appel <jeanpierre.appel01@gmail.com>2023-12-25 17:17:21 -0500
committerJean-Pierre Appel <jeanpierre.appel01@gmail.com>2023-12-25 17:17:21 -0500
commitcc1220bfd794dff1fc28bd39cafb63c4b1093cf8 (patch)
tree8d51983970fc62457ed97599d784cfa150b5c766 /layouts/partials/katex.html
parenta181759e4a108c35fcf6898abbf17f2a424d85dc (diff)
rewrite layouts
Diffstat (limited to 'layouts/partials/katex.html')
-rw-r--r--layouts/partials/katex.html22
1 files changed, 22 insertions, 0 deletions
diff --git a/layouts/partials/katex.html b/layouts/partials/katex.html
new file mode 100644
index 0000000..e0468d2
--- /dev/null
+++ b/layouts/partials/katex.html
@@ -0,0 +1,22 @@
+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
+
+<!-- The loading of KaTeX is deferred to speed up page rendering -->
+<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js" integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8" crossorigin="anonymous"></script>
+
+<!-- To automatically render math in text elements, include the auto-render extension: -->
+<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
+<script>
+ document.addEventListener("DOMContentLoaded", function() {
+ renderMathInElement(document.body, {
+ // customised options
+ // • auto-render specific keys, e.g.:
+ delimiters: [
+ {left: '$$', right: '$$', display: true},
+ {left: '$', right: '$', display: false},
+ {left: '\\(', right: '\\)', display: false},
+ {left: '\\[', right: '\\]', display: true}
+ ],
+ throwOnError : false
+ });
+ });
+</script>