Math Typesetting
In this example we will be using KaTeX
- Create a macro under
/template/macros/math.html
with a macro namedmath
. - Within this macro reference the Auto-render Extension or host these scripts locally.
- Import the macro in your templates like so:
}
}
) }}
}
- To enable KaTex globally set the parameter
extra.math
totrue
in a project’s configuration - To enable KaTex on a per page basis include the parameter
extra.math = true
in content files
Note:
- The MathJax library is the other optional choice, and you can set the parameter
extra.library
tomathjax
in a project’s configuration - Use the online reference of Supported TeX Functions
Examples
Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\)
Block math: $$ \varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } } $$