diff options
-rw-r--r-- | exampleSite/content/post/katex-math-typesetting/index.md | 29 | ||||
-rw-r--r-- | exampleSite/content/post/katex-math-typesetting/index.mmark | 31 | ||||
-rw-r--r-- | layouts/partials/katex.html | 6 |
3 files changed, 34 insertions, 32 deletions
diff --git a/exampleSite/content/post/katex-math-typesetting/index.md b/exampleSite/content/post/katex-math-typesetting/index.md deleted file mode 100644 index d4a368e..0000000 --- a/exampleSite/content/post/katex-math-typesetting/index.md +++ /dev/null @@ -1,29 +0,0 @@ ----
-title: "Katex Math Typesetting"
-date: 2019-03-28
-tags: [katex, math, typesetting, hugo]
----
-
-Enable Katex in the config file by setting the `katex` param to `true`. This will import the necessary Katex CSS/JS.
-
-**Note:** Use the online reference of [supported TeX functions](https://katex.org/docs/supported.html).
-
-Some math:
-
-```
-$$ \varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887… $$
-```
-
-$$ \varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887… $$
-
-More math:
-
-```
-$$
-\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }
-$$
-```
-
-$$
-\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }
-$$
diff --git a/exampleSite/content/post/katex-math-typesetting/index.mmark b/exampleSite/content/post/katex-math-typesetting/index.mmark new file mode 100644 index 0000000..6ac5629 --- /dev/null +++ b/exampleSite/content/post/katex-math-typesetting/index.mmark @@ -0,0 +1,31 @@ +---
+title: "Katex Math Typesetting"
+date: 2019-03-28
+tags: [katex, math, typesetting, hugo]
+---
+
+Enable Katex in the config file by setting the `katex` param to `true`. This will import the necessary Katex CSS/JS.
+
+See the online reference of [supported TeX functions](https://katex.org/docs/supported.html).
+
+**Note:** For inline math to render correctly, your content file extension must be `.mmark`. See the [official mmark site](https://mmark.nl/).
+
+```
+Inline math: $$ \varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887… $$
+```
+
+Inline math: $$ \varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887… $$
+
+```
+Block math:
+
+$$
+\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }
+$$
+```
+
+Block math:
+
+$$
+\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }
+$$
diff --git a/layouts/partials/katex.html b/layouts/partials/katex.html index 7410749..2751fcf 100644 --- a/layouts/partials/katex.html +++ b/layouts/partials/katex.html @@ -1,5 +1,5 @@ {{ if eq $.Site.Params.katex true }}
-<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.css" integrity="sha384-dbVIfZGuN1Yq7/1Ocstc1lUEm+AT+/rCkibIcC/OmWo5f0EA48Vf8CytHzGrSwbQ" crossorigin="anonymous">
-<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/katex.min.js" integrity="sha384-2BKqo+exmr9su6dir+qCw08N2ZKRucY4PrGQPPWU1A7FtlCGjmEGFqXCv5nyM5Ij" crossorigin="anonymous"></script>
-<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
+<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.js" integrity="sha384-9Nhn55MVVN0/4OFx7EE5kpFBPsEMZxKTCnA+4fqDmg12eCTqGi6+BB2LjY8brQxJ" crossorigin="anonymous"></script>
+<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
{{ end }}
\ No newline at end of file |