Math Equations
Created Mar 14, 2026Updated Jun 7, 2026Takeshi Takatsudo
KaTeX math equation support using the MathBlock JSX component.
When math is enabled in settings (default: true), you can render mathematical equations using KaTeX via the <MathBlock> JSX component.
Info
$...$, $$...$$, and ```math fences are not supported in zfb. The zfb Rust MDX emitter does not process those syntaxes — use <MathBlock latex="..." /> instead (see pages/).
Inline Math
Use <MathBlock latex="..." /> (without the block prop) to embed math within a line of text.
The formula is inline.
The formula <MathBlock latex="E = mc^2" /> is inline.Block Math
Add the block prop to render a centered display equation.
<MathBlock latex="\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}" block />Configuration
Math support is controlled by the math setting in src/:
export const settings = {
// ...
math: true, // enabled by default
};More Examples
Quadratic Formula
<MathBlock latex="x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}" block />Summation
<MathBlock latex="\sum_{i=1}^{n} i = \frac{n(n+1)}{2}" block />Matrix
<MathBlock latex="\begin{bmatrix} a & b \\ c & d \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} ax + by \\ cx + dy \end{bmatrix}" block />Revision History
Takeshi TakatsudoCreated: 2026-03-14T21:08:12+09:00Updated: 2026-06-07T16:19:05+09:00