You can also use pure Markdown for writing simple math expressions.
Delimiters around your formulae require the Passthrough configuration, as the theme finds your formulae by them. Passthrough syntax itself has limited features as it does not provide any of the below parameters besides content. Nevertheless, it is widely available in other Markdown parsers like GitHub and therefore is the recommended syntax for generating portable Markdown.
Parameters
Name
Default
Notes
align
center
The vertical alignment.
Allowed values are left, center or right.
<content>
<empty>
Your formulae.
Enclose each formula in the block or inline delimiters of your Passthrough configuration. Text outside of them is written as Markdown.
Without any delimiters, the whole content is one formula displayed as a block.
Settings
Output of the Formulae
OptionFront Matter By default, formulae are written as MathML, which every current browser displays without any stylesheet or font of the theme. The display quality depends on the browser and the math fonts installed on your reader’s system.
If you want your formulae to look the same in every browser, set math.output to htmlAndMathml. The theme then links the KaTeX stylesheet and fonts to every page containing math. The MathML is kept for screen readers. The value html omits it.
[params][params.math]output='htmlAndMathml'
params:math:output:htmlAndMathml
{"params":{"math":{"output":"htmlAndMathml"}}}
Providing Options for KaTeX
OptionFront Matter Besides output, you can set every option of Hugo’s transform.ToMath function in math, for example your own macros.
Each option of your page’s front matter overwrites the option of the same name of your configuration options.
A formula that KaTeX can not render is written as its source and reported as a warning in your build.
Force Loading of the KaTeX Stylesheet
OptionFront Matter If your output needs the KaTeX stylesheet, it will be linked to your page if the page contains a math shortcode, Markdown codefence, Passthrough syntax or the partial is called from your templates.
If you write KaTeX’s HTML by other means, you can force linking the stylesheet by setting math.force=true. If a formula was rendered, the option has no effect.
math=true does the same but can’t be combined with other math.* options.
[params][params.math]force=true
params:math:force:true
{"params":{"math":{"force":true}}}
Passthrough Configuration
The theme finds your formulae by the delimiters of Hugo’s Passthrough configuration, so it is required if you use delimiters in any syntax. It also lets you write math without enclosing it in a shortcode or Markdown codefence.