, G; x6 v' \% k1 y+ b: z 7 O* t' { b6 o9 u2 m: S9 M2 d4.章节和段落 ' E9 L, K+ a; \( f. {6 l' V建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 $ A/ d x+ j! I+ a& r1 \% y: W9 ~; M! F# X
\documentclass{article} + y( p3 L" ~( }7 e" ]; i \title{Hello World} 8 t, Y2 Y' T" _8 _5 ^
\begin{document} ; m' P, ~4 g5 F/ x \maketitle ) C1 u8 j% }. X o& u; w \section{Hello China} China is in East Asia. + ^2 {9 ^( m% T \subsection{Hello Beijing} Beijing is the capital of China. 4 `! x- @7 r5 j) O
\subsubsection{Hello Dongcheng District} 4 a9 t7 y, L6 `( o4 j \paragraph{Tian'anmen Square}is in the center of Beijing ' M% C3 E' D! \) ]7 |) D( b4 w
\subparagraph{Chairman Mao} is in the center of Tian'anmen Square ; ~$ l- ?4 [4 P5 q2 B. f& [7 Q, c
\subsection{Hello Guangzhou} % A+ D) I7 k$ Z) {/ v
\paragraph{Sun Yat-sen University} is the best university in Guangzhou. & f+ h ]) K$ i; V( J$ t
\end{document} & E9 C/ w2 C' `- v+ `. L
3 W" `+ \: X1 r% l5 S退格只是我个人偏好,看起来层次清晰美观。实际操作上未必要如此,每一行之前的空格不影响编译生成PDF的排版结果。 3 d# o, Z; U9 H$ X+ i) t
! H8 }$ f- t; T# g; [- e& p2 o# |: q; I& ^2 V# Z- w7 b% T5 i/ u
5.加入目录 / `( t) B/ Y, a" E
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 5 F4 E6 s0 a- j/ D! w4 m; P2 p5 v
9 e" t8 d9 g# o% E3 y! }\documentclass{article} ( e# W, O; A7 H
\begin{document} 5 N, R3 U- b6 P' ~- A
\tableofcontents 0 ^( x2 m: \. H( D! K
\section{Hello China} China is in East Asia. # p' z& K! p9 y7 S$ b: P
\subsection{Hello Beijing} Beijing is the capital of China. 1 q- Z% ?4 P' c E& F
\subsubsection{Hello Dongcheng District} 3 H. y7 R* \$ V- s9 |
\paragraph{Hello Tian'anmen Square}is in the center of Beijing . h& V1 n& {4 C5 p) @# f0 ] \subparagraph{Hello Chairman Mao} is in the center of Tian'anmen Square # ^; J2 ^$ k1 I\end{document} ' _3 J r6 |5 W! I* }1 W9 J
1 y- F7 Q2 l, m
6.换行 - z( }! y$ @( }. ?
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 * E" C* g1 L/ j8 {\documentclass{article} & \& X/ [: L/ q8 R4 {8 r3 l, V\begin{document} ' Z5 ?9 N1 ~+ H Beijing is ; M- b6 A: ] l0 f
the capital 4 X4 Q) E; `0 I9 c+ m# r' o2 A of China. 8 U0 I s, h) Z7 c' L
- O( Q; d# g" M0 v+ P. o
New York is 1 R# b2 @& `% d8 k% B: N n
* q, _- Y/ x1 U" U, c- l! D the capital ; J! ?& R% W1 n- R( m/ L- N4 q# H2 W
of America. + ]% g5 c+ a- [, I4 j0 u 5 f/ @! M) Q! b3 N# [& b- c- F Amsterdam is \\ the capital \\ r$ z f: G$ V, z) |. k0 e; [
of Netherlands. Z7 K- C; y0 y' s& y4 D# n$ W' h\end{document}" B" u$ c& r6 E
# D) _# M( j) Y) q: g6 J空一行为另起一段,\\为段内强制换行。 ! [; W$ T9 \0 }. p" }7 y4 m & b8 u. l4 S$ _. O! C# N% X! A+ c$ f! l
7.数学公式 0 H' C$ U n5 ^' {; x1 q' s6 P& B% o建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 5 `2 x# [" o) B& U2 t- j. G7 @ I/ o
\documentclass{article} ; N, v# L4 |8 P9 t" C6 K: s" [; O \usepackage{amsmath} $ z) j1 n9 l4 [" O3 @
\usepackage{amssymb} 2 O+ G: a4 a% p c
\begin{document} 0 x7 y( Z9 B; i/ [; a$ ~ The Newton's second law is F=ma. ' h6 D, w8 d) ]# [- {2 f . r5 w" |9 E2 p' F9 R The Newton's second law is $F=ma$. & ~0 A0 R* r- A$ ~, O7 E7 E
- x8 ~% I2 X* _8 D
The Newton's second law is - T8 p& R$ l8 ~& N5 R5 m% l$ {5 X
$$F=ma$$ : b' g! t6 t$ C( O
" ?5 h; M; E2 e! D% \
The Newton's second law is . G: [3 c. e' g* j: Z8 f2 I; L; t \[F=ma\] - A" C1 G( g, t. _* ^( `# r) D , ^2 T, V: `3 w( t Greek Letters $\eta$ and $\mu$ % ?, X2 n& N5 Q# W6 v3 I# f( Y6 m: T$ h1 N% c
Fraction $\frac{a}{b}$ 1 X" T$ k u) A2 k3 ]/ K% L & u( q5 ~( E ~: w Power $a^b$ 8 z+ _" H* c! a. {) s: y7 h . ?" `2 N( j. i+ B" m0 q Subscript $a_b$ ( e4 i2 g+ b# A Y# S1 C, n
) x4 _# b. g" G5 y9 x
Derivate $\frac{\partial y}{\partial t} $ ! i4 [! c5 F' q! J: F4 d8 l
1 y8 r; G/ r9 C Vector $\vec{n}$ % [+ E5 U+ L% H0 V! N* c5 E! H$ R+ y
Bold $\mathbf{n}$ + l' Y5 C' l# y3 N1 J8 p2 p- a w. d. E& P4 X+ o5 ]$ n
To time differential $\dot{F}$ 0 i* V. T3 }7 ~& w5 J. i" O
9 S; D( V/ H( g e3 ~0 Y$ K) q j
Matrix (lcr here means left, center or right for each column) 5 Y1 {% D& b9 H( F* g+ \ } \[ & `3 K: c; N7 ~ \left[ & L# ]3 C s7 ^( F% ? \begin{array}{lcr} ) b9 ~8 V' h0 l0 W
a1 & b22 & c333 \\ 0 y @% m7 d; l+ k7 ^
d444 & e555555 & f6 ; @3 K( a6 Q0 W( Q. g- I
\end{array} 3 ]* i: `/ b3 v
\right] 1 h% G5 i4 @4 \- b) D" y8 `* F \] ) [" O5 A9 m9 P; N
X& v8 R1 `$ C1 u
Equations(here \& is the symbol for aligning different rows) ?6 O9 k) y$ G! d# C. ]\begin{align} % n6 s: L, {. _: a/ I, o4 E
a+b&=c\\ 2 d8 ?4 z9 a: {) A
d&=e+f+g . `7 \# H# n1 q\end{align} : j6 D2 @$ ] C9 Z" _* \
# |5 R) ?3 p0 e0 k
\[ 9 \: F$ F/ e E- L/ Q1 u0 v \left\{ a4 o1 x9 }+ @2 t \begin{aligned} 3 X3 M9 ]% w5 v, a+ Z0 j0 P+ k; o &a+b=c\\ ' ]+ i* I; U1 i3 [9 M
&d=e+f+g ' }- G$ R( E" b1 V% @$ m
\end{aligned} & V3 \% r2 Y' B2 k
\right. 5 B, F+ }1 M- |# C, D# L; k V
\] 1 c$ U, D2 ?, M2 b' u; \* R
& T2 c s! ?4 C, M8 d
\end{document} 6 I$ A& y" F) F
* K3 | a) a8 X S% o9 T/ ^/ A具体细节可以自行搜索LaTeX的数学符号表或别人给的例子。 ; U+ ~; h* y N1 V4 U# g1 }- w0 w" W8 {0 y% T1 C' ?- @. g/ k' O
( [% V- [# w7 p; j, ` ! H) o6 r9 i6 C2 [8 ?$...$是开启行内数学模式,用于和文本合在一起使用。 ' h3 ? f6 e, a6 y" k7 z" e2 f: W 0 \- G/ E9 w: S' ^* r+ o$$...$$和\[...\]是另起一行居中开启数学模式。 ( N: b" d8 l0 ?$ c$ d ! a y" p- q3 c3 Z1 ` A4 ~ 1 N' d: Z% K) d- p. S% A) \2 x/ V2 c' e9 R/ S5 ^
有一些网站可以通过画图的方式来生成公式,有的编辑器集成了各种数学功能按钮。这对于公式需求少的人来说很方便,具体信息可以自己去搜索。但是如果你的文章中要出现大段的证明过程,就会发觉还是老老实实地google一篇latex数学符号表,然后不懂的去查代码,自己用手指敲来得干脆利索。再进阶一点,可以去搜一下有关LaTeX的自定义command的内容去看一下,在敲公式时能省很多力气。. L# @* w( r0 A+ a" d! ^% X
9 c) m6 V: F& I5 _- `6 g. R3 K+ j( I
8.插入图片 # B8 g( b/ \7 r$ X2 f$ q' ]
将待插入的图片姑且先命名为figure1.jpg 7 g1 J) W; V2 G% @* N& K, M4 Q
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,放在和图片文件同一个文件夹里,编译并观察现象。 " A( K; m5 k _" x" x9 s) J# q- i
\documentclass{article} # l2 O$ ?' a0 d5 Z3 `
\usepackage{graphicx} % J* C/ s. [3 t/ a' W: c/ w
\begin{document} 0 b. ?+ }& p5 ?- L \includegraphics[width=4.00in,height=3.00in]{figure1.jpg} - U1 |6 B8 b* k- l; S" W\end{document}0 L* W6 K& I3 e) u! |+ a; Y4 c
8 v) K, [: T; O在老版本的LaTeX中是只支持eps图片格式的,现在的LaTeX对jpg、bmp、png等等常见图片都可以支持。) ~8 d( U3 m' d3 _
# N1 l/ N0 U7 C/ G6 c
$ m2 O) y; F h4 u5 k
# S, q1 b6 n. t3 R2 _9.简单表格 ! U8 P$ a' z, [* B
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 6 L- A/ `4 ~. B/ ?: i
8 l$ a7 ^7 M; I9 b, l0 C u5 p- S: F0 X
\documentclass{article} ; V0 {7 f" R) e! \- Q0 A% w
\begin{document} $ u: A7 p+ n7 Z6 [3 G) N0 s
\begin{tabular}{|c|c|} ( r$ d1 p' ^* m aaa & b \\ 1 W" q2 G! `6 { D2 q0 n( A" V a c & ddddd\\ T5 S+ l: D" q, e' T& J* q, ^ \end{tabular} ( k. ?) A1 i4 b0 W+ G
& f! D! N) M; t
\begin{tabular}{|l|r|} ! p4 p- p8 N) r/ p! x4 ?1 W
\hline 4 z* a% y' P: |( p9 s
aaaa & b \\ " q U3 N0 L- P6 z) }* H. |
\hline 0 `5 _, E0 d( `9 i c & ddddd\\ ' F5 G3 ^3 J* D. ^5 m
\hline - X. C0 u- t* s3 S! N. B# _ \end{tabular} 4 K+ {4 D: d0 F! L
8 F2 B" n X# j: r; S0 m \begin{center} 7 Z6 {$ T1 t* Q* W B \begin{tabular}{|c|c|} 4 } i0 `9 J2 Z- `4 g
\hline 5 h7 f' ^- @, X7 ]. X) B- o$ ~6 j
a & b \\ \hline 5 G. s* \3 Z9 V# {: L# \) p# _& [ c & d\\ 0 O" h( h9 Y: q1 \& j/ R& c
\hline : f5 |; L8 V( _$ y2 `
\end{tabular} 3 O- b, m4 E: \" D1 a; ]- {
\end{center} " \7 B* z3 B( U% I\end{document} " ]5 n* f# f, ?( U, n/ D" t+ R + E: I: x7 l' ^- [) {5 [注意观察有无\hline和有无\begin{center}的区别。注意观察\begin{tabular}后的lcr的区别,分别是left对齐,center对齐和right对齐。 , _& ^$ k/ W$ l- ?4 F 3 N" ~0 A& `( y9 L( `3 Q* p6 E: T " ^, Y+ h& W h6 K* Q1 u' L$ u3 \10.结尾 8 W6 ?: z5 p, B6 Q8 ]+ v到目前为止,你已经可以用LaTeX自带的article模板来书写一篇基本的论文框架了,至少你已经能够借助搜索然后复制粘贴这些命令例子来开始用LaTeX编辑了。 V0 ]% @' F2 j c2 N! d
在论文从框架到完整的过程中,必然还存在许多的细节问题,比如字体字号,比如图片拼合,比如复杂的表格等等。 $ G& C, P4 @4 c" s
那些问题,就请咨询google吧。通常来说我们作为初学者会提出的问题,早就已经有许多的先辈们在网络上提过同样的问题了,看看别人的回答就可以。 # Z% G4 x( \ f/ n1 m- k
LaTeX在国内的普及率并不高,因此许多时候如果搜英文关键词,会获得更好的效果。1 j" |# w+ S7 y, a/ `1 V& _0 e
M8 e t4 a9 ^. E9 c) f" G0 u; L) w# a8 u* b% C2 P7 A s7 F
=============================== . n. u$ {3 J; R4 s+ o附录,有关我认为不是新手急需,但是的确比较有用的信息8 z6 o \% G# h; k0 H! _* v