Sections and titles
LaTeX Lesson 2 2:00 English narration · English + 中文 subtitles burned in
Chapters
Transcript
Real documents are split into sections so a reader can follow them, and the command is simply section with the title in braces.
真实的文档会被分成若干节,好让读者跟得上, 而命令就是 \section,标题放在花括号里。
Look at what came out: a heading in a larger face, and a number in front of it.
看看出来的结果:一个更大字号的标题,前面还有一个编号。
You did not type a one or a two — LaTeX counted them, and that is the whole point of using the command instead of just writing a big heading.
你没有敲那个 1 或 2——是 LaTeX 数出来的, 而这正是用这条命令、而不是直接写一个大标题的全部意义。
And here is why that matters.
而这里就是它之所以重要的原因。
Add a section in the middle and everything below it moves: Method becomes three, Results becomes four.
在中间插入一节,它下面的一切都会移动: Method 变成 3,Results 变成 4。
That happened with no edit of yours.
这一切的发生,你一处都没有改。
In a word processor you would have retyped every number below the insertion, and missed one.
在文字处理软件里,你得把插入点下面的每一个编号都重打一遍,然后漏掉一个。
Inside a section you can go one level down with subsection, and it is numbered inside its parent — two point one, two point two.
在一节里面,你可以用 \subsection 再下一级, 而它的编号是在父级里面数的——2.1、2.2。
Notice the second number resets at the next section, so subsections of section three start again at three point one.
注意第二个数字在下一节开始时会重置, 所以第 3 节的子节又从 3.1 开始。
Same idea again: you describe the structure and LaTeX does the counting.
还是同一个道理:你描述结构,由 LaTeX 去数数。
A report usually opens with a title, an author and a date.
一份报告通常以标题、作者和日期开头。
Those are declared in the preamble — and remember from lesson one, the preamble prints nothing.
这些是在导言区里声明的——记得第 1 课说过,导言区什么都不打印。
So they sit there quietly until maketitle, in the body, puts them on the page.
所以它们安静地待在那里,直到正文里的 \maketitle 把它们放上页面。
If you write the title commands and forget maketitle, you get a document with no title and no error.
如果你写了标题那几条命令却忘了 \maketitle, 你会得到一份没有标题、也没有报错的文档。
Four things to take with you.
带走四点。
One: section makes a heading and numbers it for you.
第一:\section 生成标题,并替你编号。
Two: subsection nests inside, as 2.1 and 2.2.
第二:\subsection 嵌在里面,编成 2.1、2.2。
Three: insert one anywhere and everything renumbers.
第三:在任何位置插入一节,全体自动重新编号。
Four: title and author are declared in the preamble, and maketitle prints them.
第四:标题和作者在导言区声明,\maketitle 负责打印它们。
Now build the outline and press Run.
现在把大纲搭出来,然后按 Run。