← Back to blog

LaTeX Math Rendering

This post demonstrates how TeX-style math is automatically rendered using KaTeX.

Inline Math

Here is an inline equation for the Pythagorean theorem: a2+b2=c2a^2 + b^2 = c^2.

Block Math

Here is a block equation showing the quadratic formula:

x=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

KaTeX supports a wide array of expressions natively without needing clientside JavaScript:

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