Skip to main content

Math Typesetting with KaTeX

as-folio uses KaTeX to render LaTeX mathematics. Enable it per-post with math: true in the frontmatter.

Inline math

Write inline math between single dollar signs: $...$. For example, the energy-mass equivalence E=mc2E = mc^2 is one of the most famous equations in physics.

The Euler identity eiπ+1=0e^{i\pi} + 1 = 0 is often cited as the most beautiful equation in mathematics.

Display equations

Use double dollar signs for display (block) equations:

E=ρε0\nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon_0} ×B=μ0J+μ0ε0Et\nabla \times \mathbf{B} = \mu_0 \mathbf{J} + \mu_0 \varepsilon_0 \frac{\partial \mathbf{E}}{\partial t}

These are two of Maxwell’s equations for electromagnetism.

Fractions and integrals

ex2dx=π\int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi}

The Lorentz factor from special relativity:

γ=11v2/c2\gamma = \frac{1}{\sqrt{1 - v^2/c^2}}

Matrices

(abcd)(xy)=(ax+bycx+dy)\begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} ax + by \\ cx + dy \end{pmatrix}

Aligned equations

The derivation of general relativity’s field equations:

Gμν+Λgμν=κTμνκ=8πGc4\begin{aligned} G_{\mu\nu} + \Lambda g_{\mu\nu} &= \kappa T_{\mu\nu} \\ \kappa &= \frac{8\pi G}{c^4} \end{aligned}

where GμνG_{\mu\nu} is the Einstein tensor, Λ\Lambda is the cosmological constant, gμνg_{\mu\nu} is the metric tensor, and TμνT_{\mu\nu} is the stress-energy tensor.