diff options
| author | Pinapelz <yukais@pinapelz.com> | 2024-10-24 01:11:49 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2024-10-24 01:11:52 -0700 |
| commit | d704be19afb2e4701a1947a28ef4970d0b3acfa3 (patch) | |
| tree | 5366be4c472ef3f7a04dba5a5cf1223a6463c1ad /src/components | |
| parent | 96392c73bd5c7ba9f66437205ebcf6c3a1553695 (diff) | |
post: the oshimark problem
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/Latex.astro | 18 |
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" +/> + |
