Math Typesetting

Hugo Authors

2019/02/08

Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries.

In this example we will be using $\KaTeX$

{{ if or .Params.math .Site.Params.math }}
{{ partial "math.html" . }}
{{ end }}

Note: Use the online reference of Supported $\TeX$ Functions

Block math: $$ \mathcal L_{\mathcal T}(\vec{\lambda}) = \sum_{(\mathbf{x},\mathbf{s})\in \mathcal T} \log P(\mathbf{s}\mid\mathbf{x}) - \sum_{i=1}^m \frac{\lambda_i^2}{2\sigma^2} $$