阶段 3 · 数学排版 20 / 48 ≈ 12 分钟读完

LaTeX 分数:frac、dfrac、tfrac 与 cfrac 差在哪

LaTeX 里的分数是两只盒子、一条搁在数学轴上的横线,外加一层从周围环境继承来的样式。frac、dfrac、tfrac、cfrac 的全部分别就在这三样里,你排扁过、撑爆过、认不出过的每一个分数也一样——包括那些被上下标吞掉一层的。

    四条命令,一套盒子模型

    这四条里只有一条改变分数长什么样,其余三条改的是它被排进的样式。\frac{a}{b} 要的是「跟随周围数学当前样式」的分数:行间公式里满高,行内就被压扁。amsmath 把 \dfrac 与 \tfrac 分别定义成套上 \displaystyle 和 \textstyle 的 \frac,所以句子里写 \dfrac{1}{2} 换来一只行间尺寸的盒子,定理那条行间公式里写 \tfrac{1}{2} 换来紧凑的一只。\cfrac 则是 display 样式的 \frac,还会额外把它自己的分子与分母也按 display 样式排——连分数要的正是这一点:不这么办,层层嵌套会把每一路压成 scriptstyle 的一团糊。

    四条命令都不碰的,是盒子模型。TeX 先搭两只盒子,按比当前低一级的样式排它们,把横线搁在数学轴上——也就是 + 与 = 所在的那个高度,从来不是基线——然后把两只盒子推开,直到该样式规定的最小净空被满足。这些净空(num1、num2、num3、denom1、denom2、denom3)连同 axis_height 和 default_rule_thickness,全是数学字体的参数。所以同一份源码在 Computer Modern 下比在 Latin Modern 下更高;也所以「让分数小一点」在 LaTeX 里根本不是一项配置:你能换的要么是样式,要么是内容本身。

    于是选哪条命令,依据是这座分数待在哪里、结果容许多高,而不是口味。行间公式里 \frac 本来就对。行内通常也对,等行距已经够松时你才会去拿 \tfrac。\dfrac 只修一种特定毛病——被硬塞进 text 样式上下文里的行间高度材料:cases 与 array 的单元格,或者分子自己又是一座分数。

    \frac{a+b}{c+d}
    \frac{a+b}{c+d}
    \frac{1}{2} \qquad \dfrac{1}{2} \qquad \tfrac{1}{2}
    \frac{1}{2} \qquad \dfrac{1}{2} \qquad \tfrac{1}{2}
    The box model of a LaTeX fraction: numerator and denominator boxes, the rule on the math axis, and the font parameters that push them apart Rendered \frac{a+b}{c+d} — what TeX actually builds baseline of the whole formula math axis a + b c + d numerator box, raised denominator box, lowered rule thickness and axis come from the math font min. clearance num1 (display) denom1 \frac{a+b}{c+d} both arguments are boxes, centred on the rule The parameters behind it Font parameters, not your settings axis_height · rule_thickness · num1 num2 num3 · denom1 denom2 denom3 TeX raises the numerator and lowers the denominator until the chosen clearance is satisfied — display style uses num1/denom1, text style the tighter num2/denom2, subscripts num3/denom3. Swap math font and every fraction changes height, which is why two documents never match. The bar sits on the math axis, the height of + and =, never on the baseline. Three consequences 1 · A tall fraction is a tall box: in a line of text it forces the     interline gap open — that is the real cost of \dfrac inline. 2 · \left(...\right) sizes to that box, so a fraction inside auto     delimiters is always over-sized. Manual \bigl fixes it. Source anatomy vs rendered anatomy — the same box model at every size
    分子与分母是绕着数学轴上的横线一升一降的两只盒子,其间净空取自字体参数。

    哪种样式在哪里生效

    规则短到可以背下来。行间公式(\[…\]、equation、align、gather、multline、displaymath)从 displaystyle 起步。凡在 $…$、\(…\)、equation 那一类的行内材料或 \hbox 里的东西,都从 textstyle 起步。上下标各降一级:x_{…} 内部是 scriptstyle,再往里套一层就是 scriptscriptstyle。每降一级既缩字形又收紧分数的净空,这就是嵌套分数比托着它的那个下标看起来还小一号的原因。

    有两处上下文几乎每个人都会踩。一是 cases 与 array/matrix 的单元格按 textstyle 排,所以分段函数某一支里的 \frac 明明整块待在行间公式里也照样印成紧凑尺寸——\dfrac 就是为这种场合而存在的。二是 aligned 内部,紧贴对齐点两侧的材料跟随外层样式(在行间公式里即 display),而你放进上下标里的任何东西则不分场合一律 scriptstyle。

    样式也可以手动指定:\displaystyle 与 \textstyle 是作用到当前组结束的开关,于是在 cases 的单元格里写 {\displaystyle \frac{1}{2}},效果与 \dfrac 相同;想强制往下压还有 \scriptstyle/\scriptscriptstyle。行文里更该优先用 amsmath 那两个包装 \dfrac/\tfrac:管幅只覆盖一个分数,源码里读起来是一句明确意图,也绝不会漏过右括号、悄悄把这一行剩下的部分撑大。

    \dfrac{\partial u}{\partial t} = \kappa \, \dfrac{\partial^{2} u}{\partial x^{2}}
    \dfrac{\partial u}{\partial t} = \kappa \, \dfrac{\partial^{2} u}{\partial x^{2}}
    \cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1}}}
    \cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1}}}
    The four maths styles and how each one renders the same fraction, with the commands that override the automatic choice One source, four sizes — the style is inherited from the position, not from the command displaystyle inside \[ … \], equation, align, gathered a+b c+d \dfrac{a+b}{c+d} widest clearance, full size textstyle inside $ … $ in a sentence, and in cells of cases/array a+b c+d \tfrac{a+b}{c+d} what inline \frac collapses to scriptstyle one _ or ^ deep — the limits of \sum, \lim, a subscript a+b c+d x_{\frac{a+b}{c+d}} ≈ 70% of text size scriptscriptstyle two levels deep: x_{y_{z}} or a limit inside a limit a+b c+d x_{y_{\frac{a}{b}}} unreadable: rewrite, don't resize Overrides, and what each one is for \dfrac · \displaystyle — force the big size q = \dfrac{y_{\text{final}}}{y_{\text{initial}}} Fine in a display. In running text it opens a hole in the paragraph — use it to rescue \tfrac · \textstyle — force the small size \sum_{k=1}^{n} \tfrac{1}{k} \quad \cfrac{1}{1+\cfrac{1}{2}} \tfrac keeps an inline sum on one line-height. \cfrac keeps nested numerators at full width.
    同一个 \frac 在四种样式下的成品,以及能推翻自动选择的那两条命令。

    分数一进求和上限为什么就塌掉

    关于分数被问得最多就是这一条,答案正是上面那套样式继承。在 \sum_{k=1}^{n} \frac{1}{k} 里,分数位于整条行间公式的主体,所以保住 display 高度。把它挪进界限——\sum_{k=1}^{\frac{n}{2}} k,或者 x_{\frac{1}{2}}——它此刻已在下标内部,于是 scriptstyle:字形缩掉,num3/denom3 又把净空夹死,出来的是一团没有读者能扫一眼读懂的东西。

    三种救法,按推荐顺序。头一种,改写结构让分数不在极限里:用斜杠写成 \sum_{k \le n/2} k,或者写 \sum_{k=1}^{m} 再补一句正文交代 m 是什么。第二种,用 \dfrac 硬顶尺寸——合法,TeX 也会照办——但得接受后果:盒子比求和号还高,界于是和运算符撞在一起,在行内还会把这一行撑开。第三种,大运算符上确实需要叠成多行的界时,在极限里用 \substack,并且刻意让每一行留在 scriptstyle。

    通则比招数更值钱:极限、下标、上标都是注记,而版式设计假定它们很短。如果你的注记需要一座两层的分数,那是公式在提醒你给这个量起个名字、把定义挪到别处去。

    \sum_{n=1}^{\infty} \frac{1}{n^{2}} \qquad \sum_{n=1}^{\infty} \dfrac{1}{n^{2}}
    \sum_{n=1}^{\infty} \frac{1}{n^{2}} \qquad \sum_{n=1}^{\infty} \dfrac{1}{n^{2}}
    \sum\limits_{…} 里界确实搬到运算符正下方,但仍然留在 scriptstyle——\limits 改的是位置,从来不是尺寸。
    x_{\frac{1}{2}} \qquad x_{\dfrac{1}{2}} \qquad \sum_{k=1}^{\frac{n}{2}} k
    x_{\frac{1}{2}} \qquad x_{\dfrac{1}{2}} \qquad \sum_{k=1}^{\frac{n}{2}} k

    参数、花括号,以及 \over 的扫描范围

    每条分数命令都恰好收两个参数,于是「只吃一个记号」这条规则要乘两次。\frac12 是完全合法的 TeX:两个参数各是一个记号,因此读作二分之一。\frac 1{x+1} 是 \frac{1}{x+1} 的可靠简写。但 \frac{1}{x}+1 与 \frac1x+1 都是「x 分之一,再加一」——+1 已经跑出分母了。分子或分母只要长过单个记号就得套花括号。忘了花括号,正是一条公式的尾巴本该压在横线之下却按满高印出来的头号成因。

    TeX 原语 \over 更阴,因为它压根不吃参数:它把所在组内左边的一切与右边的一切拦腰分开。{a+1 \over b-1} 没问题——花括号划定了扫描边界。a + {1 \over b} 也没问题——内层组把它圈住了。但 a + 1 \over b 会静悄悄搭出一座分子是 a+1 的分数,比你打算的高出一层,而塞进 \frac 那种宏里时,这个错误还会一路往外扩散。接手老 TeX 源码时,把 \over 换成 \frac{}{} 是实打实的纠错,不是风格偏好。

    深层嵌套还挂着另一张失败面孔:\frac{\frac{1}{2}}{3} 把里层分数放进 scriptstyle,小,但仍可辨;再往里两层的 scriptscriptstyle 就辨不出来了。要么改用斜杠重写,要么把里层那个量提出来命名。

    \frac{1}{x+1} \qquad \frac 1{x+1} \qquad \frac{1}{x}+1
    \frac{1}{x+1} \qquad \frac 1{x+1} \qquad \frac{1}{x}+1
    a + {1 \over b} \qquad {a+1 \over b-1}
    a + {1 \over b} \qquad {a+1 \over b-1}

    成段文字里的分数:斜杠、tfrac,或者干脆不要

    行内数学只有一条硬约束:不许把行撑高。text 样式下的 \frac 已经吃掉一点行距;句子里放一个 \dfrac,换来的是两行之间一道看得见的裂缝,而且不会有审稿人告诉你段落间距坏了——他们只会觉得这一页读起来难受。所以写正文时:\frac 留给真正结构性的比,数字很短就上 \tfrac,单纯的数值比干脆用一个斜杠。

    斜杠不是敷衍。数学模式里的 1/2 排得紧凑、两侧不带空格,在讲黄金比例或半衰期的句子里读起来完全正常。当分数本身就是被讨论的对象时写 \frac{1}{2};它只充当定语时写 1/2。遇到倒数幂,在成段文字里与其堆成上下两层,不如用 x^{-1}、(a+b)^{-1}——指数形式更短、保住行距,而且只要底数括起来就没有歧义。

    两块宏包补齐这套选择。xfrac 宏包的 \sfrac{1}{2} 给出真正的文本分数:一道斜杠配一小坨堆叠的数字,多数期刊行间的数值比用的就是它。units/nicefrac 的 \nicefrac{1}{2} 干同一件活,设计略有差别。两者都只有 text 样式,都不该出现在行间公式里。

    \frac{1}{2} + \frac{1}{3} = \frac{5}{6} \qquad 1/2 + 1/3
    \frac{1}{2} + \frac{1}{3} = \frac{5}{6} \qquad 1/2 + 1/3
    \documentclass[11pt,a4paper]{article}
    \usepackage[T1]{fontenc}
    \usepackage{amsmath,amssymb}
    \usepackage{xfrac}          % \sfrac: a slashed fraction for running text
    
    \title{Fractions: style, size and placement}
    \author{A. Student}
    \date{\today}
    
    \begin{document}
    \maketitle
    
    \section{The same source in four contexts}
    Inline, plain \verb|\frac|: the ratio $\frac{a+b}{c+d}$ sits on the axis
    and the line opens a little. Inline, \verb|\tfrac|: the ratio
    $\tfrac{a+b}{c+d}$ costs no extra leading. Inline, \verb|\dfrac|:
    $\dfrac{a+b}{c+d}$ pushes the paragraph apart --- the box is taller than
    the line, so TeX has no choice. Inline, \verb|\sfrac| from the
    \texttt{xfrac} package: $\sfrac{a+b}{c+d}$.
    
    \section{A display sets one storey, nesting sets two}
    \[
      \frac{1}{1 + \dfrac{1}{2}} = \frac{2}{3},
      \qquad\text{against}\qquad
      \frac{1}{1 + \frac{1}{2}} = \frac{2}{3}.
    \]
    Same value, different typography: a fraction's own numerator and
    denominator are set one style down, so the inner \verb|\frac| collapses to
    text style unless you ask for \verb|\dfrac| explicitly.
    
    \section{Cells of cases and array are text style}
    \[
      g(x) =
      \begin{cases}
        \dfrac{x^{2}+1}{x-1} & x \ne 1,\\[4pt]   % \dfrac rescues the cell
        0                    & x = 1.
      \end{cases}
    \]
    
    \section{Continued fractions}
    \[
      \varphi = 1+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1+\ddots}}},
      \qquad
      \sqrt{2} = 1+\cfrac{1}{2+\cfrac{1}{2+\cfrac{1}{2+\ddots}}}
    \]
    \verb|\cfrac| keeps every level at display height and full width; its
    optional \verb|[n]| or \verb|[d]| argument says which box is the alignment
    reference when the numerator and the denominator differ in height.
    
    \end{document}

    不带横线的分数,与自定粗细的横线

    二项式系数就是一座把横线抽掉的分数:在 amsmath 里 \binom{n}{k} 是一次 \genfrac 调用,配圆括号、零粗细横线与 text 样式;\dbinom 与 \tbinom 是它的 display 与 text 变体。要是写成 \frac{n!}{k!(n-k)!} 再手工裹一层方括号,算术对了而版式错了,因为 \frac 会添上一道横线,那对外括号也拿不到二项式该有的围栏间距。

    这些命令底下统一的通式是 \genfrac{⟨left⟩}{⟨right⟩}{⟨thickness⟩}{⟨style⟩}{⟨num⟩}{⟨denom⟩},它顺手解决了好几件别人只能硬凑的事。厚度取零,得到没有横线的上下堆叠对(\genfrac{}{}{0pt}{}{a+n}{b+n})——一个不该长得像分数的比,诚实的写法就这个。取 0.08em,是早期欧陆排版里那种更细的横线。样式位接受 0 到 3,对应 display 一路到 scriptscriptstyle,或者 -1 表示「沿用外层」。定界符本身就是参数的一部分,所以 \binom 不必动用 \left 和 \right 也拿到尺寸正确的括号。另外 \genfrac 是货真价实的 amsmath 宏,在你的文档里稳当;别的渲染器对它支持参差,贴进网页表单前先验一次。

    连分数这一族,\cfrac 就是全部答案,而它那个可选参数恰恰是没人读的部分:取 n 或 d,用来说明当分子与分母高度不等时以哪只盒子为对齐基准——1+\cfrac[d]{1}{2+\cfrac{1}{2+\ddots}} 让各层沿分母排齐,而不是把每一对各自居中;后者正是拿普通 \dfrac 硬套连分数会出的错。

    \binom{n}{k} = \frac{n!}{k!\,(n-k)!} \qquad \dbinom{n}{k}
    \binom{n}{k} = \frac{n!}{k!\,(n-k)!} \qquad \dbinom{n}{k}
    \genfrac 的定界符只是普通的参数文字:前两个槽位传 \langle 和 \rangle,而不是 \left/\right。
    \genfrac{}{}{0pt}{}{a+n}{b+n} \qquad \genfrac{\langle}{\rangle}{0pt}{}{x}{y}
    \genfrac{}{}{0pt}{}{a+n}{b+n} \qquad \genfrac{\langle}{\rangle}{0pt}{}{x}{y}

    定界符、碰撞,以及高度这张账单

    分数是一只高盒子,而凡是要去量这只盒子的东西都会继承这个高度。\left(\frac{a}{b}\right) 是最典型的一例:\left 按整只盒子给围栏定尺寸,于是括号比周围数学大上一两档,运算符两侧还各多出一道看得见的缝。版式上正确的做法是用眼睛挑一档——行内 \bigl(\tfrac{a}{b}\bigr),行间 \Bigl(\frac{a}{b}\Bigr)。完整的档位梯子在括号那一课。

    另一个由分数主宰纵向空间的地方是导数记号:\frac{\mathrm{d}y}{\mathrm{d}x} 与 \frac{\partial^{2} f}{\partial x \, \partial y} 在你还没加下标之前就已经是两层盒子,所以只要文档里有微分方程,导言区就值得定义 \pd{}{} 这一类的宏和配套的 \tfrac 版本。否则裹在 \left(\dots\right)_{x=0} 里的一个二阶导数,给你的围栏会比整句话还高。

    最后是间距:TeX 本来就把分数当作 ordinary 原子,所以 x \frac{1}{2} 不需要任何空格命令;而 \frac{1}{2}x 则是货真价实的歧义——你说的是 x 的一半,还是 \frac{1}{2x}?想清楚是哪一种再落笔:前者写 \frac{x}{2},后者靠一对花括号或一个斜杠。这类歧义活过校对的概率,比一个括号写错高得多。

    \left(\frac{a}{b}\right)^{2} \qquad \Bigl(\frac{a}{b}\Bigr)^{2} \qquad \bigl(\tfrac{a}{b}\bigr)^{2}
    \left(\frac{a}{b}\right)^{2} \qquad \Bigl(\frac{a}{b}\Bigr)^{2} \qquad \bigl(\tfrac{a}{b}\bigr)^{2}
    \frac{\mathrm{d}y}{\mathrm{d}x} \qquad \frac{\mathrm{d}^{2}y}{\mathrm{d}x^{2}} \qquad \frac{\partial^{2} f}{\partial x \, \partial y}
    \frac{\mathrm{d}y}{\mathrm{d}x} \qquad \frac{\mathrm{d}^{2}y}{\mathrm{d}x^{2}} \qquad \frac{\partial^{2} f}{\partial x \, \partial y}
    \documentclass[11pt,a4paper]{article}
    \usepackage[T1]{fontenc}
    \usepackage{amsmath,amssymb}
    \usepackage{mathtools}
    
    % --- Derivative fractions: one macro, one size, everywhere ---
    \newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}}        % display size
    \newcommand{\vpd}[2]{\tfrac{\partial #1}{\partial #2}}     % text size, for prose
    \newcommand{\ppd}[2]{\frac{\partial^{2} #1}{\partial #2^{2}}}
    \newcommand{\vppd}[2]{\tfrac{\partial^{2} #1}{\partial #2^{2}}}
    \newcommand{\od}[2]{\frac{\mathrm{d}#1}{\mathrm{d}#2}}
    \newcommand{\dd}{\mathop{}\!\mathrm{d}}                    % roman differential
    
    % --- A ratio with no rule: \genfrac{L}{R}{thickness}{style}{num}{den} ---
    \newcommand{\ratio}[2]{\genfrac{}{}{0pt}{}{#1}{#2}}
    
    % --- Delimiters that remember the sizing policy ---
    \DeclarePairedDelimiter{\abs}{\lvert}{\rvert}   % \abs{} manual, \abs*{} auto
    \DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
    \newcommand{\eval}[2]{\left.#1\right\vert_{#2}} % evaluation bar
    
    \title{A fraction preamble}
    \author{A. Student}
    \date{\today}
    
    \begin{document}
    \maketitle
    
    For the heat equation, prose writes $\vpd{u}{t} = \kappa\,\vppd{u}{x}$ and a
    display writes
    \[
      \pd{u}{t} = \kappa\,\ppd{u}{x}.
    \]
    Defining both sizes once is what keeps a long document from setting the same
    symbol three different ways. The rule-less ratio is then just
    \( \ratio{a+n}{b+n} \), and a continued-fraction chain can be checked
    against \verb|\cfrac| rather than rebuilt by hand.
    
    Test the delimiter policy on identical content:
    $\abs{\frac{1}{2}}$ versus $\abs*{\frac{1}{2}}$, and
    \( \eval{\frac{x^{2}}{2}}{0}^{1} = \frac{1}{2} \).
    
    \end{document}

    本课速查

    每节抽一行关键代码:点小节名跳到对应位置,代码一键复制。

    小节 关键代码
    \frac{a+b}{c+d}
    \dfrac{\partial u}{\partial t} = \kappa \, \dfrac{\partial^{2} u}{\partial x^{2}}
    \sum_{n=1}^{\infty} \frac{1}{n^{2}} \qquad \sum_{n=1}^{\infty} \dfrac{1}{n^{2}}
    \frac{1}{x+1} \qquad \frac 1{x+1} \qquad \frac{1}{x}+1
    \documentclass[11pt,a4paper]{article}
    \binom{n}{k} = \frac{n!}{k!\,(n-k)!} \qquad \dbinom{n}{k}

    常见错误

    • 在正文里用 \dfrac。它是一只在绝不该长高的行里的行间尺寸盒子,于是段中裂开一道洞。行内改用 \frac 或 \tfrac,把 \dfrac 留给 cases、array 的单元格和自身又是分数的分子。
    • 漏写花括号:\frac 1x + 1 印出来是 x 分之一再加一,因为不带括号的参数只吃恰好一个记号。只要分子或分母长过单个记号,两个参数就都得包起来。
    • 以为 \sum_{k=1}^{\frac{n}{2}} k 或 x_{\frac{1}{2}} 里的分数还能保住满尺寸。上下标按定义就是 scriptstyle;要么把界限改写成斜杠形式,要么认下 \dfrac 带来的碰撞。
    • 在更大的表达式里使用原语 \over:a + 1 \over b 会一路扫到所在组的末尾,静悄悄搭出一座比预期更高的分数。老源码请统一转成 \frac{}{}。
    • 该写 \binom 的地方给分数手工裹上括号,或者一对手工的 \bigl( \bigr) 就够的地方偏要写 \left( \right)——自动撑高的量法就是那座分数盒子,必然过头。
    • 把一座高 \frac 留在 cases 的某一支里,然后纳闷各支的条件为什么高低不齐:cases 的单元格是 textstyle,分数需要 \dfrac,换行处还需要 [4pt] 才不至于让上下两支贴在一起。

    关于本课的常见问题

    \frac、\dfrac 和 \tfrac 在 LaTeX 里到底有什么区别?
    \frac 按当下已经生效的样式搭分数:在 \[ … \] 里是满高,在 $ … $ 里是压扁的那一档。\dfrac 与 \tfrac 是 amsmath 的包装,只为这一个分数强制 displaystyle 或 textstyle。别的一模一样——同样的两只盒子,同样搁在数学轴上的那道横线。
    为什么我的分数放进求和上限或下标里就那么小?
    因为上下标按 scriptstyle 排,比 textstyle 低一级,分数的净空参数跟着一起收紧。\dfrac 能把尺寸顶回来,代价是盒子比运算符还高,界于是撞上去。版式上的正解通常是重写界限(k \le n/2),或者给那个量起个名字。
    什么时候该用 \cfrac 而不是 \frac?
    连分数,以及任何分子或分母自身又是一座分数的堆叠比。\cfrac 把两个参数都按 display 样式排,嵌套分数因此保住完整宽度;它可选的 [n] 或 [d] 参数则在两侧高度不等时指定拿哪只盒子做对齐基准。
    怎么写一个不带横线的分数?
    amsmath 的 \genfrac{}{}{0pt}{}{a}{b} 给出的正是零厚度横线的上下堆叠对;\binom 就是这么定义的,只是前两个参数换成了圆括号。行内一个普通的比就用斜杠:1/2,或者 xfrac 宏包的 \sfrac。
    分数外面那对括号为什么大得离谱?
    \left 和 \right 是按你包进去的东西的整体外框定尺寸的,而分数是一座两层盒子。尺寸自己挑——\bigl( \tfrac{1}{2} \bigr)——括号就不再跟正文里的数学抢视线。
    \frac12 里的花括号是必须的吗?
    不是:不带括号的参数恰好各取一个记号,所以 \frac12 是二分之一,\frac 1x 是 x 分之一。某个参数一长过单个记号就必须加括号——\frac{1}{x+1}——省掉它,尾巴项就会从分母里逃出去。

    实时演示:直接编辑 LaTeX,立刻看渲染结果

    预览随输入实时更新——不妨故意写坏一次,看看报错长什么样。

    KaTeX 错误
    试一个例子

    继续读

    同一个东西的三个入口:记法本身、讲它的那一课、以及真正用它写东西的一篇文章。