Verbatim https://www.dazhuanlan.com/2019/08/26/5d62feafd7a14/
The main contents of this paper are:
- The basic structure of the article LaTeX
- Method of generating directory
- Cross-reference method
- Insert lists, tables, images method
LaTeX provides many articles to make more orderly way, such as support for chapter markers articles automatically generated catalog. Next each of these methods.
Chapters, sections and paragraphs
In our commonly used article
class, LaTeX support article marked by the following command organizational structure: section{·}
, subsection{·}
, subsubsection{·}
, paragraph{·}
, subparagraph{·}
. Their relative size decreases from left to right.
In the not too much use book
, there chapter{·}
and part{·}
.
Below is an example.
1 |
a header section {} |
table of Contents
Zhang introduced in the text, marking the festival, we can use in the text area tableofcontents
to let LaTeX automatically generates lists of articles.
Below is an example.
1 |
ctexart} {DocumentClass |
This is the output of the above example:
cross reference
At the time of writing the article always encounter similar expressions need "shown in the following map". You can more easily and accurately in LaTeX in to do this. We can use label{marker}
, ref{marker}
and pageref{marker}
to be cross-referenced to our chart, formula paragraphs. Which were wrapped in braces marker
is our own choice as an object code, cross-reference when Always make sure you entered the correct code.
Environment and the floating body
LaTeX environment is a content carrier in order to achieve a special layout designed for the purpose. We use such statements in LaTeX to achieve their own ends:
1 |
begin {environment} |
List
We have three list context, namely, to generate a list of free numbers itemize
, have generated a list of numbers enumerate
and can add a description of the description
environment. These lists can be nested (though sometimes ineffective), just as the following examples show.
1 |
{} the enumerate the begin |
This is the output of the above example:
Align
LaTeX There are three basic environment for alignment, respectively flushleft
, flushright
and center
, and alignment in Microsoft Word is not much difference in their use, simple and intuitive. Below is an example.
1 |
begin {flushleft} |
This is the output of the above example:
Quote
In LaTeX, there are several pre-set layout is a good environment to simplify the workload of citations. When referring to a short sentence, we can use the quote
environment; when referring to a longer more paragraphs, we can use quotation
to indent environment that will paragraph; when referring to poetry, we can use verse
environment. The following is an example.
1 |
总工程师曾说: |
这是上面例子的输出结果:
逐字输出
有些时候(比如编程教程),我们需要将一些字符原封不动地输出,让LaTeX无视其中的所有命令。这个时候verbatim
环境就非常有用了。在begin{verbatim}
和end{verbatim}
之间的文本将直接输出,包括所有的换行符和空格,就像在打字机上键入一样,不会执行任何LaTeX命令。当然,如果只是需要在一个段落中使用这个环境,也有相应的简化版命令verb+·+
来完成,下面是一个例子。
1 |
在段落中,该功能可由verb|verb+text+|完成。+仅是分隔符的一个例子。除了*或空格,可以使用任意一个字符。 |
这是上面例子的输出结果:
浮动体
在一篇文章中,插图和表格通常需要占据大块空间,同时也不可被分割;所以在文字处理软件中我们经常需要调整他们的位置。figure 和 table 环境可以自动完成这样的任务;这种自动调整位置的环境称作浮动体(float)。
表格
在LaTeX中,tabular
环境能够用来绘制最基础的表格。我们可以用这样的命令来进入tabular
环境:begin{tabular}{table spec}
。其中第二个花括号里面的table spec
定义了表格的样式。
在这个环境中:hline
命令表示横线,|
表示竖线;用&
来分列,用\
来换行;每列可以分别采用居左、居中、居右等横向对齐方式,分别在{table spec}
里面用l、c、r来表示。
下面是一个例子:
1 |
begin{tabular}{|l|c|r|} |
这是上面例子的输出结果:
而进阶的table
环境则支持增加标题、标签,并且是一个浮动体,在排版上更加智能。
图片
在LaTeX中插入图片建议使用graphicx
宏包。插入图片的基础命令是:includegraphics[key=value, ...]{filename}
。在插入图片时,有几种可选参数可以调节,分别是:
- width:把图形缩放到指定的宽度
- height:把图形缩放到指定的高度
- angle:逆时针旋转图形
- scale:缩放图形
下面是一个例子:
1 |
begin{figure} |
这是上面例子的输出结果:
重磅预告
下一期教大家如何快速简便地在LaTeX里画结构式和反应式,请大家敬请期待!!!