KaTeX
Render math typesetting with KaTeX.
Activation
KaTeX styles are included on the page by the first use of the shortcode or a katex code block. In order to use delimiters passthrough needs to be configured.
Block Rendering
Three equivalent ways to render display math:
Result:
Inline Rendering
| Syntax | Output |
|---|---|
{{< katex >}}\pi(x){{< /katex >}} | |
\\( \pi(x) \\) |
Parameters
Shortcode and block parameters are the same as original from transform.ToMath. See Hugo documentation
Passthrough
Hugo offers a hook to render math as passthrough, without codeblocks or shortcodes. See configuration in Hugo documentation.
hugo.yamlmarkup:
goldmark:
extensions:
passthrough:
enable: true
delimiters:
block:
- ['\[', '\]']
- ['$$', '$$']
inline:
- ['\(', '\)']layouts/_markup/render-passthrough.html{{/*- $opts := dict "displayMode" (eq .Type "block") -*/}}
{{/*- (transform.ToMath .Inner $opts) -*/}}