Video failed to load

KaTeX Math Examples

270 words
1 minute
KaTeX Math Examples

This article demonstrates how the Firefly theme renders mathematical formulas with KaTeX.

Inline Equations#

Inline equations are enclosed in single $ delimiters.

For example: Euler’s identity eiπ+1=0e^{i\pi} + 1 = 0 is one of the most beautiful formulas in mathematics.

The mass-energy equivalence equation E=mc2E = mc^2 is also widely known.

Display Equations#

Display equations are enclosed in pairs of $$ delimiters and are centered.

∫−∞∞e−x2dx=π\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}x=−b±b2−4ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

Advanced Examples#

Matrices#

(abcd)(αβγδ)=(aα+bγaβ+bδcα+dγcβ+dδ)\begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} \alpha & \beta \\ \gamma & \delta \end{pmatrix} = \begin{pmatrix} a\alpha + b\gamma & a\beta + b\delta \\ c\alpha + d\gamma & c\beta + d\delta \end{pmatrix}

Limits and Sums#

∑n=1∞1n2=π26\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6}lim⁡x→0sin⁡xx=1\lim_{x \to 0} \frac{\sin x}{x} = 1

Maxwell’s Equations#

∇⋅E=ρε0∇⋅B=0∇×E=−∂B∂t∇×B=μ0J+μ0ε0∂E∂t\begin{aligned} \nabla \cdot \mathbf{E} &= \frac{\rho}{\varepsilon_0} \\ \nabla \cdot \mathbf{B} &= 0 \\ \nabla \times \mathbf{E} &= -\frac{\partial \mathbf{B}}{\partial t} \\ \nabla \times \mathbf{B} &= \mu_0\mathbf{J} + \mu_0\varepsilon_0\frac{\partial \mathbf{E}}{\partial t} \end{aligned}

Chemical Equations#

\ceCH4+2O2−>CO2+2H2O\ce{CH4 + 2O2 -> CO2 + 2H2O}

More Symbols#

SymbolCodeRendered Result
Alpha\alphaα\alpha
Beta\betaβ\beta
Gamma\GammaΓ\Gamma
Pi\piπ\pi
Infinity\infty∞\infty
Right Arrow\rightarrow→\rightarrow
Partial\partial∂\partial

For more KaTeX syntax, see KaTeX Supported Functions.

Support & Share

If this article helped you, please share or support!

Sponsor
KaTeX Math Examples
https://docs.bingyun.vip/en/posts/katex-math-example/
Author
BingYun
Published at
1970-01-05
Profile Image of the Author
BingYun
Hello, I'm BingYun
Tags
Table of Contents