注意, \\\\ 代表“强制换行”。 再新起一行,加上日期:
C-c C-m date C-j C-c C-m today C-j
其实,没有 \\date{\\today} 这一句系统会自动把今天的日期添加上的。而且 \\date{} 里面也不一定非要是当天的日期。 title, author, date 一般被叫做文章的 top matter 。 再新起一行,写
\\maketitle C-j
\\maketitle 自然是要排版 top matter 了。换句话说,不要标题的话可以省略掉这个命令。现在文章变成了这样:
1: \\documentclass{article} 2:
3: \\begin{document}
4: \\title{How to Structure a \\LaTeX{} Document} 5: \\author{Andrew Roberts\\\\ 6: School of Computing,\\\\ 7: University of Leeds,\\\\ 8: Leeds,\\\\
9: United Kingdom,\\\\ 10: LS2 1HE\\\\
11: \\emph{andyr@comp.leeds.ac.uk}} 12: \\date{\\today} 13: \\maketitle 14:
15: \\end{document}
好奇的话,现在可以编译一下,看看PDF文件的效果:
C-c C-c C-j C-c C-v
如果你的 xpdf 没出毛病的话,一个PDF文件应该显示在屏幕上了。如果 xpdf 不正常,那么就打开命令行,敲:
evince simple.pdf &
效果还满意吧?保持你的好奇心。在下面的操作中,你随时可以编译一下看看效果。
好了,回到Emacs。现在你的光标应该停在 \\maketitle 的下面一行。我们开始写“摘要”部分。敲键盘
C-c C-e
前面我们已经见到过 C-c C-e 了,就是要开始一个“环境”。接着来, mini buffer 里现在又有提示了:
Environment type: (default itemize)
是在问你要开始那种环境啊?默认是开始 itemize 环境,因为它是最常用的环境。但我们现在要写的是“摘要”,告诉它:
abstract C-j
abstract 就是“摘要”的意思。科技论文都是要有摘要的嘛。于是,你的文章变成了这样:
1: % 此处略去十数行 2:
3: \\maketitle 4:
5: \\begin{abstract} 6: |
7: \\end{abstract} 8:
9: \\end{document}
光标停在 \\begin{abstract} 和 \\end{abstract} 之间(第6行)。好,现在往摘要部分里填点东西:
1: % 此处略去十数行 2:
3: \\maketitle 4:
5: \\begin{abstract}
6: In this article, I shall discuss some of the
fundamental topics in
7: producing a structured document. This document itself does not go into
8: much depth, but is instead the output of an example of how to implement
9: structure. Its \\LaTeX{} source, when in used with my tutorial
10: provides all the relevant information. 11: \\end{abstract} 12: 13: |
现在,我们要接着上面的例子,写更多更长的东西了。为了编号方便,文章末尾的 \\end{document} 我也不再写出来了。
好, 按 C-n 把光标移到 \\end{abstract} 的下一行。让我们开始文章的第一节:
C-c C-s
s 代表 section, “节”的意思。 mini buffer 提示:
Level: (default section)
也就是问你,是不是要起一个新 section 啊?没错,我就是要起一个新的章节,于是直接 C-j 。 mini buffer 又提示:
Title:
也就是问你,章节标题是……?那就给它个标题吧,就叫“ Introduction ”。 C-j 之后, mini buffer 继续提示:
Label: sec:introduction
这是在问你,要不要给这个新章节打个标签,比如 sec:introduction, 以后也许要索引到它呢?这个暂时无关紧要, C-j 就是了。(第18行)
14: % 此处略去十数行 15:
16: \\end{abstract} 17: