Skip to content

Maths — your first formula

LaTeX Lesson 5 1:59 English narration · English + 中文 subtitles burned in

space play · ←/→ 5s · j/l 10s · f fullscreen · ,/. speed

Chapters

Transcript
This is what LaTeX is famous for. 这就是 LaTeX 出名的原因。
Put dollar signs around something and everything between them is set as MATHS. 在某段东西两边加上美元符号,它们之间的一切就会按"数学"来排版。
Look at what changes: the letters lean, the spacing around the equals sign opens up, and the two lifts into a power. 看看什么变了:字母变斜了,等号周围的间距张开了, 而那个 2 升上去变成了幂。
Maths mode is a different typesetter, with its own rules about all of that. 数学模式是另一个排版器,关于这一切它有自己的规则。
Two keys do most of the work. 两个键干了大部分活。
A caret raises what follows into a power. 尖号把后面的东西抬上去变成幂。
An underscore lowers it into an index. 下划线把它压下去变成下标。
And you can use as many as you like in one formula — x squared plus y squared equals r squared is three carets in one line, and LaTeX sizes and places every one of them. 而在一个公式里你想用多少个都行—— x² + y² = r² 一行里就有三个尖号, 而它们的大小和位置全都由 LaTeX 安排。
Here is the trap. 这里有个坑。
A caret takes exactly one thing. 尖号只接受恰好一样东西。
Write x caret one zero and only the one goes up — the zero stays on the line, and you get something that looks nearly right and is wrong. 写 x^10,只有那个 1 会上去——0 留在了基线上, 于是你得到一个看起来几乎对、其实是错的东西。
For more than one character, group them with braces. 多于一个字符时,用花括号把它们括起来。
That is what braces are for throughout LaTeX: they turn several characters into one thing. 这就是花括号在整个 LaTeX 里的用途: 它们把好几个字符变成"一样东西"。
For an important equation you do not want it squeezed into a line of prose. 对于一个重要的公式,你不会希望它被挤在一行散文里。
Use backslash square bracket instead of dollars and it becomes DISPLAY maths: its own line, centred, set larger, with space above and below. 用 \ 代替美元符号,它就变成了"独立公式": 自己占一行、居中、字号更大、上下都留出空白。
Same formula, different presentation — and the choice says how important it is. 同一个公式,不同的呈现方式—— 而这个选择本身就说明了它有多重要。
Four things to take with you. 带走四点。
One: dollars put maths inside a sentence. 第一:美元符号把公式放进句子里。
Two: square brackets put it on its own centred line. 第二:\ 把它放到独立的一行、居中。
Three: a caret raises a power and an underscore lowers an index. 第三:尖号抬起幂,下划线压下下标。
Four: more than one character needs braces around it. 第四:多于一个字符时要给它加花括号。
Now write your formula and press Run. 现在把你的公式写出来,然后按 Run。

Log in or create account

IGCSE, A-Level & AP