Fractions, roots and sums
LaTeX Lesson 6 1:59 English narration · English + 中文 subtitles burned in
Chapters
Transcript
Before the maths, one new idea: a package.
在讲数学之前,先来一个新概念:宏包。
A package adds commands LaTeX does not have on its own, and you load it in the preamble with usepackage.
宏包给 LaTeX 添加它自己没有的命令, 你在导言区用 \usepackage 加载它。
Amsmath is the standard maths one, written by the American Mathematical Society, and almost every maths document loads it.
amsmath 是标准的数学宏包,由美国数学学会编写, 几乎每一份数学文档都会加载它。
One line, and the rest of this lesson becomes available.
一行,这一课剩下的内容就都可以用了。
A fraction is frac with a top and a bottom, in two sets of braces.
分数是 \frac,带一个分子和一个分母,写在两组花括号里。
The bar is drawn for you, and both halves are sized and centred over it — even when the top is a whole expression like a plus b.
分数线由它替你画出,上下两部分也都被排好大小、对着线居中—— 哪怕分子是 a+b 这样一整个表达式。
A square root is sqrt, and the sign stretches over it, however long the thing inside is.
平方根是 \sqrt,而根号会伸展开来罩住它, 不管里面那个东西有多长。
They nest happily.
它们可以放心地互相嵌套。
A root of a fraction, or the other way round — a fraction whose top is a root.
根号里套一个分数,或者反过来——分子是一个根号的分数。
And look at the sizes: the inner fraction is set smaller, the root sign grew to cover it, and nothing had to be resized by hand.
再看那些大小:内层的分数被排得更小, 根号也长大到能罩住它,而没有任何东西需要手动调整尺寸。
That is a large part of why papers are written this way rather than drawn.
这在很大程度上就是论文用这种方式写、而不是画出来的原因。
Two more that grow.
还有两个会变大的。
Sum draws a big sigma; write int for an integral instead and you get the tall integral sign.
\sum 画一个大的西格玛;换成 \int,你就得到那个高高的积分号。
Both take limits, and here is the pleasant part: they use the same underscore and caret you already know from powers.
两者都可以带上下限,而让人高兴的是: 它们用的就是你已经从幂那里认识的下划线和尖号。
Underscore sets the lower and upper limits are set by the caret.
下划线设下限,上限由尖号设。
Four things to take with you.
带走四点。
One: load amsmath once, in the preamble.
第一:amsmath 在导言区加载一次就够。
Two: frac takes a top and a bottom and draws the bar.
第二:\frac 接一个分子一个分母,并画出分数线。
Three: sum and int grow to the size they need.
第三:\sum 和 \int 会长到它们需要的大小。
Four: underscore and caret set the limits.
第四:下划线和尖号设定上下限。
Now write the formula and press Run.
现在把那个公式写出来,然后按 Run。