latex的每一行称作为语句(statement)
语句(statement)又分为以下三种:
- 命令(command)
- 普通命令(normal command)
- 普通命令以
\作为开头,通常只有一行。
- 普通命令以
- 环境 (environment)
- 环境包含开头(start)和结尾(end),二者成对出现,通常在多行的情况下使用。
- 普通命令和环境命令可以一起使用
- 普通命令(normal command)
- 数据(data)
- 数据是我们需要书写的内容
- 注释(comment)
- 以
%作为开头,在编译的时候注释的内容会被忽略。
- 以
latex文档的结构
latex文件通常以.tex作为结尾,.tex源文件中包含三个部分:
- 文档声明(document class)
- 包括article, letter, report, book四种类型
- 序言(preamble)
- 设置包(package),定义命令(command),设置环境(environment)
- 正文(main text)
- 正文写在
\begin{document}与\end{document}之间
- 正文写在
写一份latex文档时,首先我们需要写文档声明,然后写序言。序言包括一些包(package),有时也会定义一些命令,设置一些环境。我们实际需要写的文本则会放到正文。
语法示例
\documentclass[options]{class} %文档类的声明
\usepackeage[options]{packagge} %引入的宏包
...
\begin{document} %正文
...
\end{document}
LATEX 文档分为四类,article,book,report,和letter。
article和letter类可以有 part,section,subsection等,但是没有chapter。摘要紧接着标题位于第一页上。report类可以有 part,chapter,section,subsection等,也有abstract,且abstract于单独一页上,有页码。book类可以有 part,chapter,section,subsection等,但没有abstract。
对于会议和期刊的文章,使用的类别通常是article和letter类;对于学位论文,用 report或是book类型。但是建议使用report类,比如dlut学位论文模板用的是report类。此外使用演示文稿时,会用到slide,不过 slider不是标准的文档类,而是一个environment。
Available document structure commands:
Book: \part{}, \chapter{}, \section{}, \subsection{}, \subsubsection{}, \paragraph{}, \subparagraph{}.
Report: \part{}, \chapter{}, \section{}, \subsection{}, \subsubsection{}, \paragraph{}, \subparagraph{}.
Article: \part{}, \section{}, \subsection{}, \subsubsection{}, \paragraph{}, \subparagraph{}.
Letter: A letter does not know the same structuring commands as other formats, but more specific commands like \signature{}, \address{}, \opening{} and \closing{}.
Except \part{}, all structuring commands build a hierarchy. They have a standard formating and numeration.
Other less common document-classes:
“proc” for a protocol (two columns by default and smaller borders on the left and right)
“slides” for a presentations
“minimal, a prototype for your own document type
You can always change the standard document types, by adapting the *.cls-file to your needs.
经常使用的相关配置
10pt, 11pt, 12pt 正文字体(Maintext font )默认设置为10pt.LaTeX 基于正文的字体来设置use adjust the font for title,chapter heading and etc based on the main text font.
letterpaper, a4paper 纸张大小(Papersize)默认设置为 letterpaper。
notitlepage, titlepage 这两个配置决定写完标题之后是否另起一页再来写剩下的内容(也就是是否有标题页)。对于article,默认设置为notitlepage(无标题页);对于 report和 book,默认是 titlepage(有标题页)。
onecolumn,twocolumn 默认设置为onecolumn (除了book之外的所有类别)
本文许可证
本仓库遵循 CC BY-NC-SA 4.0(署名 - 非商业性使用 - 相同方式共享) 协议,转载请注明出处,不得用于商业目的。

2万+

被折叠的 条评论
为什么被折叠?



