aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Latex.astro
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Latex.astro')
-rw-r--r--src/components/Latex.astro18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/components/Latex.astro b/src/components/Latex.astro
new file mode 100644
index 0000000..f335189
--- /dev/null
+++ b/src/components/Latex.astro
@@ -0,0 +1,18 @@
+---
+import katex from 'katex';
+
+const { formula = '' } = Astro.props;
+const html = katex.renderToString(formula, {throwOnError: false});
+---
+
+<div class="text-center">
+ <span set:html={html} class="" />
+</div>
+
+<link
+ rel="stylesheet"
+ href="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.css"
+ integrity="sha384-WsHMgfkABRyG494OmuiNmkAOk8nhO1qE+Y6wns6v+EoNoTNxrWxYpl5ZYWFOLPCM"
+ crossorigin="anonymous"
+/>
+
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage