返回首页

LaTeX 公式渲染测试

行内公式

在正文中插入行内数学公式,例如欧拉公式 $e^{i\pi} + 1 = 0$,或牛顿第二定律 $F = ma$。

高斯分布:$\mathcal{N}(\mu, \sigma^2) = \frac{1}{\sqrt{2\pi\sigma^2}} e^{-\frac{(x-\mu)^2}{2\sigma^2}}$

块级公式

$ \int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi} $

$ \sum_{k=1}^{n} k = \frac{n(n+1)}{2} $

矩阵

$ \begin{pmatrix} a{11} & a{12} & \cdots & a{1n} \\ a{21} & a{22} & \cdots & a{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a{m1} & a{m2} & \cdots & a_{mn} \end{pmatrix} $

分段函数

$ f(x) = \begin{cases} x^2, & \text{if } x \ge 0 \\ -x, & \text{if } x < 0 \end{cases} $

带希腊字母与运算符

$ \nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon0}, \quad \nabla \times \mathbf{B} = \mu0 \left( \mathbf{J} + \varepsilon_0 \frac{\partial \mathbf{E}}{\partial t} \right) $

测试说明

本页用于验证 MarkdownRenderer 中的 KaTeX 扩展(inlineMathblockMath)是否正常工作。若渲染为原始 $...$ 文本或出现红色报错,说明 LaTeX 管道有问题。

这里只测渲染管道,公式的 Markdown 写法本身见 [[markdown-cheatsheet]] 的「数学与扩展」一节。