Video failed to load

KaTeX 数学公式示例

241 words
1 minute
KaTeX 数学公式示例

本文展示了 Firefly 主题对 KaTeX 数学公式的渲染支持。

行内公式 (Inline)#

行内公式使用单个 $ 符号包裹。

例如:欧拉公式 eiπ+1=0e^{i\pi} + 1 = 0 是数学中最优美的公式之一。

质能方程 E=mc2E = mc^2 也是家喻户晓。

块级公式 (Block)#

块级公式使用两个 $$ 符号包裹,会居中显示。

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

复杂示例#

矩阵 (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}

更多符号#

符号代码渲染结果
Alpha\alphaα\alpha
Beta\betaβ\beta
Gamma\GammaΓ\Gamma
Pi\piπ\pi
Infinity\infty∞\infty
Right Arrow\rightarrow→\rightarrow
Partial\partial∂\partial

更多 KaTeX 语法请参考 KaTeX Supported Functions。

Support & Share

If this article helped you, please share or support!

Sponsor
KaTeX 数学公式示例
https://blog.wsh.moe/posts/katex-math-example/
Author
XiaYe
Published at
1970-01-02

Comments

LEAVE A NOTE

Join the conversation

Markdown supported

Be kind. Good conversations start with you.

Conversation

Loading conversation…

Comments powered by Waline

Profile Image of the Author
XiaYe
Hello, I'm XiaYe.
Announcement
欢迎来到我的博客!这是一则示例公告。
Categories
Tags
Latest Moments
Site Statistics
Posts
13
Categories
2
Tags
19
Total Words
16,246
Running Days
0 days
Last Activity
0 days ago
Site Info
Build Platform
Vercel
Blog Version
Firefly v6.16.8
License
CC BY-NC-SA 4.0
Table of Contents