01 · Syntax
先认识四种写法
Four forms to remember
行内公式跟随正文排列;块级公式独占一行并居中。化学式写在 \ce{} 中,编号写在块级公式的 \tag{} 中。
Inline math flows with text; display math gets its own centered line. Put chemistry inside \ce{} and numbering inside \tag{}.
$E=mc^2$$$ ... $$\ce{H2O}\tag{1}02 · Inline math
行内公式:与正文一起阅读
Inline math: flow with prose
用一对半角美元符号包住公式,美元符号与公式内容之间不要留空格。
Wrap the expression in single dollar signs, without spaces just inside the delimiters.
圆的面积是 $S=\pi r^2$,质能方程是 $E=mc^2$。圆的面积是 ,质能方程是 。
03 · Display math
块级公式:独占一行并居中
Display math: centered on its own line
把开始和结束的 $$ 分别放在独立行上,适合分数、矩阵、方程组和较长公式。
Put the opening and closing $$ on separate lines for fractions, matrices, systems, and longer equations.
$$
\frac{-b\pm\sqrt{b^2-4ac}}{2a}
$$04 · Equation numbering
公式编号:使用 \\tag
Equation numbering with \\tag
编号写在块级公式内部,可以使用数字,也可以使用有意义的文字。
Place the tag inside display math. It can be a number or a meaningful label.
$$
E=mc^2 \tag{1}
$$05 · Chemistry
化学公式:使用 \\ce
Chemistry with \\ce
轻阅内置 mhchem,可以显示上下标、电荷、反应箭头、物态和反应条件。行内与块级写法都支持。
Quillite includes mhchem for subscripts, charges, reaction arrows, states, and conditions in inline or display math.
水的化学式是 $\ce{H2O}$,硫酸是 $\ce{H2SO4}$。水的化学式是 ,硫酸是 。
$$
\ce{2H2 + O2 -> 2H2O} \tag{反应-1}
$$\ce{N2 + 3H2 <=> 2NH3}\ce{Na+ + Cl- -> NaCl}\ce{CaCO3(s) -> CaO(s) + CO2(g)}06 · Quick reference
常用 LaTeX 语法速查
Common LaTeX reference
| 功能Purpose | 写法Syntax | 效果Result |
|---|---|---|
| 分数Fraction | \frac{a}{b} | |
| 平方根Square root | \sqrt{x} | |
| 求和Sum | \sum_{i=1}^n | |
| 积分Integral | \\int_0^1 | |
| 极限Limit | \lim_{x\to0} | |
| 上下标Scripts | a_1+x^2 |
07 · Complete template catalog
软件内置公式:全部 79 项
All 79 built-in templates
内容与最新版软件源码同步。参数栏显示插入模板时可修改的字段及默认值;复制按钮会复制可直接粘贴的块级 Markdown。
Synchronized with the current desktop source. Parameters show every editable field and default value; Copy places paste-ready display Markdown on the clipboard.
基础数学
Mathematics
10E = mc^2E = mc^2y等号右侧Right sideax+by = ax+ba+b分母Denominatorc+d\frac{a+b}{c+d}x指数Exponent2下标(可空)Subscript (optional)ix_{i}^{2}a^2+b^2根指数(平方根可空)Root index (optional)—\sqrt{a^2+b^2}a真数Argumentx\log_{a} xx-a\left|x-a\right|nn!n选取数 rChosen rrA_{n}^{r}=\frac{n!}{(n-r)!}n选取数 rChosen rrC_{n}^{r}=\binom{n}{r}=\frac{n!}{r!(n-r)!}代数与函数
Algebra & functions
9a系数 bCoefficient bb系数 cCoefficient ccx = \frac{-b \pm \sqrt{b^{2}-4ac}}{2a}a常数 bConstant bbax+b=0\quad\Rightarrow\quad x=-\frac{b}{a}a_1x+b_1y=c_1第二个方程Second equationa_2x+b_2y=c_2\begin{cases}a_1x+b_1y=c_1 \\ a_2x+b_2y=c_2\end{cases}a第二项Second termb次数 nPower nn(a+b)^{n}=\sum_{k=0}^{n}\binom{n}{k}a^{n-k}b^{k}a_1公差Common differenced项数Indexna_{n}=a_1+(n-1)da_1末项Last terma_n项数Number of termsnS_{n}=\frac{n(a_1+a_n)}{2}a_1公比Common ratioq项数Indexna_{n}=a_1q^{n-1}a_1公比Common ratioq项数Number of termsnS_{n}=a_1\frac{1-q^{n}}{1-q}x^2第一段条件First conditionx \ge 0第二段结果Second result-x第二段条件Second conditionx < 0f(x)=\begin{cases}x^2, & x \ge 0 \\ -x, & x < 0\end{cases}几何
Geometry
10a直角边 bSide bb斜边 cHypotenuse cca^{2}+b^{2}=c^{2}x_1y₁y₁y_1x₂x₂x_2y₂y₂y_2d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}x_1y₁y₁y_1x₂x₂x_2y₂y₂y_2M\left(\frac{x_1+x_2}{2},\frac{y_1+y_2}{2}\right)x_1y₁y₁y_1x₂x₂x_2y₂y₂y_2k=\frac{y_2-y_1}{x_2-x_1}rS=\pi r^{2}rC=2\pi ra高HeighthS=\frac{1}{2}aha边 bSide bb边 cSide ccp=\frac{a+b+c}{2},\quad S=\sqrt{p(p-a)(p-b)(p-c)}a边 bSide bb边 cSide cc\frac{a}{\sin A}=\frac{b}{\sin B}=\frac{c}{\sin C}a边 bSide bb边 cSide cc夹角Included angleCc^{2}=a^{2}+b^{2}-2ab\cos C微积分
Calculus
11f(x)变量Variablex\frac{d}{dx}\left(f(x)\right)a上限Upper boundb被积函数Integrandf(x)积分变量Variablex\int_{a}^{b} f(x)\,dxf(x)积分变量Variablex\int f(x)\,dx=F(x)+Cf(x)变量Variablex阶数Ordern\frac{d^{n}}{dx^{n}}\left(f(x)\right)f(x,y)求导变量Variablex\frac{\partial}{\partial x}\left(f(x,y)\right)D被积函数Integrandf(x,y)积分变量Variablesx\,y\iint_{D} f(x,y)\,dx\,yf(x)展开点Centera求和下标Indexnf(x)=\sum_{n=0}^{\infty}\frac{f^{(n)}(a)}{n!}(x-a)^{n}f变量Variablesx,y,z\nabla f=\left(\frac{\partial f}{\partial x},\frac{\partial f}{\partial y},\frac{\partial f}{\partial z}\right)\quad(x,y,z)x趋近值Approaches0表达式Expression\frac{\sin x}{x}\lim_{x \to 0} \frac{\sin x}{x}i起始值Start1结束值Endn求和项Termi^2\sum_{i=1}^{n} i^2i起始值Start1结束值Endn连乘项Factora_i\prod_{i=1}^{n} a_i线性代数
Linear algebra
8a第 1 行第 2 列Row 1, column 2b第 2 行第 1 列Row 2, column 1c第 2 行第 2 列Row 2, column 2d\begin{bmatrix}a & b \\ c & d\end{bmatrix}a分量(逗号分隔)Componentsa_1,a_2,a_3\vec{a}=\left(a_1,a_2,a_3\right)\vec a向量 bVector b\vec b夹角Angle\theta\vec a\cdot\vec b=\lVert\vec a\rVert\lVert\vec b\rVert\cos \theta\vec a向量 bVector b\vec b夹角Angle\theta\lVert\vec a\times\vec b\rVert=\lVert\vec a\rVert\lVert\vec b\rVert\sin \thetaa第 1 行第 2 列Row 1, column 2b第 2 行第 1 列Row 2, column 1c第 2 行第 2 列Row 2, column 2d\begin{vmatrix}a&b\\c&d\end{vmatrix}=ad-bca,b,c第 2 行Row 2d,e,f第 3 行Row 3g,h,i\begin{bmatrix}a&b&c\\d&e&f\\g&h&i\end{bmatrix}a元素 bElement bb元素 cElement cc元素 dElement ddA^{-1}=\frac{1}{ad-bc}\begin{bmatrix}d&-b\\-c&a\end{bmatrix}A特征值Eigenvalue\lambda单位矩阵Identity matrixI\det\left(A-\lambdaI\right)=0概率统计
Probability & statistics
9x样本数Sample countn\bar{x}=\frac{1}{n}\sum_{i=1}^{n}x_ix权重符号Weight symbolw样本数Sample countn\bar{x}=\frac{\sum_{i=1}^{n}w_ix_i}{\sum_{i=1}^{n}w_i}X均值Mean\mu\operatorname{Var}(X)=\mathbb{E}\left[(X-\mu)^2\right]\operatorname{Var}(X)\sigma=\sqrt{\operatorname{Var}(X)}\mu标准差Standard deviation\sigmaf(x)=\frac{1}{\sigma\sqrt{2\pi}}\exp\left[-\frac{(x-\mu)^2}{2\sigma^2}\right]n成功次数Successesk成功概率ProbabilitypP(X=k)=\binom{n}{k}p^{k}(1-p)^{n-k}A事件 BEvent BBP(A\mid B)=\frac{P(A\cap B)}{P(B)}A事件 BEvent BBP(A\mid B)=\frac{P(B\mid A)P(A)}{P(B)}X变量 YVariable YY\rho_{X,Y}=\frac{\operatorname{Cov}(X,Y)}{\sigma_{X}\sigma_{Y}}物理
Physics
8F质量Massm加速度AccelerationaF=mam速度VelocityvE_k=\frac{1}{2}mv^2m重力加速度Gravityg高度HeighthE_p=mghm光速Speed of lightcE=mc^2U电流CurrentI电阻ResistanceRU=IRU电流CurrentIP=UIv频率Frequencyf波长Wavelength\lambdav=f\lambdap体积VolumeV物质的量Amountn气体常数Gas constantR温度TemperatureTpV=nRT基础化学
Chemistry
72H2 + O2 -> 2H2O\ce{2H2 + O2 -> 2H2O}H2SO4\ce{H2SO4}SO4^2-\ce{SO4^2-}m摩尔质量Molar massMn=\frac{m}{M}n溶液体积Solution volumeVc=\frac{n}{V}m_{\text{solute}}溶液质量Solution massm_{\text{solution}}w=\frac{m_{\text{solute}}}{m_{\text{solution}}}\times100\%[\ce{H+}]\mathrm{pH}=-\log_{10}[\ce{H+}]化学反应
Chemical reactions
72H2 + O2生成物Products2H2O\ce{2H2 + O2 -> 2H2O}N2 + 3H2生成物Products2NH3反应条件(可空)Condition (optional)heat\ce{N2 + 3H2 <=>[heat] 2NH3}CaCO3(s)生成物(含物态)Products with statesCaO(s) + CO2(g)\ce{CaCO3(s) -> CaO(s) + CO2(g)}Ag+ + Cl-沉淀物PrecipitateAgCl v\ce{Ag+ + Cl- -> AgCl v}2H+ + CO3^2-生成物ProductsH2O + CO2 ^\ce{2H+ + CO3^2- -> H2O + CO2 ^}[C]^c[D]^d反应物浓度乘积Reactant concentrations[A]^a[B]^bK_c=\frac{[C]^c[D]^d}{[A]^a[B]^b}\Delta c时间变化Time change\Delta tv=-\frac{\Delta c}{\Delta t}08 · Troubleshooting
公式没有正确显示时
When a formula does not render
- 确认使用半角美元符号和反斜杠。
- 行内公式的美元符号与内容之间不要留空格。
- 块级公式开始与结束的
$$建议分别独占一行。 - 化学式必须放在
\ce{...}内。 - 三个反引号包围的是代码块,只显示源码,不会渲染公式。
- Use half-width dollar signs and backslashes.
- Do not leave spaces just inside inline dollar delimiters.
- Put the opening and closing
$$on separate lines. - Put chemistry inside
\ce{...}. - Triple-backtick code blocks show source and do not render math.
在编辑器“更多格式 → 学科公式”中选择分类、模板和输出模式。
Open More Formats → Subject Formulas, then choose a discipline, template, and output mode.