Add support for LaTeX in posts

This commit is contained in:
Jack Jackson 2021-12-28 11:59:32 -08:00
parent 2e79b15c79
commit b290e70ece
2 changed files with 7 additions and 1 deletions

View File

@ -1,2 +1,4 @@
<!-- https://stackoverflow.com/a/70385342/1040915 -->
<script src="js/custom.js" defer></script>
<script src="js/custom.js" defer></script>
<!-- https://mertbakir.gitlab.io/hugo/math-typesetting-in-hugo/ -->
{{ if .Params.math }}{{ partial "helpers/katex.html" . }}{{ end }}

View File

@ -0,0 +1,4 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.0/dist/katex.min.css">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.0/dist/katex.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.0/dist/contrib/auto-render.min.js" onload="renderMathInElement(document.body);"></script>