LaTex 入門


LaTex 入門

 

LaTex簡介

TeX 是由Donald Knuth創造的基於底層編程語言的電子排版系統[1](TEX是Honeywell公司在1980年為其Text Executive文本處理系統注冊的商標,它與 TeX是兩回事)。使用TeX可以對版面做精細的操作,生成精美的文檔。TeX提供版面編輯的底層命令,但是使用時操作復雜,工作效率不高. TeX允許用這些底層命令定義出可以執行復雜操作的擴展命令. LaTex是由Leslie Lamport開發的的TeX擴展命令集合[5]。LaTexj通過整合常用的版面設置操作,降低排版的工作量和難度。 LaTex 強大的排版功能,特別是對科技文檔的支持,已經使它成為撰寫科研論文的事實上的標准[5]。

TeX系統生成的是DVI(Device Independent)文件。隨着pdf文件格式的流形,LaTex在支持DVI文件格式的同時也可生成PDF格式文件。

TeX在不同的硬件和操作系統上有不同的實現版本。目前Unix/Linux上常用的TeX系統是teTeX,Windows中有MiKTeX和fpTeX。CTeX是中文套裝[4]。下面僅簡要介紹在使用LaTex中一些常見問題。

LaTex 與 Word

Word 是微軟公司推出的一款文檔和文字處理軟件,它也具有較強的排版功能。與LaTex相比,Word最大優勢是其"所見既所得"的特點,因而入門門檻低。另一方面Word的語法和拼寫錯誤檢查等能力比LaTex強。

LaTex作為一款排版系統,格式控制、公式編輯方面比Word好用。LaTex生成的文檔比Word文檔更美觀。LaTex的入門門檻比較高,使用LaTex不僅要編輯文本,整理文檔格式,還要處理編譯過程中出現的bugs,如果使用中文,更要注意GBK,UTF-8等文檔編碼這些瑣碎問題。另外LaTex做的幻燈片沒有Word做出來的好看。

LaTex 和 Word兩款軟件針對的用戶群體不一樣,在文字處理和文檔排版方面有不同的理念。 兩者在功能上有許多重合之處,各有優勢和不足。

LaTex 命令架構

Tex環境中,字符,圖片等內容都放在隱形的盒子(box)容器內。這些盒子根據Tex和Latex的默認規則以及相關命令粘結成更大的盒子。字符組合成單詞,單詞組合出語句。語句在放入頁面盒子時,根據版面格式分解成行列。

版面格式布置盒子在頁面中的位置,字符等文檔內容的位置是由它們在盒子中相對坐標確定。例如,一個字符盒子如下圖[20]所示。

width是盒子的寬度。基線(baseline)將盒子分割成上下兩部分。height和depth分別確定這兩部分的高度。 字符盒子基於基線相互粘結。

LaTex提供不同層次的命令幫助用戶設置文檔版面。它最底層是大約300個TeX基礎命令,例如 \hbox, \vskip等。

LaTex的核心是一組建立在TeX基礎命令上的宏命令,例如 \documentclass, \usepackage, \begin.等。

再往上就是類文件,例如foo.cls等。當\documentclass{foo}時,就是加載foo.cls文件。

再往上是擴展包, 例如pic.sty等。我們可以使用\usepackage命令加載擴展包。

安裝

Latex的衍生版本眾多,中文環境中常用的時CTex。下載地址為

http://www.ctex.org/CTeXDownload
1
Ctex套裝中自帶Latex編輯器WinEdt

LaTex文件格式簡介

TeX文件樣例

下面是一個TeX文件的簡單樣例:

This is an example of TeX file format.

An example of mathematical formulaion: $ ds = \sqrt{dx^2 + dy^2} $
\bye
1
2
3
4
編譯說明:
前提: 已經正確安裝TeX編譯環境,例如:LaTeX
操作步驟:

將上述內容保存在一文本文件中,例如: foo.tex.
在Windows控制台環境中,使用
tex foo.tex
1
既可生成相應的foo.dvi文件。

LaTex文件樣例

下面一個樣例[3]展示了LaTex文件的基本結構:

