% E* i$ Z4 s5 T3 O% G V: B7 j3 j. _( \& Z6 V2 J8 x
# \1 c' |# V; x7 W2.第一个文档 " {0 |7 L2 v+ b8 n# w) |8 {- I
打开WinEdt,建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8。 + u$ [+ T* [/ f. b7 c0 H5 @! C, _8 g+ \
\documentclass{article} * K5 p! m, w A) K1 o$ V' o
\begin{document} M/ r( z, |! e2 a+ x* C, g hello, world $ F3 s; y9 I7 p* n8 U8 S' W
\end{document} / L& ]0 R$ f2 g2 x9 P' A 9 T8 _% Z$ m. S2 U; Z" R然后在WinEdt的工具栏中找到编译按钮(在垃圾桶和字母B中间),在下拉菜单中选择XeLaTeX,并点击编译。 (这里请注意一下我之前一直笔误写的XeTeX,给大家带来困扰深感歉意) " y/ `& P6 K* {6 m
如果顺利的话,我们就可以顺利生成出第一个pdf文件,点击工具栏中的放大镜按钮就可以快速打开生成的pdf文件。 ( c" f! K* Z' C& K, i h" v: H
% m7 s2 B/ A8 { ! |/ h5 W" L; w6 e3.标题、作者和注释 # a' W, d! C4 `& W; j建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 ) s# G& k; R E4 m/ Y( w3 n$ N- u; w! L
\documentclass{article} % ?5 P- q( P+ U' H
\author{My Name} 4 L4 O0 c. F3 \& n8 e' Z# O \title{The Title} $ q& k( p. H$ z, }" A2 p
\begin{document} 1 f9 Y' b, R7 k5 _6 k" D- w. I$ S \maketitle * N* Z8 p0 L- @ hello, world % This is comment 9 i! s9 x4 O6 p! X% x\end{document}# o0 X% C7 @* B) @! Q& _2 x. A8 Z
. P7 f# H# K- ^6 z+ @
%为本行右边所有内容被注释掉,在生成的pdf中不会显示。3 n6 ^. k8 N. t8 B
9 }' x) y, I% r2 f; _ E
块注释也有专门的语句,不过更方便的方式是选中一块区域点鼠标右键,点comment . C% _2 O3 L9 F v$ T6 i
8 x% |- J8 D1 ^% q: D/ }
- [! Z+ F2 A) V5 m' X5 O5 G2 S4.章节和段落 4 r5 P' w( H. A% w2 p建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 5 ^3 c( a- {+ R7 a $ Z! j: k! e4 k7 x! a! @: r( r+ s# B# A\documentclass{article} ' M& m. W: @& O2 c9 n% z \title{Hello World} - W7 @4 N& s$ J\begin{document} * U' b1 K* `6 |. f5 S \maketitle 3 ^0 I) D6 U5 a; C- c$ H s \section{Hello China} China is in East Asia. 6 k" U. x" t. X- a$ w
\subsection{Hello Beijing} Beijing is the capital of China. 3 z" x# ]/ O2 x \subsubsection{Hello Dongcheng District} # a6 x# W* L8 @' p7 U% G6 U' o G3 E
\paragraph{Tian'anmen Square}is in the center of Beijing & _+ b. @6 n! @5 U0 D
\subparagraph{Chairman Mao} is in the center of Tian'anmen Square # |9 b3 |# D, }; p# G& s% h5 R
\subsection{Hello Guangzhou} ) q S. Z! R1 _& U$ G" c \paragraph{Sun Yat-sen University} is the best university in Guangzhou. : s" C9 W" N: D9 [; g$ C
\end{document} 6 Q9 ]- G N! T+ o e& |7 D* T! K
退格只是我个人偏好,看起来层次清晰美观。实际操作上未必要如此,每一行之前的空格不影响编译生成PDF的排版结果。 % @9 \# q* t( n" q
2 ?' {0 ~, C4 m, ] " [/ L& q E& Q, ?* c5.加入目录 : i7 K+ s. b( M1 _: w7 A建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 1 a5 G# m# M9 w& j, q8 _/ ^/ X! a! F; o( a! _8 T% t. [
\documentclass{article} / q. S) c# `! A- {\begin{document} 2 I/ e3 u7 d' [# `9 \7 Z
\tableofcontents % T$ U6 }# _5 U9 i: H) {) Q" k) w
\section{Hello China} China is in East Asia. ! |4 j# `) M( ?1 R
\subsection{Hello Beijing} Beijing is the capital of China. 0 `1 b, a- R' z, y+ n3 ~3 ~5 }' k, T \subsubsection{Hello Dongcheng District} 6 t5 j2 W5 F- n G+ }0 f! v
\paragraph{Hello Tian'anmen Square}is in the center of Beijing ' S. L) g( O! A1 Y \subparagraph{Hello Chairman Mao} is in the center of Tian'anmen Square . N1 Q/ W7 k% e1 y4 s$ ?& F\end{document} ' n- `& `) a# [$ Q
/ L: S0 l# y4 A& r& e9 ^6.换行 # q j. V1 ~: ^) o
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 ; {" }& q3 o0 }( @
\documentclass{article} ! m- z5 ^6 c- ?1 \1 ]5 u\begin{document} $ Z( i" F2 |$ L6 d# [+ {3 {1 q3 q4 R
Beijing is 9 L! O4 G/ g( r* v- _8 q- a, r
the capital ; ]% d" m6 C& D9 P% M' T' x of China. w* H1 u: v4 t& b$ s
1 m* l" W$ ^/ r% k5 N3 M New York is ; l& a) \8 O2 X6 ?" K- r/ V
# I/ V( d' [2 k! N: d( o$ D the capital 7 V$ Q* d& c7 w P. o$ K, L* Q% r n2 r 9 }; n1 B0 d3 c- M* v o& \ of America. 5 A: Z2 D" ?/ t% \' G7 B
# j- U, ~% m% F, {/ e# w2 D! |
Amsterdam is \\ the capital \\ & Y! H7 b6 W/ M1 j
of Netherlands. / I) K/ K$ p4 U+ M\end{document} " w9 P/ w$ Z9 @ & ~7 L+ p, q8 f" P3 s5 ]7 F; n空一行为另起一段,\\为段内强制换行。 0 n, P$ I% D* ~. b6 L% d# Z8 U + V/ N" k! `5 I0 U/ E2 r o: N" i; u' e4 U( U7 U8 `
7.数学公式 8 ~ R Y+ B' U
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 6 K' G$ o% H8 w) r! Q$ s
1 T7 I- _7 L% S/ P" M% e b, E; j\documentclass{article} 2 i1 B) s4 b: [ ~' D \usepackage{amsmath} 7 @* r$ g2 h; L( n \usepackage{amssymb} ?( h& T* s' Q. }. A; h/ w$ O
\begin{document} ! S+ q- q! Q, u' Z* v# Y' y4 J
The Newton's second law is F=ma. $ d, M* A# `: |) Y& F5 L
9 x! o1 @" |$ H" P2 Z
The Newton's second law is $F=ma$. 2 H1 e: |! V6 o, S
# z2 Y; Q/ X# k. j' h/ z- K
The Newton's second law is 1 \7 v0 y: f. ~ $$F=ma$$ / l, i* ^' }# U 8 J( L8 x1 q9 n0 h2 O The Newton's second law is ; ]9 c2 F3 P& C, a2 W' s" f6 t \[F=ma\] 6 Q |* j2 T2 h) Z; t8 Y
4 h$ a: S6 H3 C0 G6 C
Greek Letters $\eta$ and $\mu$ ; H! O) h/ i% @% Q( w" y5 k0 ^2 w; i* a7 L2 d! J J3 @! Q
Fraction $\frac{a}{b}$ 5 T! J# e0 `. `# X+ ~ 4 N' O7 B* p6 ]/ Q" M Power $a^b$ 7 C. ~# {& B* s! _! ~+ X, W/ e* }% F6 W
Subscript $a_b$ $ o7 D5 U# T2 @& P J7 N + z" ]4 Q Z9 Y# f6 ~ Derivate $\frac{\partial y}{\partial t} $ 6 w I3 ] V8 I8 B4 z
: z6 m6 E$ V! m
Vector $\vec{n}$ ! M3 x! Y8 h9 @2 T2 j1 q + r; W2 }% N/ D. i6 p) M2 o Bold $\mathbf{n}$ . I. Q9 p8 A/ K3 { " B2 C \& I( P# n/ ]+ `9 k. S To time differential $\dot{F}$ $ E5 }4 @; I3 ^4 E- X# H( ?1 W( t2 t0 B5 ^4 l! A
Matrix (lcr here means left, center or right for each column) * u& N+ T& I# }2 v- H
\[ ! }) M& W! X: |; x
\left[ . }! K5 t* v2 {/ I \begin{array}{lcr} L: g$ |7 w6 V) b' M
a1 & b22 & c333 \\ . B1 L/ l& n" y+ N d444 & e555555 & f6 - o% `8 U9 \' S) y: t \end{array} # j$ J* d# x. {9 n! g
\right] 2 s! t1 R( \" Z, z* W& z \] $ D: g9 O* J0 X8 w3 ]# j5 a0 T9 g' m
2 ^/ e5 j+ A: J% o5 D, [- G; EEquations(here \& is the symbol for aligning different rows) $ |- h {$ d/ N' D' H5 E$ f( L
\begin{align} # S2 U# t* _4 K+ h& G
a+b&=c\\ $ k1 \8 q* ^8 M d&=e+f+g . t; h7 K: c7 E. z# _
\end{align} , Z1 b% j: R, M/ c- \/ E6 K* [6 J5 g# l, z% L; B5 u
\[ 6 x7 x$ i; F9 c, E \left\{ ) G+ f0 G- ~3 v: e. m' y) t
\begin{aligned} ; O8 y0 I+ S# M5 }
&a+b=c\\ 8 @. _8 `! s2 |& C) _
&d=e+f+g 8 V) o B% H, q% l \end{aligned} 8 V2 f' z7 {9 c' `
\right. 6 b+ m* | E, f) m# V
\] 5 p) O+ K2 P8 Y* a P 1 Q% p" m' \' L& A" }\end{document} j/ b! [; s6 B( B 1 T6 k6 g# E% p5 B7 Z具体细节可以自行搜索LaTeX的数学符号表或别人给的例子。/ D( e: h. E; j& u8 ^! `9 P4 D