Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries.
Usage
To use KaTex all you need to do is set katex
to true
in Front Matter.
Yaml
1
2
3
4
| title: KaTeX support
date: 2020-09-01
description: A brief guide to setup KaTeX
katex: true
|
TOML
1
2
3
4
| title = "KaTeX support"
date = "2020-09-01"
description = "A brief guide on KaTeX"
katex = true
|
Examples
Inline Math
1
2
3
| {{< math.inline >}}
\(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\)
{{</ math.inline >}}
|
\(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\)Block Math
1
2
3
| $$
\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }
$$
|
$$
\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }
$$