\documentclass[12pt, letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage{comment}

% Title
\title{Document Title}
\author{Nobody \thanks{Somebody}}
\date{Some Date}

\begin{document}

\begin{titlepage}
\maketitle
\end{titlepage}

\tableofcontents

\begin{abstract}
This is a simple paragraph at the beginning of the
document. A brief introduction about the main subject.
\end{abstract}

First document. This is a simple example, with no
extra parameters or packages included.

% Comments
\begin{comment}
This text won't show up in the compiled pdf
this is just a multi-line comment. Useful
to, for instance, comment out slow-rendering
while working on the draft.
\end{comment}

\end{document}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
LaTex文件結構

一個LaTex文件分為兩個部分:導言和正文。 在\begin{document}和\end{document }之間的是文檔的正文內容。 在\begin{document}之前的命令稱為preamble(導言)。 在preamble中通常定義文檔的格式、語言等。上文所示LaTex文檔其結構如下圖所示:


文件拆分

當文檔內容的結構復雜,需要分別保存在多個LaTex文件時,可以使用\input 或\include命令構建文檔結構。例如:

\input{filename1}
1
或者

\include{filename1}
1
[6]"\input{filename} imports the commands from filename.tex into the target file; it’s equivalent to typing all the commands from filename.tex right into the current file where the \input line is."

[6]"\include{filename} essentially does a \clearpage before and after \input{filename}, together with some magic to switch to another .aux file, and omits the inclusion at all if you have an \includeonly without the filename in the argument. This is primarily useful when you have a big project on a slow computer; changing one of the include targets won’t force you to regenerate the outputs of all the rest."

[6]"\include{filename} gets you the speed bonus, but it also can’t be nested, can’t appear in the preamble, and forces page breaks around the included text."

導言部分 LaTex命令簡介

preamble(導言)部分通常用於定義文檔的格式、語言等。常用的LaTex命令主要有\documentclass,\usepackage等。下面分別對幾個常用的命令做簡單介紹。

\documentclass

\documentclass命令是用於設置LaTex文件所生成文檔的格式. 其命令語法如下所示:

\documentclass[options]{class}
1
常用的文檔格式有:

Class 簡介
article 科技論文,報告,軟件文檔等
IEEEtran IEEE Transactions 格式.
proc 法律文書
report 長篇報告(如:學位論文)
book 書籍
slides 幻燈片
memoir 傳記
letter 信件
beamer PPT
文檔格式修正項

Options 簡介
12pt 文檔正文使用的字體大小(默認為10pt)
a4paper, letterpaper 頁面規格(默認為letterpaper或a4paper)
fleqn Typesets displayed formulas left-aligned instead of centered.
leqno Places the numbering of formulas on the left hand side instead of the right.
titlepage, notitlepage Specifies whether a new page should be started after the document title or not. The article class does not start a new page by default, while report and book do.
twocolumn Instructs LaTeX to typeset the document in two columns instead of one.
twoside, oneside Specifies whether double or single sided output should be generated. The classes article and report are single sided and the book class is double sided by default. Note that this option concerns the style of the document only. The option twoside does not tell the printer you use that it should actually make a two-sided printout.
landscape Changes the layout of the document to print in landscape mode.
openright, openany Makes chapters begin either only on right hand pages or on the next page available. This does not work with the article class, as it does not know about chapters. The report class by default starts chapters on the next page available and the book class starts them on right hand pages.
draft makes LaTeX indicate hyphenation and justification problems with a small square in the right-hand margin of the problem line so they can be located quickly by a human. It also suppresses the inclusion of images and shows only a frame where they would normally occur.
例如:

\documentclass[12pt, a4paper]{article}
1
意思是正文字體大小為12pt, 頁面規格是A4, 使用article文檔格式.

\usepackage

\usepackage命令設置在編譯LaTex文件時要導入的擴展包,例如:

\usepackage[utf8]{inputenc}
1
\usepackage{comment}
1
封面格式

\title{Document Title}
\author{Nobody \thanks{Somebody}}
\date{Some Date}
1
2
3
設置所要生成文檔的封面內容: 文檔名,作者,日期等(這只是設置了封面格式,生成封面的是\maketitle命令)。

注釋

% Comments
1
從百分號%開始到這一個行結束的部分是LaTex文件的注釋內容,不在編譯后生成的pdf文檔中顯示。
在\begin{comment}和\end{comment }之間也不在編譯后生成的pdf文檔中顯示。

保留字符

# $ % ^ & _ { } \
1
這些字符(reserved characters)在Latex中有特殊的意義,要想在生成的文檔中顯示這些字符,Latex文檔中這些字符前加反斜杠"\ \backslash\" :

\# \$ \% \^ \& \_ \{ \}
1
因為兩個反斜杠"\\"在Latex中是換行命令,可使用

$\backslash$
1
輸出反斜杠\ \backslash\

~波浪線(tidle)在LaTeX中是插入空格命令,可用數學公式環境的$ \sim $向TeX文檔中插入波浪線.

正文部分LaTex命令模塊簡介

生成封面

\begin{titlepage}
\maketitle
\end{titlepage}
1
2
3
按照在preamble中設置的封面格式生成文檔封面

生成目錄

\tableofcontents
1
生成文檔目錄

頁碼

設置頁碼數字類型

\pagenumbering{digit type}
1
其中digit type有:

arabic 阿拉伯數字(1,2,3,4),默認樣式
1
roman 小寫羅馬數字(i,ii,iii,iv)
1
Roman 大寫羅馬數字(I,II,III,IV)
1
alph 小寫拉丁字母(a,b,c,d)
1
Aiph 大寫拉丁字母(A,B,C,D)
1
設置頁碼可使用

\setcounter{page}{page number}
1
如果想讓當前頁不標頁碼,可使用

\thispagestyle{empty}
1
例如,如果在封面不標記頁碼,目錄頁使用小寫羅馬數字標記頁碼,正文部分使用阿拉伯數字標記頁碼

\begin{document}

%% Making title pate
\begin{titlepage}
\maketitle
\thispagestyle{empty}
\end{titlepage}

%% Contents
\pagenumbering{roman}
\tableofcontents

\newpage
\pagenumbering{arabic}
\setcounter{page}{1}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
版面設置

空白

下面是LaTex插入空格命令小結[24]

\, inserts a \thinspace (equivalent to .16667em) in text mode,
or \thinmuskip (equivalent to 3mu) in math mode;
\! inserts a negative \thinmuskip in math mode;
\> inserts \medmuskip (equivalent to 4.0mu plus 2.0mu minus 4.0mu) in math mode;
\; inserts \thickmuskip (equivalent to 5.0mu plus 5.0mu) in math mode;
\: is equivalent to \> (see above);
\enspace inserts a space of .5em in text or math mode;
\quad inserts a space of 1em in text or math mode;
\qquad inserts a space of 2em in text or math mode;
\kern <len> inserts a skip of <len> (may be negative) in text or math mode (a plain TeX skip);
\hskip <len> (similar to \kern);
\hspace{<len>} inserts a space of length <len> (may be negative) in math or text mode (a LaTeX \hskip);
\hphantom{<stuff>} inserts space of length equivalent to <stuff> in math or text mode.
Should be \protected when used in fragile commands (like \caption and sectional headings);
\ inserts what is called a "control space" (in text or math mode);
(直接鍵入空格) inserts an inter-word space in text mode (and is gobbled in math mode).
Similarly for \space and { }.
~ inserts an "unbreakable" space (similar to an HTML  ) (in text or math mode);
\hfill inserts a so-called "rubber length" or stretch between elements (in text or math mode).
Note that you may need to provide a type of anchor to fill from/to;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
段落行間距

使用{setspace}擴展包. 例如

\documentclass[UTF8]{article}
\usepackage{setspace}

\begin{document}

%%雙倍行間距
\begin{spacing}{2.0}
段落內容。
\end{spacing}

%%單倍行間距
\begin{spacing}{1.0}
段落內容。
\end{spacing}

\end{document}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
段落間空白

\hspace{1cm}
\vspace{5pt}
1
2
居中

\begin{center}
...
\end{center}
1
2
3
左對齊

\begin{flushleft}
...
\end{flushleft}
1
2
3
右對齊

\begin{flushright}
...
\end{flushright}
1
2
3
樣例

\begin{center}
登鸛雀樓 \\
~~~~~~~~ {\footnotesize 王之渙} \\
\hfill \\
白日依山盡 \\
黃河入海流 \\
欲窮千里目 \\
更上一層樓 \\
\end{center}

\begin{flushleft}
這一行在左側 \\
這一行也要在左側 \\
\end{flushleft}

\begin{flushright}
這一行在右側 \\
這一行也要在右側 \\
\end{flushright}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
效果如下圖所示


verbatim 居中顯示

verbatim環境(抄錄環境)使LaTex源文件的內容原樣呈現於最終文檔。這些內容不受center, flushleft, flushright等命令的影響。若想讓verbatim環境中內容居中顯示,需要使用 verbatimbox等擴展包.
首先在導言區加入:

\usepackage{verbatimbox}
1
用verbbox環境界定顯示內容,然后可通過\theverbbox引用這個verbbox環境對象。

\begin{verbbox}
#include <stdio.h>

void main()
{
printf("Hello World! \n");
}
\end{verbbox}

\begin{figure}[ht]
\centering %% 居中顯示
\theverbbox
\end{figure}
1
2
3
4
5
6
7
8
9
10
11
12
13
同理,也可以使用flushleft, flushright 等命令實現左對齊和右對齊等效果。

線框

使用\fbox給文字加線框; 使用\parbox給段落添加線框.

\fbox{A}

\hfill

\fbox{
Use $\backslash fbox$ environment for creating line box.
}

\begin{center}
\fbox{
Box lies in center. However
}
\end{center}

\begin{center}
\fbox{
\parbox{\textwidth}{
\begin{center}
This is a \\
Full size box \\
\end{center}
}
}
\end{center}

\begin{center}
\fbox{
\parbox{0.4\textwidth}{
\begin{center}
This is a \\
Small size box \\
\end{center}
}
}
\end{center}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
顯示效果如圖所示:


圖片插入及引用

下面樣例展示如何在文檔中插入圖片並在文中通過圖片編號引用圖片。

\usepackage[pdftex]{graphicx}
% 設置圖片文件存放路徑
\graphicspath{{../figures}

\begin{document}
% 在正文中引用圖片時使用\ref
In Figure \ref{fig:foo}
\begin{figure}
%設置對齊格式
\centering %圖片居於頁面中部
%指定圖形大小和圖形名稱
\includegraphics [width=0.8,height=2.5]{foo.png}
%設置標題
\caption{Foo}
%設置圖形引用名稱
\label{fig:foo}
\end{figure}

\end{document}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
有關插入圖形的更多設置請參閱[9]

表格

Latex中使用tabular環境定義表格, 例如[15]

\begin{tabular}{llr}
\hline
\multicolumn{2}{c}{Item} \\
\cline{1-2}
Animal & Description & Price (\$) \\
\hline
Gnat & per gram & 13.65 \\
& each & 0.01 \\
Gnu & stuffed & 92.50 \\
Emu & stuffed & 33.33 \\
Armadillo & frozen & 8.99 \\
\hline
\end{tabular}
1
2
3
4
5
6
7
8
9
10
11
12
13
表格對齊格式

首先要在第一行設置表格中各個單元對齊格式。

\begin{tabular}[pos]{table spec}
1
table spec選項

選項 釋意 樣例
l 左對齊 {l c r}
c 居中 {l c r}
r 右對齊 {l c r}
p{‘width’} 置頂 {l c p{5cm}}
m{‘width’} 縱向居中 {l c m{5cm}}
b{‘width’} 置底 {l c b{5cm}}
| 縱向分隔線 {l | c |r }
|| 縱向雙分割線 {|| l | c |r ||}
在table spec選項中可使用 >{\format} 設置字體

pos 選項通常用於設置表格單元中顯示內容相對於其基線的縱向位置.一般不使用這個選項.

從第二行開始設置表格每一行中列向單元的數量,對齊格式等相關配置.

選項 釋意
& 列分隔
\ 新列
\hline 畫一條水平線
\newline 在列中換行
\cline{i-j} 在水平方向從第 i 列 到 第 j 列畫橫線段
表格中行間距

\arraystretch 命令可以設置行間距(默認值是1.0),例如

\renewcommand{\arraystretch}{1.5}
1
使用\noalign{\smallskip} 也可以改變行間距. \smallskip 命令等價於\vspace{smallskipamount}。smallskipamount的大小依賴於文檔類型. 與\smallskip 命令類似的還有\medskip,\bigskip . 另外,也可以在每一行尾的 換行符 后設置行間距。 例如

\begin{tabular}{c}
\hline
Normal \\
\hline
smallskip(under the characters) \\ \noalign{\smallskip}
\hline \noalign{\smallskip}
smallskip(over the characters) \\
\hline \noalign{\medskip}
medskip \\
\hline \noalign{\bigskip}
bigskip \\
\hline
0.5cm \\[0.5cm]
\hline
\end{tabular}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
效果如圖所示


三線表樣例
Latex中默認的線條寬度是0.4pt, 如果想要使用粗一點的線條,可以使用 booktabs環境包. 這需要在Latex文檔的導言部分添加命令:

\usepackage{booktabs}
1
樣例如下所示

\begin{table}[h]
\centering
\begin{tabular}{ccc}
\toprule
Name & ID & Gender\\
\midrule
Tom & 001& Male\\
Rose & 002& Female\\
\bottomrule
\end{tabular}
\caption{這是一張三線表}
\end{table}
1
2
3
4
5
6
7
8
9
10
11
12
其中\toprule 命令是畫出表格最上邊的一條粗實線(rule). \bottomrule命令是畫出表格最下邊的一條粗實線.
\midrule 命令是畫出表格中間的細實線。 效果如下圖所示:


有關表格的更多設置請參閱[15]

浮動體

文檔中通常需要插入圖片或表格以輔助正文表述。圖片和表格的內容豐富,一般在一個頁面中縱跨多行,並伴有標題等輔助性內容。LaTex將一個圖片或表格當作單獨整體並定義為浮動體。
為了避免不合理的分頁,它們的顯示位置不受限於上下文坐標, LaTeX根據相應的算法插入到合適的位置。為了達到理想的排版效果,LaTeX算法可接受位置描述符等參數調配圖表位置。位置描述符有以下幾種:

描述符 期望位置
h 將浮動體放在這里(Latex會根據其排版美學做調整) Place the float here, i.e., approximately at the same point it occurs in the source text (however, not exactly at the spot) )
t 將浮動體放在頁的頂部 Position at the top of the page.
b 將浮動體放在頁的底部 Position at the bottom of the page.
p 將浮動體單獨成頁 Put on a special page for floats only.
! 忽略LaTeX的排版美學內置參數 Override internal parameters LaTeX uses for determining “good” float positions.
H 將浮動體強制放在這里 Places the float at precisely the location in the LaTeX code. Requires the float package,i.e., \usepackage{float}. This is somewhat equivalent to !ht.
畫圖

Latex中的繪圖工具有picture擴展包, tikz擴展包等. 其中picture擴展包是標准擴展包。正文中可直接使用picture包命令繪圖,而使用tikz擴展包時則需要在導言中添加

\usepackage{tikz}
1
( picture 和 CJK一起使用能正常編譯. tikz 和CJK兩個擴展包之間有兼容問題. 使用tikz 和CJKutf8的utf8編碼文件能正常編譯, 但不能在tikz環境中直接中文. 可以通過\mbox{}在tikz環境中插入中文字符 )
本節主要介紹的picture擴展包和tikz擴展包的基本繪圖命令.

picture擴展包

picture擴展包中命令主要分為兩類: 繪圖環境設置命令和繪圖命令。 繪制的基本圖形有: 直線段,帶箭頭直線段,二階貝塞爾曲線段,圓及橢圓等. 下面是一個picture擴展包使用樣例

\setlength{\unitlength}{1cm}
\thicklines
\begin{picture}(10,6)
\put(2,2.2){\line(1,0){6}}
\put(2,2.2){\circle{2}}
\put(6,2.2){\oval(4,2)[r]}
\end{picture}
1
2
3
4
5
6
7
繪圖環境設置命令

\begin{picture}(width,height)(x-offset,y-offset)
1
picture擴展包默認所繪制圖形的坐標范圍是二維矩形. width,height分別設定圖形繪制范圍的寬度和高度, 度量單位由

\setlength{\unitlength}{1cm}
1
設定 (\setlength不是 picture擴展包的命令). \unitlength 默認單位是 1pt.

x-offset和y-offset是\begin{picture}命令的可選項, 它們分別設定左下角點的橫向坐標值和縱向坐標值

picture中基本繪圖命令有

\put(x, y){object}
\qbezier(x1, y1)(x2, y2)(x3, y3)
\multiput(x, y)(dx, dy){n}{object}
1
2
3
基本圖形有:

線段

\put(x, y){ \line(x1, y1){length} }
1
{length} – 線段在水平方向投影長度(如果垂直線段,則是垂直方向投影長度)
(x1, y1) – 線段的方向向量. 方向向量中元素僅限於在(−6, −5, … , 5, 6) 中取值. x1 與 y1要互質. 因此,方向向量總計只有25個,如下所示:

\setlength{\unitlength}{5cm}
\begin{picture}(1,1)
\put(0,0){\line(0,1){1}}
\put(0,0){\line(1,0){1}}
\put(0,0){\line(1,1){1}}
\put(0,0){\line(1,2){.5}}
\put(0,0){\line(1,3){.3333}}
\put(0,0){\line(1,4){.25}}
\put(0,0){\line(1,5){.2}}
\put(0,0){\line(1,6){.1667}}
\put(0,0){\line(2,1){1}}
\put(0,0){\line(2,3){.6667}}
\put(0,0){\line(2,5){.4}}
\put(0,0){\line(3,1){1}}
\put(0,0){\line(3,2){1}}
\put(0,0){\line(3,4){.75}}
\put(0,0){\line(3,5){.6}}
\put(0,0){\line(4,1){1}}
\put(0,0){\line(4,3){1}}
\put(0,0){\line(4,5){.8}}
\put(0,0){\line(5,1){1}}
\put(0,0){\line(5,2){1}}
\put(0,0){\line(5,3){1}}
\put(0,0){\line(5,4){1}}
\put(0,0){\line(5,6){.8333}}
\put(0,0){\line(6,1){1}}
\put(0,0){\line(6,5){1}}
\end{picture}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
帶箭頭線段

\put(x, y){\vector(x1, y1){length}}
1
(x1, y1) – 線段的方向向量. 方向向量中元素僅限於在(−4, −3, … , 3, 4) 中取值. x1 與 y1要互質.如下所示:

\setlength{\unitlength}{0.75mm}
\begin{picture}(60,40)
\put(30,20){\vector(1,0){30}}
\put(30,20){\vector(4,1){20}}
\put(30,20){\vector(3,1){25}}
\put(30,20){\vector(2,1){30}}
\put(30,20){\vector(1,2){10}}
\thicklines
\put(30,20){\vector(-4,1){30}}
\put(30,20){\vector(-1,4){5}}
\thinlines
\put(30,20){\vector(-1,-1){5}}
\put(30,20){\vector(-1,-4){5}}
\end{picture}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
圓形

\put(x, y){\circle{diameter}}
1
(x, y) – 圓心坐標
{diameter} – 直徑,circle命令畫出圓的最大直徑約為14mm
\circle* – 畫實心圓

字符

\put(0.7,0.3){$A$}
1
例如:

\setlength{\unitlength}{0.8cm}
\begin{picture}(6,5)
\thicklines
\put(1,0.5){\line(2,1){3}}
\put(4,2){\line(-2,1){2}}
\put(2,3){\line(-2,-5){1}}
\put(0.7,0.3){$A$}
\put(4.05,1.9){$B$}
\put(1.7,2.95){$C$}
\put(3.1,2.5){$a$}
\put(1.3,1.7){$b$}
\put(2.5,1.05){$c$}
\put(0.3,4){$F=\sqrt{s(s-a)(s-b)(s-c)}$}
\put(3.5,0.4){$\displaystyle s:=\frac{a+b+c}{2}$}
\end{picture}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
橢圓

\put(x, y){\oval(w, h)}
1
\put(x, y){\oval(w, h)[position]}
1
二階貝塞爾曲線

\qbezier(x1, y1)(x, y)(x2, y2)
1
\multiput(x, y)(dx, dy ){n}{object}
1
例如

\linethickness{0.075mm}
\multiput(0,0)(1,0){26} {\line(0,1){20}}
1
2
用戶自定義圖形

用戶可使用 \newsavebox, \savebox 和\usebox命令設置自定義圖形。一個savebox是一類未修飾的盒子(box)。\newsavebox命令聲明一個盒子。\savebox命令設定盒子(box)的內容。 \usebox命令將盒子插入文檔中。 (A savebox is an non-rendered box that is saved for later repeated rendering via the usebox command. The command \newsavebox creates a placeholder for storing content; the command \savebox stores the specified content in the placeholder without rendering it in the document; and \usebox renders the content of the placeholder into the document[20].)
例如:

\newsavebox{foo}
1
聲明 一個名為foo的盒子.

\savebox{foo}(width,height)[position]{content}
1
定義 盒子foo

\put(x, y){\usebox{foo}}
1
調用盒子foo

例如:

\newsavebox{\foldera}
\savebox{\foldera}
(40,32)[bl]{% definition
\multiput(0,0)(0,28){2}
{\line(1,0){40}}
\multiput(0,0)(40,0){2}
{\line(0,1){28}}
\put(1,28){\oval(2,2)[tl]}
\put(1,29){\line(1,0){5}}
\put(9,29){\oval(6,6)[tl]}
\put(9,32){\line(1,0){8}}
\put(17,29){\oval(6,6)[tr]}
\put(20,29){\line(1,0){19}}
\put(39,28){\oval(2,2)[tr]}
}
\newsavebox{\folderb}
\savebox{\folderb}
(40,32)[l]{% definition
\put(0,14){\line(1,0){8}}
\put(8,0){\usebox{\foldera}}
}
\setlength{\unitlength}{0.5mm}
\begin{picture}(120,168)
\put(34,26){\line(0,1){102}}
\put(14,128){\usebox{\foldera}}
\multiput(34,86)(0,-37){3}
{\usebox{\folderb}}
\end{picture}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
savebox與 {picture}環境沒有依賴關系。將savebox的定義放在 {picture}環境之外,那么整個文檔都可以使用這個savebox。

樣例

下面是幾個使用picture環境畫圖的樣例[22]

\setlength{\unitlength}{1mm}
\begin{picture}(120,68)
\put(0,28){\vector(1,0){115}} \put(116,27){$x_A$}
\put(53,7){\vector(0,1){61}} \put(46,66){$ct_A$}
\put(2,27){\line(3,1){110}}
\multiput(53,28)(-12,12){2}{\circle*{2}}
\put(77,52){\circle*{2}}
\put(53,28){\vector(-1,1){11}} \put(53,28){\vector(1,1){23}}
\put(54,23){$E_1$} \put(35,41){$E_2$} \put(71,53){$E_3$}
\put(28,2){$B'$} \multiput(30,7)(2,6){9}{\line(1,3){1.5}}
\put(44,2){$B$} \put(46,7){\line(1,3){17.5}}
\put(51,2){$A$}
\put(60,2){$B''$} \multiput(62,7)(2,6){9}{\line(1,3){1.5}}
\put(83,54){\line(1,-1){5}}
\put(89,48){Gerade der} \put(89,44){Gleichzeitigkeit}
\put(15,54){$\alpha=\alpha'$}
\put(15,52){\line(1,0){10}}
% draw_arc P1=(54/43) P2=(53/40) P3=(53/41) r=25
\qbezier(60.906,51.717)(57.057,53.000)(53.000,53.000)
% draw_arc P1=(54/43) P2=(53/40) P3=(53/41) r=26
\qbezier(61.222,52.666)(57.219,54.000)(53.000,54.000)
% \put(57.219,66.000){\makebox(0,0){$\alpha$}}
\put(58.000,56.500){\makebox(0,0){$\alpha$}}
% draw_arc P1=(6/40) P2=(5/40) P3=(8/41) r=20
\qbezier(25.000,28.000)(25.000,31.246)(23.974,34.325)
% draw_arc P1=(6/40) P2=(5/40) P3=(8/41) r=21
\qbezier(26.000,28.000)(26.000,31.408)(24.922,34.641)
\put(29.000,32.408){\makebox(0,0){$\alpha'$}}
\end{picture}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29


\setlength{\unitlength}{1mm}
\begin{picture}(96,38)
\put(0,12){\vector(1,0){91}}
\put(92,11){$x_L$}
\put(6,10){$\underbrace{\rule{4cm}{0cm}}$}
\put(26,5){\makebox(0,0){$v\cdot\Delta t_L$}}
\multiput(1,12)(0,20){2}{\line(1,0){10}}
\multiput(1,12)(10,0){2}{\line(0,1){20}}
\multiput(41,12)(0,20){2}{\line(1,0){10}}
\multiput(41,12)(10,0){2}{\line(0,1){20}}
\multiput(6,12)(40,0){2}{\circle*{2}}
\put(46,32){\circle*{2}}
\put(46,12){\line(0,1){20}}
\put(6,12){\vector(2,1){39}}
\put(18,25){$c\cdot\Delta t_L$}
\put(46,32){\vector(2,-1){39}}
\put(46,22){\line(2,-1){8}}
\put(54.5,16){$h=c\cdot\Delta\tau$}
\end{picture}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19


\setlength{\unitlength}{1mm}
\begin{picture}(93,46)
\put( 0,14){\vector(1,0){60}}
\put(61,13){$x$}
\put(20,4){\vector(0,1){37}}
\put(19,43){$y$}
\put(50,34){\circle*{2}}
\put(52,35){$P$}
\multiput(20,34)(4,0){8}{\line(1,0){2}}
\put(14.5,33.5){$y_P$}
\multiput(50,14)(0,4){5}{\line(0,1){2}}
\put(48,11){$x_P$}
\put( 2,8){\vector(3,1){56}}
\put(59,26.5){$x'$}
\multiput(50,34)(1.9,-5.7){2}
{\line(1,-3){1.2}}
\put(52,22){$x_P'$}
\multiput(50,34)(-5.8,-1.933){6}
{\line(-3,-1){3.6}}
\put(12,21){$y_P'$}
\put(22,8){\vector(-1,3){10.5}}
\put(10,41){$y'$}
\end{picture}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23


tikz包

使用tikz包繪制基本圖形樣例[16]

繪圖環境的坐標系

tikz環境中繪制的是二維圖形,
在設定點坐標時,既可以使用卡氏坐標(Cartesian coordinates),也就是我們常用的直角坐標系,例如

(1cm, 10pt)
1
也可以使用極坐標(polar coordinates)

(30:1cm)
1
中文字符

在tikz環境中使用中文,可以用CJKutf8環境,tex文件保存格式為utf8, 通過\mbox{}在tikz環境中插入中文字符. 例如:

\path (0,4.6) node[left] {\mbox{中文}}
1
直線段

\draw (0,0) -- (4,0);
1
多個相連的直線段

\draw (0,0) -- (4,0) -- (4,4) -- (0,4) -- (0,0);
1
封閉的直線段環

\draw (0,0) -- (4,0) -- (4,4) -- (0,4) -- cycle;
1
貝塞爾曲線

\draw (0,0) .. controls (0,4) and (4,0) .. (4,4);
1
拋物線

\draw (0,0) parabola (4,4);
1
圓弧

\draw (3,0) arc (0:75:3cm);
1

\draw (2,2) circle (3cm);
1
橢圓

\draw (2,2) ellipse (3cm and 1cm);
1
矩形

\draw (0,0) rectangle (4,4);
1
設置線型

\draw[red,thick,dashed] (2,2) circle (3cm);
1
網格

\draw[step=1cm,gray,very thin] (-2,-2) grid (6,6);
1
無邊界網格(縮小繪圖范圍,達到消隱網格邊界的效果)

\draw[step=1cm,gray,very thin] (-1.9,-1.9) grid (5.9,5.9);
1
坐標軸

\draw[thick,->] (0,0) -- (4.5,0);
\draw[thick,->] (0,0) -- (0,4.5);
1
2
端點帶標注坐標軸

\draw[thick,->] (0,0) -- (4.5,0) node[anchor=north west] {x axis};
\draw[thick,->] (0,0) -- (0,4.5) node[anchor=south east] {y axis};
1
2
坐標軸刻度

\foreach \x in {0,1,2,3,4}
\draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north] {$\x$};
\foreach \y in {0,1,2,3,4}
\draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor=east] {$\y$};
1
2
3
4
Kjell Magne Fauske提供的使用tikz包畫圖樣例:

\documentclass[UTF8]{article}
\usepackage{tikz}

\begin{document}

\newpage
\pagestyle{empty}

% 3D Cone
% Author: Gene Ressler. Adapted to TikZ by Kjell Magne Fauske.
% See http://www.frontiernet.net/~eugene.ressler/ for more details.

% The following code is generated by Sketch. I have edited it a bit
% to make it easier to read.
\begin{tikzpicture}
\tikzstyle{conefill} = [fill=blue!20,fill opacity=0.8]
\tikzstyle{ann} = [fill=white,font=\footnotesize,inner sep=1pt]
\tikzstyle{ghostfill} = [fill=white]
\tikzstyle{ghostdraw} = [draw=black!50]

\filldraw[conefill](-.775,1.922)--(-1.162,.283)--(-.274,.5)
--(-.183,2.067)--cycle;
\filldraw[conefill](-.183,2.067)--(-.274,.5)--(.775,.424)
--(.516,2.016)--cycle;
\filldraw[conefill](.516,2.016)--(.775,.424)--(1.369,.1)
--(.913,1.8)--cycle;
\filldraw[conefill](-.913,1.667)--(-1.369,-.1)--(-1.162,.283)
--(-.775,1.922)--cycle;
\draw(1.461,.107)--(1.734,.127);
\draw[arrows=<->](1.643,1.853)--(1.643,.12);
\filldraw[conefill](.913,1.8)--(1.369,.1)--(1.162,-.283)
--(.775,1.545)--cycle;
\draw[arrows=->,line width=.4pt](.274,-.5)--(0,0)--(0,2.86);
\draw[arrows=-,line width=.4pt](0,0)--(-1.369,-.1);
\draw[arrows=->,line width=.4pt](-1.369,-.1)--(-2.1,-.153);
\filldraw[conefill](-.516,1.45)--(-.775,-.424)--(-1.369,-.1)
--(-.913,1.667)--cycle;
\draw(-1.369,.073)--(-1.369,2.76);
\draw(1.004,1.807)--(1.734,1.86);
\filldraw[conefill](.775,1.545)--(1.162,-.283)--(.274,-.5)
--(.183,1.4)--cycle;
\draw[arrows=<->](0,2.34)--(-.913,2.273);
\draw(-.913,1.84)--(-.913,2.447);
\draw[arrows=<->](0,2.687)--(-1.369,2.587);
\filldraw[conefill](.183,1.4)--(.274,-.5)--(-.775,-.424)
--(-.516,1.45)--cycle;
\draw[arrows=<-,line width=.4pt](.42,-.767)--(.274,-.5);
\node[ann] at (-.456,2.307) {$r_0$};
\node[ann] at (-.685,2.637) {$r_1$};
\node[ann] at (1.643,.987) {$h$};
\path (.42,-.767) node[below] {$x$}
(0,2.86) node[above] {$y$}
(-2.1,-.153) node[left] {$z$};
% Second version of the cone
\begin{scope}[xshift=3.5cm]
\filldraw[ghostdraw,ghostfill](-.775,1.922)--(-1.162,.283)--(-.274,.5)
--(-.183,2.067)--cycle;
\filldraw[ghostdraw,ghostfill](-.183,2.067)--(-.274,.5)--(.775,.424)
--(.516,2.016)--cycle;
\filldraw[ghostdraw,ghostfill](.516,2.016)--(.775,.424)--(1.369,.1)
--(.913,1.8)--cycle;
\filldraw[ghostdraw,ghostfill](-.913,1.667)--(-1.369,-.1)--(-1.162,.283)
--(-.775,1.922)--cycle;
\filldraw[ghostdraw,ghostfill](.913,1.8)--(1.369,.1)--(1.162,-.283)
--(.775,1.545)--cycle;
\filldraw[ghostdraw,ghostfill](-.516,1.45)--(-.775,-.424)--(-1.369,-.1)
--(-.913,1.667)--cycle;
\filldraw[ghostdraw,ghostfill](.775,1.545)--(1.162,-.283)--(.274,-.5)
--(.183,1.4)--cycle;
\filldraw[fill=red,fill opacity=0.5](-.516,1.45)--(-.775,-.424)--(.274,-.5)
--(.183,1.4)--cycle;
\fill(-.775,-.424) circle (2pt);
\fill(.274,-.5) circle (2pt);
\fill(-.516,1.45) circle (2pt);
\fill(.183,1.4) circle (2pt);
\path[font=\footnotesize]
(.913,1.8) node[right] {$i\hbox{$=$}0$}
(1.369,.1) node[right] {$i\hbox{$=$}1$};
\path[font=\footnotesize]
(-.645,.513) node[left] {$j$}
(.228,.45) node[right] {$j\hbox{$+$}1$};
\draw (-.209,.482)+(-60:.25) [yscale=1.3,->] arc(-60:240:.25);
\fill[black,font=\footnotesize]
(-.516,1.45) node [above] {$P_{00}$}
(-.775,-.424) node [below] {$P_{10}$}
(.183,1.4) node [above] {$P_{01}$}
(.274,-.5) node [below] {$P_{11}$};
\end{scope}
\end{tikzpicture}

\end{document}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
效果如下圖所示:


動畫

使用LaTex在pdf文件中插入動畫需要{animate}擴展包,可在LaTex文件引導區添加

\usepackage{animate}
1
插入動畫命令\animategraphics的語法是

\animategraphics[<options>]{<frame rate>}{<file basename>}{<first>}{<last>}
1
< frame rate>定義動畫的幀速,< file basename>圖形文件名的基, < first>、< last>圖形文件起始和結束的序號。例如:panda0.png, panda1.png, …, panda100.png

附:
gif動畫分解網址:
https://ezgif.com/split/
http://www.webtoolss.com/gif_bunkai.html

樣例:

\animategraphics[
autoplay,loop,controls,
width=.7\textwidth,
height=.7\textheight
]{4}{./pandagif/panda}{0}{100}
1
2
3
4
5
其中動畫圖片panda0.png, panda1.png, …, panda100.png都保存在pandagif文件夾中

時間軸(timeline)

畫時間軸

下面這個例子[23]基於table畫豎向時間軸. 只使用了xcolor擴展包,

\documentclass{article}
\usepackage{xcolor}
\newcommand\ytl[2]{
\parbox[b]{8em}{\hfill{\color{cyan}\bfseries\sffamily #1}~$\cdots\cdots$~}\makebox[0pt][c]{$\bullet$}\vrule\quad \parbox[c]{4.5cm}{\vspace{7pt}\color{red!40!black!80}\raggedright\sffamily #2.\\[7pt]}\\[-3pt]}
\begin{document}
\begin{table}
\caption{Timeline of something.}
\centering
\begin{minipage}[t]{.7\linewidth}
\color{gray}
\rule{\linewidth}{1pt}
\ytl{1947}{AT and T Bell Labs develop the idea of cellular phones}
\ytl{1968}{Xerox Palo Alto Research Centre envisage the `Dynabook'}
\ytl{1971}{Busicom 'Handy-LE' Calculator}
\ytl{1973}{First mobile handset invented by Martin Cooper}
\ytl{1978}{Parker Bros. Merlin Computer Toy}
\ytl{1981}{Osborne 1 Portable Computer}
\ytl{1982}{Grid Compass 1100 Clamshell Laptop}
\ytl{1983}{TRS-80 Model 100 Portable PC}
\ytl{1984}{Psion Organiser Handheld Computer}
\ytl{1991}{Psion Series 3 Minicomputer}
\bigskip
\rule{\linewidth}{1pt}%
\end{minipage}%
\end{table}
\end{document}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
顯示效果如下:

流程圖

使用tikz宏包畫流程圖樣例如下:

\documentclass[UTF8]{article}
%% 在導言中設置tikz擴展包
\usepackage{tikz}
\usetikzlibrary{arrows,
shapes.geometric,
decorations.pathmorphing,
backgrounds,
positioning,
fit,
petri,
automata}
\begin{document}
\thispagestyle{empty}
% 在正文中定義流程圖中控件樣式
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=red!30]
\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!30]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=orange!30]
\tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]
\tikzstyle{Data} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=red!30]
\tikzstyle{arrow} = [thick,->,>=stealth]

%% 設置流程圖內容
\begin{tikzpicture}[node distance=2cm]
%定義流程圖具體控件
\node (start) [startstop] {Start};
\node (in1) [io, below of=start] {Input};
\node (pro1) [process, below of=in1] {Process 1};
\node (dec1) [decision, below of=pro1, yshift=-0.5cm] {Decision 1};
\node (pro2a) [process, below of=dec1, yshift=-0.5cm] {Process 2a};
\node (pro2b) [process, right of=dec1, xshift=2cm] {Process 2b};
\node (out1) [io, below of=pro2a] {Output};
\node (stop) [startstop, below of=out1] {Stop};

%連接控件
\draw [arrow](start) -- (in1);
\draw [arrow](in1) -- (pro1);
\draw [arrow](pro1) -- (dec1);
\draw [arrow](dec1) -- (pro2a);
\draw [arrow](dec1) -- (pro2b);
\draw [arrow](dec1) -- node[anchor=east] {yes} (pro2a);
\draw [arrow](dec1) -- node[anchor=south] {no} (pro2b);
\draw [arrow](pro2b) |- (pro1);
\draw [arrow](pro2a) -- (out1);
\draw [arrow](out1) -- (stop);
\end{tikzpicture}
\end{document}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
數學公式

按照數學公式在文中的位置可分為兩種: 行中公式和獨立公式.

行中公式

行中公式可使用如下兩種形式:

畢達哥拉斯定理 \begin{math} x^{2}+y^{2}=z^{2} \end{math}又稱勾股定理。
1

畢達哥拉斯定理 $ x^{2}+y^{2}=z^{2} $又稱勾股定理。
1
使用上面兩種方法編譯后得到的文檔是一樣的,具體如下圖所示:


獨立公式

獨立公式可使用

$$
v = v^{1}e_{1} + v^{2}e_{2} + v^{3}e_{3} = v^{i}e_{i}, i = 1,2,3
$$

\begin{equation}
v = v^{1}e_{1} + v^{2}e_{2} + v^{3}e_{3} = v^{i}e_{i}, i = 1,2,3
\end{equation}
1
2
3
4
5
6
7
效果如下圖所示:

由上圖可看出,使用 {equation} 命令默認帶公式編號,使用 $$ 命令默認不帶公式編號。

數學公式顯示樣式

有些數學符號會根據文檔中上下文的不同而改變其顯示形式。例如,在正文環境中和在獨立數學公式環境中,分式會有不同的顯示樣式.

$f(x) = \sum_{n=0}^{10} \frac{x}{n!}$ \\

$$
f(x) = \sum_{n=0}^{10} \frac{x}{n!}
$$
1
2
3
4
5


如果想改變數學符號的默認顯示樣式, 可使用下列樣式命令設定:
\displaystyle
\textstyle
\scriptstyle
\scriptscriptstyle

例如:

In-line math components can be set with independent math display style
$f(x) = \displaystyle \sum_{n=0}^{10} \frac{x}{n!}$, and vice versa:
$$
f(x) = \scriptstyle \sum_{n=0}^{10} \frac{x}{n!}
$$
1
2
3
4
5


引用公式

在文中引用公式編號可使用以下方式

\begin{equation}\label{eq:Pythagorean theorem}
x^{2}+y^{2}=z^{2}
\end{equation}
公式\ref{eq:Pythagorean theorem}是畢達哥拉斯定理,在中國又稱勾股定理。
1
2
3
4
效果如下:


在數學公式中插入中文

使用\mbox{}可在數學公式中插入中文。

$$
\mbox{例如:} x_{1}, x_{2}, \cdots, x_{N}
$$
1
2
3
效果如下圖:


多行公式

$$
\left [
\begin{array}{cc}
v^{i} e_{i} & v^{i} e_{j} \\
v^{j} e_{i} & v^{j} e_{j} \\
\end{array}
\right ]
$$
1
2
3
4
5
6
7
8
效果如下圖所示:


$$
\left \{
\begin{array}{r c l}
(f + g)(x) & = & f(x) + g(x) \\
(\alpha f)(x) & = & \alpha f(x) \\
(fg)(x) & = & f(x)g(x) \\
\end{array}
\right .
$$
1
2
3
4
5
6
7
8
9
效果如下圖所示:


多行公式也可以在{eqnarray}環境實現,例如:

\begin{eqnarray}
w(0) & = & 0 \\
\frac{\partial w}{\partial x}\Big |_{x=0} & = & 0 \\
\end{eqnarray}
1
2
3
4
下標

一般數學公式中下標可以使用
$$ s = \int_{a}^{b} |\dot{x}(t)| dt $$
1
有時需要將下標放在正下方, 如果是數學符號,可使用$ \limits$命令
$$ r'(t) = \lim \limits_{\triangle t \rightarrow 0} \frac{ r(t + \triangle t) - r(t)}{ \triangle t }$$
1


如果是普通符號,那么要用KaTeX parse error: Expected group after '\mathop' at end of input: \mathop先轉成數學符號再用$\limits$
長豎線

數學公式中的豎線高度可通過 “\big” “\Big” “\bigg” “\Bigg” 調整。

$$
\frac{\partial w}{\partial x}\Big |_{x=0} = 0
$$
1
2
3
根號

The square root of 100 is $\sqrt{100}=10$.
\\
The cubic root of 64 is $\sqrt[3]{64}=4$.
1
2
3
得到的文檔如下圖所示


頁腳注釋和頁邊注釋

頁腳注釋

在正文中添加頁腳注釋的命令是:\footnote, 例如:

正文內容\footnote{注釋內容}
1
Latex會按順序為腳注設置編號。

也可以使用\footnotemark和\footnotetext 添加頁腳注釋,例如:

在這里添加頁腳注釋角標\footnotemark
%% ...
在這里設置注釋內容\footnotetext{注釋內容}
1
2
3
\footnote腳注命令不能在數學公式,表格,子頁面等環境中使用。如果想在表格中引用頁腳注釋,可參考下面的例子:

正文內容\footnote{注釋內容\label{fnote}}
在這里也引用與上邊腳注相同的角標 \textsuperscript{\ref{fnote}}
1
2
頁邊注釋

在正文中添加頁邊注釋的命令是:\marginpar, 例如:

\marginpar{注釋內容}
1
關於頁腳注釋和頁邊注釋命令的使用以及其它內容請參考[19]

枚舉項編號樣式

使用{enumitem}擴展包

\usepackage{enumitem}
1
\begin{enumerate}[label=(\alph*)]
\item an apple
\item a banana
\item a carrot
\item a durian
\end{enumerate}

\begin{enumerate}[label=(\Alph*)]
\item an apple
\item a banana
\item a carrot
\item a durian
\end{enumerate}

\begin{enumerate}[label=(\roman*)]
\item an apple
\item a banana
\item a carrot
\item a durian
\end{enumerate}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
使用參考文獻

Latex中參考文獻命令格式是[7]:

\begin{thebibliography}{9}
\bibitem{latexcompanion}
Michel Goossens, Frank Mittelbach, and Alexander Samarin.
\textit{The \LaTeX\ Companion}.
Addison-Wesley, Reading, Massachusetts, 1993.

\bibitem{einstein}
Albert Einstein.
\textit{Zur Elektrodynamik bewegter K{\"o}rper}. (German)
[\textit{On the electrodynamics of moving bodies}].
Annalen der Physik, 322(10):891–921, 1905.

\bibitem{knuthwebsite}
Knuth: Computers and Typesetting,
\\\texttt{http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html}
\end{thebibliography}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
注意:\bibitem命令中 參考文獻引用名中可以有空格。

Bibtex是常用的參考文獻管理工具。Bibtex將參考文獻條目內容保存在一個.bib后綴文件中。 Bibtex能根據參考文獻在正文中被引用的順序自動過濾並調整文獻編號,因此不同論文中可以使用同一個bib文件。 Bibtex使用的參考文獻格式如下所示[7][8]:

@article{name1,
author = {Auther 1 and Auther 2},
title = {The \LaTeX\ Companion},
journal = {Journal name},
volume = {49},
pages = {409-436},
year = {19xx},
abstract = {摘要主要是給自己參考, 這一項不是必須的}
}
@book{name2,
author = {Auther 1 and Auther 2},
title = {The TeX Book},
publisher = "Springer",
year = {19xx},
abstract = {摘要}
}
@article{einstein,
author = "Albert Einstein",
title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]",
journal = "Annalen der Physik",
volume = "322",
number = "10",
pages = "891--921",
year = "1905",
DOI = "http://dx.doi.org/10.1002/andp.19053221004"
}

@book{latexcompanion,
author = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
title = "The \LaTeX\ Companion",
year = "1993",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"
}

@misc{knuthwebsite,
author = "Donald Knuth",
title = "Knuth: Computers and Typesetting",
url = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html"
}

@article{article,
author = {Peter Adams},
title = {The title of the work},
journal = {The name of the journal},
year = 1993,
number = 2,
pages = {201-213},
month = 7,
note = {An optional note},
volume = 4
}

@book{book,
author = {Peter Babington},
title = {The title of the work},
publisher = {The name of the publisher},
year = 1993,
volume = 4,
series = 10,
address = {The address},
edition = 3,
month = 7,
note = {An optional note},
isbn = {3257227892}
}

@booklet{booklet,
title = {The title of the work},
author = {Peter Caxton},
howpublished = {How it was published},
address = {The address of the publisher},
month = 7,
year = 1993,
note = {An optional note}
}

@conference{conference,
author = {Peter Draper},
title = {The title of the work},
booktitle = {The title of the book},
year = 1993,
editor = {The editor},
volume = 4,
series = 5,
pages = 213,
address = {The address of the publisher},
month = 7,
organization = {The organization},
publisher = {The publisher},
note = {An optional note}
}

@inbook{inbook,
author = {Peter Eston},
title = {The title of the work},
chapter = 8,
pages = {201-213},
publisher = {The name of the publisher},
year = 1993,
volume = 4,
series = 5,
address = {The address of the publisher},
edition = 3,
month = 7,
note = {An optional note}
}

@incollection{incollection,
author = {Peter Farindon},
title = {The title of the work},
booktitle = {The title of the book},
publisher = {The name of the publisher},
year = 1993,
editor = {The editor},
volume = 4,
series = 5,
chapter = 8,
pages = {201-213},
address = {The address of the publisher},
edition = 3,
month = 7,
note = {An optional note}
}

@manual{manual,
title = {The title of the work},
author = {Peter Gainsford},
organization = {The organization},
address = {The address of the publisher},
edition = 3,
month = 7,
year = 1993,
note = {An optional note}
}

@mastersthesis{mastersthesis,
author = {Peter Harwood},
title = {The title of the work},
school = {The school of the thesis},
year = 1993,
address = {The address of the publisher},
month = 7,
note = {An optional note}
}

@misc{misc,
author = {Peter Isley},
title = {The title of the work},
howpublished = {How it was published},
month = 7,
year = 1993,
note = {An optional note}
}

@phdthesis{phdthesis,
author = {Peter Joslin},
title = {The title of the work},
school = {The school of the thesis},
year = 1993,
address = {The address of the publisher},
month = 7,
note = {An optional note}
}

@proceedings{proceedings,
title = {The title of the work},
year = 1993,
editor = {Peter Kidwelly},
volume = 4,
series = 5,
address = {The address of the publisher},
month = 7,
organization = {The organization},
publisher = {The name of the publisher},
note = {An optional note}
}

@techreport{techreport,
author = {Peter Lambert},
title = {The title of the work},
institution = {The institution that published},
year = 1993,
number = 2,
address = {The address of the publisher},
month = 7,
note = {An optional note}
}

@unpublished{unpublished,
author = {Peter Marcheford},
title = {The title of the work},
note = {An optional note},
month = 7,
year = 1993
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
可將上述內容保存到一個.bib后綴文件,例如foo.bib。
注意:bib文件中 參考文獻引用名中不能有空格。

在preamble中添加(不加這個命令也能用)

\usepackage{cite}
1
在正文中引用時方法如下:

\begin{document}

\cite{name1}"The geometric definition of dot product is coordinate independent, ..."\cite{latexcompanion,knuthwebsite}

\medskip

%% IEEEtran是參考文獻顯示格式
\bibliographystyle{IEEEtran}
%% foo is the bib file name
\bibliography{foo}

\end{document}
1
2
3
4
5
6
7
8
9
10
11
12
注意:
1) 應用多個文獻時,例如:\cite{latexcompanion,knuthwebsite}, 參考文獻引用名之間用逗號分隔,不能插入空格。
2) \bibliography{foo} 中使用文件名(本例中是foo),不能帶.bib后綴.

常用的bibliographystyle有: abbrv, acm, alpha, apalike, ieetr, plain,siam, unsrt等。
BibTeX常用的項有[7]:
address annote author
booktitle chapter crossref
edition editor institution
journal key month
note number organization
pages publisher school
series title type
volume year URL
ISBN ISSN LCCN
abstract keywords price
copyright language contents

Beamer樣例

%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% 設置文檔類型為 beamer
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\documentclass{beamer}
\usepackage{beamerthemesplit}
\usepackage{animate}

\title{Example Presentation Created with the Beamer Package}
\author{Till Tantau}
\date{\today}

\begin{document}

%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% TITLE PAGE
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\frame{\titlepage}

\section*{Outline}

\frame{\tableofcontents}

\section{Introduction}
\subsection{Overview of the Beamer Class}

%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% 使用 frame 命令生成一頁
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\frame
{
\frametitle{Features of the Beamer Class}
\begin{itemize}
\item<1-> Normal LaTeX class.
\item<2-> Easy overlays.
\item<3-> No external programs needed.
\end{itemize}
}

\begin{frame}{Metropolis title formats}
supports 4 different title formats:
\begin{itemize}
\item Regular
\item \textsc{Small caps}
\item \textsc{all small caps}
\item ALL CAPS
\end{itemize}
They can either be set at once for every title type or individually.
\end{frame}

%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% 公式於圖片並列
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{frame}{Euler–Bernoulli 梁理論}
\begin{figure}[H]
\begin{minipage}{0.48\linewidth}
\centerline{\includegraphics[width=4.0cm]{foo.PNG}}
\end{minipage}
\hfill
\begin{minipage}{.48\linewidth}
$ \displaystyle \frac{d^{2}}{dx^{2}} (EI_{y} \frac{d^{2} \omega}{dx^{2}}) = q$
\end{minipage}
\caption{Euler–Bernoulli 方程}
\label{zrotate}
\end{figure}
\end{frame}

%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% 插入代碼片段, 需要使用 fragile
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{frame} [fragile]
\frametitle{Code}
\begin{verbatim}
int main (int argc, char* argv[])
{
printf("Hello world. \n");
return 0;
}
\end{verbatim}
\end{frame}

%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% 插入動畫
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{frame}
\animategraphics[
autoplay,loop,controls,
width=.7\textwidth,
height=.7\textheight
]{4}{/pandagif/panda}{0}{100}
\end{frame}
\end{document}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
字體與字號

Latex的字體由小到大分別為

\tiny
\scriptsize
\footnotesize
\small
\normalsize
\large
\Large
\LARGE
\huge
\Huge
1
2
3
4
5
6
7
8
9
10
例如
如果在文檔局部微調某些字句的字體大小:

{\tiny Hello}\\
{\scriptsize Hello}\\
{\footnotesize Hello}\\
{\small Hello}\\
{\normalsize Hello}\\
{\large Hello}\\
{\Large Hello}\\
{\LARGE Hello}\\
{\huge Hello}\\
{\Huge Hello}\\
1
2
3
4
5
6
7
8
9
10
如果需要在大范圍調整,可使用
\begin{}和\end{}
\begin{}和\end{}
命令。 例如:

\begin{footnotesize}
The package uses new font size other than default size.
\end{footnotesize}
1
2
3
Latex字體大小一般以pt做單位,pt是point的簡寫。pt與長度單位的換算關系是:
1點(point) = 0.013837英寸(inch) = 0.35146毫米(mm)
Latex文檔字體大小的默認值\normalsize 是 10 points。\documentclass命令可以在導言區修改字體大小默認值,例如:

\documentclass[12pt, letterpaper]{article}
1
中文排版通常使用字號,例如:五號字,六號字等。 字號與pt的關系如下所列:

\begin{tabular}{lll}
\hline
七號 & 5.25pt & 1.845mm \\
六號 & 7.875pt & 2.768mm \\
小五號 & 9pt & 3.163mm \\
五號 & 10.5pt & 3.69mm \\
小四號 & 12pt & 4.2175mm \\
四號 & 13.75pt & 4.83mm \\
三號 & 15.75pt & 5.53mm \\
二號 & 21pt & 7.38mm \\
一號 & 27.5pt & 9.48mm \\
小初號 & 36pt & 12.65mm \\
初號 & 42pt & 14.76mm \\
\hline
\end{tabular}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
設置字號的命令

\zihao{5}
\zihao{-5}
1
2
常用的中文字體有

\kaishu 楷體
\songti 宋體
\heiti 黑體
\fangsong 仿宋
\lishu 隸書
\youyuan 幼圓
1
2
3
4
5
6
顏色

設置字符顏色, 字符框顏色和背景色

使用\textcolor命令,可以基於紅,黃,藍三原色改變字符顏色

\textcolor[rgb]{0.00,0.50,1.00}{text}

\textcolor[RGB]{0,128,255}{text}
1
2
3
如果使用[rgb],紅,黃,藍三原色的比例的取值范圍是[0,1], 例如: {0.00,0.50,1.00}
如果使用[RGB],紅,黃,藍三原色的比例的取值范圍是[0,1], 例如: {0,128,255}

使用xcolor擴展包,可以直接使用已經調配好的顏色名
首先在LaTex導言區添加

\usepackage{xcolor}
1
使用樣例:

\textcolor{blue}{text}
{\color{red}some text}
1
2
設置字符背景色

\colorbox{blue}{text}
1
設置字符框顏色和背景色

\fcolorbox{blue}{yellow}{text}
1
自定義顏色名

通過\definecolor命令可以自定義顏色名. \definecolor命令的語法是:

\definecolor{name}{model}{color-spec}
1
例如:

\definecolor{orange}{rgb}{1,0.5,0}
1
設置verbatim環境中字符顏色

然而在verbatim環境中,"\textcolor[RGB]{0,128,255}{text}"都會當作普通字符顯示,無法改變字符顏色。 使用fancyvrb擴展包,就可以改變verbatim環境中字符顏色。
首先在LaTex導言區添加

\usepackage{fancyvrb}
\usepackage{xcolor}
1
2
使用樣例

\color{blue}
\begin{verbatim}
The characters' color have been chenged to blue.
\end{verbatim}

\color{black} %% 改回原來的顏色
1
2
3
4
5
6
\color 命令會改變從它所在行開始知道頁面結束所有文檔內容中字符的顏色。

LaTex文件編碼格式與使用中文

要在Latex環境中使用中文,首先要選擇tex文件的編碼(encoding)方式,常用的有UTF-8和GBK等。在Windows中,使用WinEdt編輯UTF-8格式tex文件時,修改配置文件(Options -> Options Interface -> Language, Unicode, Sorting -> Unicode(UTF-8) Support )中UTF8FILTER項

UTF8FILTER="Tex;UTF-8|ACP;EDT;INI;"
1
將WinEdt設置為默認使用UTF8格式打開tex文件。
如果WinEdt打開一個UTF-8格式的文件顯示亂碼,可在Document->Document Setting->Format->File Format中選擇UTF-8
或者在在該文件的開始處添加一行

% !Mode:: "TeX:UTF-8"
1
Latex環境中使用中文需要注意的一點是: Latex編輯器讀入文件的使用的編碼格式一定要與該文件的編碼格式一致。

使用CJK中文包(UTF8格式)
\documentclass[UTF8]{article}
\usepackage{CJK}
\begin{document}
\begin{CJK}{UTF8}{song}
Hello, World!

世界, 你好!

\emph{世界, 你好!}

\textbf{世界, 你好!}

{\CJKfamily{hei} 黑體}

{\CJKfamily{kai} 楷體}

{\CJKfamily{li} 隸書}

{\CJKfamily{fs} 仿宋}

{\CJKfamily{song} 仿宋}

\end{CJK}
\end{document}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
第一行$ \documentclass $ 后的 [UTF8] [UTF8][UTF8] 指定編輯器按照UTF8格式讀入該文件,所以也要以UTF8格式保存該文件。

使用CTEX中文包(UTF8格式)
\documentclass[UTF8]{article}
\usepackage{CTEX}

\begin{document}

\section{字體設置}

{\kaishu 楷體}

{\songti 宋體}

{\heiti 黑體}

{\fangsong 仿宋}

{\lishu 隸書}

{\youyuan 幼圓}

\end{document}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
pdf文檔效果


使用CJK中文包(GBK格式)
\documentclass{article}
\usepackage{CJK}
\begin{document}
\begin{CJK*}{GBK}{song}
Hello, World!

世界, 你好!

\emph{世界, 你好!}

\textbf{世界, 你好!}
\end{CJK*}
\end{document}
1
2
3
4
5
6
7
8
9
10
11
12
13
輸入中文繁體字
在Windows 10操作系統中,使用微軟拼音輸入法, 通過 Ctrl + Shift + f 可以轉換中文繁/簡體
LaTeX文件編譯

常用的LaTeX文件編輯軟件有WinEdt等,也可以自己動手編譯,例如使用Windows的批處理,使用Visual Studio的make等.

使用WinEdt

Shift+Ctrl+P

Windows 10中使用批處理編譯

使用 Windows的 記事本(在文件資源管理器中打開文件夾(如D:\foo), 點擊鼠標右鍵->新建->文本文檔), 也可以使用別的編譯軟件如Notepad++等。寫入以下命令

pdflatex %1
bibtex %1
pdflatex %1
pdflatex %1
start %1.pdf
1
2
3
4
5
保存為bat文件(可以命名為foo.bat)
開始->Windows附件->命令提示符,輸入以下命令

cd d:\foo
foo.bat
1
2
Visual Studio的make

下面是一例用於編譯LaTeX文件的Makefile文件:

BINPATH = D:\CTEX\MiKTeX\miktex\bin\

TeX = $(BINPATH)\pdflatex.exe
TeX_FLAGS = -shell-escape -interaction=nonstopmode -file-line-error
PRE = $(TeX) -ini -job-name="preamble" "&pdflatex preamble.tex\dump"
BIB = $(BINPATH)\bibtex.exe

FileName = main

all: $(FileName).pdf

main.pdf: $(FileName).tex
$(TeX) $(TeX_FLAGS) $(FileName).tex
$(BIB) $(FileName).tex
$(TeX) $(FileName).tex
$(TeX) $(FileName).tex

clean:
del $(FileName).pdf
del $(FileName).log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
常見編譯錯誤

"豢\documentclass{article}"
在Windows系統中,當文檔中需要插入中文字符時,需將Latex文件使用UTF-8編碼保存。如果使用Windows系統自帶的記事本編輯Latex文件,經常遇到下面的編譯錯誤:

豢\documentclass{article}
1
出現這種編譯錯誤的原因是因為 Windows 會在 UTF 編碼的文件最開始加一個 BOM。

解決辦法:
不要使用Windows系統自帶的記事本保存.tex文件,直接使用別的編輯軟件(例如WinEdt, Notepad++等)創建.tex文件。

"Too Many Unprocessed Floats"
如果一浮動對象不能被立即處理,它就會被放到未處理的浮動對象隊列@freelist 中,
@freelist 一般只保存18個未處理浮動對象,當未處理的浮動對象的數目過多時,就會出現"Too Many Unprocessed Floats"錯誤[10]。

解決辦法:

調整文本
在浮動圖形對象之間加入 \clearpage
將浮動圖形對象改為非浮動圖形對象[11]
使用WinEdt打開UTF-8格式文件,文件的中文字符顯示為亂碼
解決辦法:
在Document->Document Setting->Format->File Format中選擇UTF-8格式
或者在在該文件的開始處添加一行

% !Mode:: "TeX:UTF-8"
1
參考文獻

[1] https://en.wikipedia.org/wiki/TeX
[2] http://hubl82.blog.163.com/blog/static/12676948520134593321565/
[3] https://www.shareLaTex.com/learn/Creating_a_document_in_LaTex
[4] http://www.ctex.org/HomePage/
[5] https://www.LaTex-project.org
[6] https://tex.stackexchange.com/questions/246/when-should-i-use-input-vs-include
[7] https://www.sharelatex.com/learn/Bibliography_management_with_bibtex
[8] https://www.verbosus.com/bibtex-style-examples.html
[9] http://www.ctex.org/documents/latex/graphics/node61.html
[10] http://www.ctex.org/documents/latex/graphics/node66.html
[11] http://www.ctex.org/documents/latex/graphics/node87.html#chap:nonfloat
[12] User’s Guide to the Beamer Class. http://www.tuteurs.ens.fr/noncvs/docs/beamer/beameruserguide.pdf
[13] https://www.r-bloggers.com/create-your-own-beamer-template/
[14] https://hamaluik.com/posts/better-beamer-themes/
[15] https://en.wikibooks.org/wiki/LaTeX/Tables
[16] https://www.sharelatex.com/blog/2013/08/27/tikz-series-pt1.html
[17] https://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions
[18] https://en.wikibooks.org/wiki/LaTeX/Picture
[19] https://en.wikibooks.org/wiki/LaTeX/Footnotes_and_Margin_Notes
[20] https://en.wikibooks.org/wiki/LaTeX/Boxes
[21] TeX Stack Exchange中的精彩問答 https://www.zhihu.com/question/27240200
[22] The picture Environment http://www.ursoswald.ch/LaTeXGraphics/picture/picture.html
[23] https://tex.stackexchange.com/questions/196794/how-can-you-create-a-vertical-timeline
[24] https://tex.stackexchange.com/questions/74353/what-commands-are-there-for-horizontal-spacing
后記

人類社會歷經石器時代, 青銅時代, 鐵器時代, 機器時代,電氣時代,直到現在的電子信息時代. 人類將對自然界和人類社會探索和研究 轉化為知識, 用文字記錄下來. 文字的出現標識人類文明的起點. 知識的增長不僅依賴人類對未知世界的探索,也依賴於承載文明的工具. 從結繩刻木, 到龜甲,獸骨, 陶器, 獸皮,竹簡, 絲絹, 紙張, 電子計算機, 從刻刀,到筆墨, 活字印刷, 到電子軟件, 人類在發現知識的同時也努力改進傳承知識的工具.

知識是人類文明的承載體,是人類改變個體命運的強大武器。知識是人類社會划分階層的重要標尺. 知識曾經是貴族的專享, 二千多年前的孔子提出"有教無類", 打破了貴族對知識的壟斷.

感謝那些偉大的程序員. 他(她)們花費時間和精力發明TeX, 開發一系列相關擴展包和輔助工具,將其擴展為LaTex等分支。 他(她)們將私人知識產權的勞動成果奉獻為公共財產,供全社會免費使用。 這種大公無私的精神,在物欲橫流, 弱肉強食的叢林社會中格外耀眼。他(她)們奉獻的不僅是排版軟件,更是計算機時代傳播知識的工具. 他(她)們無私的奉獻使得一些人不再因為金錢而失去獲取知識的權力, 也給這些人通過知識改變命運的機會. 這是對人類文明發展的有力推動。

人類文明一直加速發展. 特別從工業革命開始, 出現了牛頓,伏爾泰,康德,達爾文等一大批偉大的思想家, 科學家。在此期間,中國人對人類文明發展做出的貢獻於嚴重落后於我們占世界人口的比重。在國內, 學習LaTex的需求一般源自研究生撰寫論文的壓力。 能堅持讀到這里,你有很大概率是其中的一員。 希望你即使成不了牛頓那樣的偉人,至少也要做一個具有奉獻精神的人, 能讓這個世界變得更美好, 更公平。
---------------------
作者:cocoonyang
來源:CSDN
原文:https://blog.csdn.net/cocoonyang/article/details/78036326
版權聲明:本文為博主原創文章,轉載請附上博文鏈接!

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM