Mathematical Notation with KaTeX
Demonstrating mathematical notation support using KaTeX for inline and block equations.
Table of Contents
This post demonstrates the mathematical notation capabilities powered by KaTeX.
Inline Math
You can write inline math using single dollar signs. For example, the famous equation E = mc^2 shows the relationship between energy and mass. The quadratic formula x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} solves quadratic equations.
Here are more examples:
- The derivative notation: f'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}
- Probability: P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)} (Bayes’ theorem)
- Greek letters: \alpha, \beta, \gamma, \delta, \epsilon, \theta, \lambda, \mu, \pi, \sigma, \omega
Block Math
Block math uses double dollar signs and is centered on its own line:
The Gaussian Distribution
The probability density function of the normal distribution:
Matrix Notation
Matrices are also supported:
Summations and Products
Calculus
The fundamental theorem of calculus:
Taylor series expansion:
Alternative Delimiters
You can also use LaTeX-style delimiters. Inline: a^2 + b^2 = c^2
Block math with bracket delimiters:
Complex Equations
Maxwell’s equations in differential form:
Conclusion
KaTeX provides fast, high-quality math rendering that works great for data science, engineering, and scientific content. The math notation looks great in both light and dark modes!