Plugin: math

Use LaTeX via $…$ or $`…`$ for inlines, $$…$$ for blocks. These get pre-rendered and styled via KaTeX by default, leading to zero client-side JavaScript being required. This syntax matches GitHub's, and is syntactic sugar for a CodeInline/CodeBlock where lang=math. See also: codeinline-info-string.

This requires authz to run KaTeX outside the WASM sandbox.

Status

🚧 Not implemented 🚧

About KaTeX

About MathML

KaTeX vs MathML

There are pros and cons for both.

Print quality: KaTeX’s layout is based on Donald Knuth’s TeX, the gold standard for math typesetting. — KaTeX website

TBD: is there a good way to use both <span class="katex">...</span> and <math>...</math>, with cross-linking (like for=""), using KaTeX for rendering the pixels and MathML for expressing the semantics?

Including the LaTeX source with the HTML

🚧. Maybe like this?

<span data-math="A%20%5Ccap%20B" class="katex">...</span>

Including MathML with the HTML

🚧. Maybe like this?

<span data-mathml="%3Cmath%3E...%3C%2Fmath%3E" …>

Or like this?

<span id="example1" class="katex">...</span>
...
<math for="example1">...</math>