admnwrk

Veröffentlicht: Lesedauer: 2 Min.

← Back to Table of Contents

9. KaTeX (Math)

mrkdwn renders mathematical formulas with KaTeX — fast and fully local.


Enable

Turn on Settings → Editor → KaTeX / Math.


Syntax

Type Syntax Example
Inline $ … $ $E = mc^2$
Block $$ … $$ see below

Block example:

$$
\int_0^\infty e^{-x}\,dx = 1
$$
KaTeX rendering

Rendered KaTeX formulas in the visual editor.


What is Supported? (Whitelist)

KaTeX supports a clearly defined set of commands — deliberately not the entire LaTeX language. This keeps rendering fast and safe. Supported includes:

Security/whitelist: Unsupported or potentially unsafe LaTeX macros (e.g. arbitrary \def/\newcommand with custom code, file access, external packages) are not executed. KaTeX renders only its vetted command set; unknown commands show an error hint instead of doing something “unexpected”. This keeps rendering deterministic and free of network/system access.

Full command list: see the official KaTeX overview of supported functions (Supported Functions / Support Table).


Examples

Inline: The solution is $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$.

Block:
$$
\begin{aligned}
f(x) &= (x+1)^2 \\
     &= x^2 + 2x + 1
\end{aligned}
$$

← Back · Next: Mermaid →