Math (KaTeX)

ciderpress bundles rspress-plugin-katex for LaTeX math rendering. No configuration required.

Inline math

Wrap expressions with single dollar signs:

Code

The quadratic formula is $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ and applies when $a \neq 0$.

Output

The quadratic formula is x=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} and applies when a0a \neq 0.

Block math

Wrap expressions with double dollar signs:

Code

$$
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$

Output

0ex2dx=π2\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}

More examples

Summation

Code

$$
\sum_{i=1}^{n} i = \frac{n(n+1)}{2}
$$

Output

i=1ni=n(n+1)2\sum_{i=1}^{n} i = \frac{n(n+1)}{2}

Matrix

Code

$$
\begin{bmatrix}
a & b \\
c & d
\end{bmatrix}
\begin{bmatrix}
x \\
y
\end{bmatrix}
=
\begin{bmatrix}
ax + by \\
cx + dy
\end{bmatrix}
$$

Output

[abcd][xy]=[ax+bycx+dy]\begin{bmatrix} a & b \\ c & d \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} ax + by \\ cx + dy \end{bmatrix}

Mixed inline

Code

Given $f(x) = x^2 + 2x + 1$, the derivative is $f'(x) = 2x + 2$ and the integral is $F(x) = \frac{x^3}{3} + x^2 + x + C$.

Output

Given f(x)=x2+2x+1f(x) = x^2 + 2x + 1, the derivative is f(x)=2x+2f'(x) = 2x + 2 and the integral is F(x)=x33+x2+x+CF(x) = \frac{x^3}{3} + x^2 + x + C.

References