Katex
katex is a faster alternative to Mathjax.
get started
Grab the latest script tags and stylesheet from a cdn
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js"></script>
Automatically render all equations in document.body:
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js"></script>
<script>
renderMathInElement(document.body,
{
delimiters: [
{left: "$", right: "$", display: false},
{left: "\[", right: "\]", display: true},
]
}
);
</script>
put the last script tag at the end of the document. display: false
is for inline math, the delimiter array
can be filled with other delimiters.
test it out
inline math $ \int_0^2 f(x) dx $ seems to work. $ 3 \ne 2 $, $ a \in \{a,b,c\} $, $ \mu \pi \epsilon \gamma$….
Displaymode:
[e^{it}]