Math Equations with KaTeX
Learn how to write beautiful mathematical equations using LaTeX syntax
Math Equations with KaTeX
This CMS supports beautiful mathematical equations using KaTeX, a fast math typesetting library that uses LaTeX syntax.
Inline Math
Use single dollar signs $...$ for inline math equations:
The famous equation $E = mc^2$ shows the relationship between energy and mass.
The quadratic formula is $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$.
Euler's identity: $e^{i\pi} + 1 = 0$ is considered one of the most beautiful equations in mathematics.
More Inline Examples
- The Pythagorean theorem: $a^2 + b^2 = c^2$
- Circle area: $A = \pi r^2$
- Derivative notation: $\frac{dy}{dx}$
- Summation: $\sum_{i=1}^{n} i = \frac{n(n+1)}{2}$
Block Math
Use double dollar signs $$...$$ for display equations (centered on their own line):
Mathematical Formulas
Fractions and Binomials
Matrices
Summations and Products
Integrals
The fundamental theorem of calculus:
Double integral:
Limits
Greek Letters
Inline: $\alpha$, $\beta$, $\gamma$, $\delta$, $\epsilon$, $\theta$, $\lambda$, $\mu$, $\pi$, $\sigma$, $\phi$, $\omega$
Common Mathematical Notation
Set Theory
Logic
Calculus
Derivatives: $f'(x)$, $\frac{df}{dx}$, $\frac{\partial f}{\partial x}$
Integrals: $\int f(x) dx$, $\oint f(x) dx$
Linear Algebra
Vectors: $\vec{v}$, $\mathbf{v}$
Dot product: $\vec{a} \cdot \vec{b}$
Cross product: $\vec{a} \times \vec{b}$
Advanced Examples
Taylor Series
Fourier Transform
Differential Equations
The wave equation:
Probability
Normal distribution:
Bayes' theorem:
Computer Science Applications
Big O Notation
The time complexity of binary search: $O(\log n)$
The space complexity of merge sort: $O(n)$
Algorithm Analysis
Information Theory
Shannon entropy:
Combining Math with Asides
Physics Examples
Classical Mechanics
Newton's second law: $F = ma$
Kinetic energy:
Electromagnetism
Maxwell's equations in vacuum:
Quantum Mechanics
Schrödinger equation:
Step-by-Step Example
steps
-
Write the equation in LaTeX
For the quadratic formula, write:
$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ -
Preview the rendering
It appears as: $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$
-
Use display mode for emphasis
$$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$Renders as:
$$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$
Quick Reference
| Description | LaTeX | Rendered |
|---|---|---|
| Fraction | \frac{a}{b} |
$\frac{a}{b}$ |
| Square root | \sqrt{x} |
$\sqrt{x}$ |
| Nth root | \sqrt[n]{x} |
$\sqrt[n]{x}$ |
| Exponent | x^2 |
$x^2$ |
| Subscript | x_i |
$x_i$ |
| Sum | \sum_{i=1}^{n} |
$\sum_{i=1}^{n}$ |
| Product | \prod_{i=1}^{n} |
$\prod_{i=1}^{n}$ |
| Integral | \int_a^b |
$\int_a^b$ |
| Infinity | \infty |
$\infty$ |
| Pi | \pi |
$\pi$ |
Best Practices
✅ Use inline math for equations within text ✅ Use block math for important standalone equations ✅ Keep it readable - Don't overcomplicate simple expressions ✅ Add context - Explain what variables represent ✅ Test rendering - Make sure complex equations display correctly