Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries.
Check out Hugo Math Typesetting for more details.
- To enable Math Typesetting globally set the parameter
math
totrue
in a project’s configuration - To enable Math Typesetting on a per page basis include the parameter
math: true
in content files
Configure the hugo.yaml
file to setup goldmark to support Math Typesetting:
markup:
defaultMarkdownHandler: goldmark
goldmark:
extensions:
passthrough:
enable: true
delimiters:
block:
- ["$$", "$$"]
- ["\\[", "\\]"]
inline:
- ["\\(", "\\)"]
Note: You can also set the parameter math.engine
to katex
to use KaTeX instead of MathJax.
Math
This is an inline
These are block equations:
These are also block equations: