5 N, `* S* e' Y- d8 f- C+ \- ^2.第一个文档 # q; T" ~, Y9 z- G6 @4 o Q打开WinEdt,建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8。 # U4 O+ x' z* M: B% I9 u2 P$ u
9 {; L/ j1 x, X4 @8 Z\documentclass{article} # W0 M8 h l. N" y- ]; k6 w
\begin{document} 6 ^8 \9 ~ u# v; {+ s4 O+ l9 A
hello, world # r% E( s# I9 G- u$ [3 T3 Z\end{document} 0 F h( L5 `. |3 ?" f' e % [& g# c( k, Q9 R然后在WinEdt的工具栏中找到编译按钮(在垃圾桶和字母B中间),在下拉菜单中选择XeLaTeX,并点击编译。 (这里请注意一下我之前一直笔误写的XeTeX,给大家带来困扰深感歉意) - E6 n8 k I9 `如果顺利的话,我们就可以顺利生成出第一个pdf文件,点击工具栏中的放大镜按钮就可以快速打开生成的pdf文件。 5 }6 Z) f9 H1 g2 M6 Q3 F( f
6 q7 z3 ~- W- l$ c/ R1 o' C6 ~" k! {, [
3.标题、作者和注释 # e: J# x% d7 B$ e
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 ; ?$ Z2 J ~4 l* m* J
; x( o( k: T& U2 e5 s5 k
\documentclass{article} ) E. B7 f- U/ ~- \$ |
\author{My Name} 9 y5 D5 x7 C- J/ }+ Y8 } \title{The Title} ( q" g& c2 Z$ j\begin{document} * p2 i2 S& H5 W9 o* ~& l
\maketitle ! {# S4 U9 m/ W `$ m/ V7 Z3 \
hello, world % This is comment & R; U9 E9 n3 @' g% g1 Q6 c2 R0 G+ \
\end{document}; S2 B4 J( I+ _) K" O. B3 e. z
' E; C2 d* U6 d4 T( j%为本行右边所有内容被注释掉,在生成的pdf中不会显示。3 X, p& o' E7 V( l. l
1 Y* B# `+ {7 }5 x1 X7 k
块注释也有专门的语句,不过更方便的方式是选中一块区域点鼠标右键,点comment h) G% K% c1 _% [9 a# n; T% C4 i
# \4 m# |* t, p- c9 ?
; ]& N% l( ^ \& y- {( M4.章节和段落 + y( }7 Z; s( |# J0 E' Q5 u" `建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 : P/ t; W7 E6 r0 U1 e9 v" M0 ?7 N$ i! X; W$ U' b3 u1 s% ~6 U
\documentclass{article} # q: R( |5 }* i$ l7 a$ W8 S
\title{Hello World} 0 I) ?6 y2 P+ r
\begin{document} m( a( e+ z3 @ \maketitle 5 T" E. X/ t, H1 k) m
\section{Hello China} China is in East Asia. : C% V$ ^- n! U- O, @7 i: p" F \subsection{Hello Beijing} Beijing is the capital of China. ( D* E, r) i Y/ Y+ l' e \subsubsection{Hello Dongcheng District} F( D6 c5 @ }3 E/ t \paragraph{Tian'anmen Square}is in the center of Beijing ' ?# `" A5 m' R) k h
\subparagraph{Chairman Mao} is in the center of Tian'anmen Square 8 K1 Q3 V( s: M# Q, o6 E' p \subsection{Hello Guangzhou} % e0 S( d& `1 C5 d \paragraph{Sun Yat-sen University} is the best university in Guangzhou. ! ?( u% v& Q" H- M- y+ p
\end{document} ; i% l" L6 S+ v' K" O5 Y- ]* @" H2 R+ E5 Z' L6 X
退格只是我个人偏好,看起来层次清晰美观。实际操作上未必要如此,每一行之前的空格不影响编译生成PDF的排版结果。 7 C1 B7 f( z/ b) r/ {
+ a I9 R; h s9 P: G3 i! b
, y. l0 \. ]$ B2 |
5.加入目录 % v$ n7 l) `7 w, l
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 6 d" P6 g- V! G
Y. S: H: E7 t0 y2 }& x\documentclass{article} ^4 I7 \7 a. Q. @
\begin{document} ( p( T+ v% H; `8 E. O! ?# }, d$ B7 x
\tableofcontents 1 P8 S `( L" x5 N# o5 @+ r
\section{Hello China} China is in East Asia. " ~4 V- U: _/ U2 H0 i \subsection{Hello Beijing} Beijing is the capital of China. # t- A) M: S* S" ]
\subsubsection{Hello Dongcheng District} % s3 M% C/ ]' Y
\paragraph{Hello Tian'anmen Square}is in the center of Beijing 5 d/ m1 D B( p$ B* @9 `/ L \subparagraph{Hello Chairman Mao} is in the center of Tian'anmen Square 7 s- W1 u: A+ x/ M# k5 h; m\end{document} 3 r Y4 D. l: k9 ?7 s 8 \ h! r& F+ [3 ^% M% R- I! G6.换行 * i8 k4 O3 B; e+ `$ ]7 \建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 0 i' h6 T0 S* U# T: w- t" s\documentclass{article} 2 D+ U5 |/ T4 u% s9 \5 N\begin{document} 4 ^5 C7 ~- w3 m2 M7 Q O
Beijing is : d# Z+ m4 z* _, |/ S1 {6 R
the capital $ g& p6 C( ]: G/ I" R of China. . }/ O! h0 X8 s1 r
% U9 u) ]3 U0 _% { New York is ( _! G$ Q* J7 o2 C% T+ S! Z! b
# ]" `; |; c2 B. r' _) p
the capital ! Y: v% ]$ X7 o9 n: M& I 7 g. `# Q% a2 o- E- d' H7 w; E of America. 9 r# P/ v6 Z) @+ _ 4 b3 T& B7 u, Y' b( x* t Amsterdam is \\ the capital \\ 8 s1 Y! ~# i# }0 E$ Y: u
of Netherlands. ( w, d/ X& k0 B6 h\end{document}, y' p& k! N3 E# }& q% l# [
8 S, {& F+ a2 _ E# W0 Q
空一行为另起一段,\\为段内强制换行。 ( v: {) M' M& g3 W7 x
! e' C0 S7 r4 E/ s/ k& `: Y" s! y! {1 ` M0 F9 O. i7 t9 A ~+ T
7.数学公式 . O0 J" \/ Y# A. F! x5 C建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 9 ]4 }; `0 G+ g# T' n- J 3 Z5 _; n3 }2 ?+ J\documentclass{article} 6 J0 u( x6 q% r. [ \usepackage{amsmath} % r' Q+ g: X+ D8 k% X \usepackage{amssymb} 4 u6 p/ @1 Q. K) f# |\begin{document} % D' k3 q% N3 z7 r. C! g- W o The Newton's second law is F=ma. * a# v! i w! s6 [6 J 3 g- r' P3 e6 ~$ r, L0 p The Newton's second law is $F=ma$. t9 `8 l- V3 h) S3 j+ W6 J5 _4 v* F# X& {5 ^ c
The Newton's second law is 0 I3 b; \3 D4 g! q# x $$F=ma$$ % H$ M# ^* O* x" _' X8 S) _
' h/ ^& G+ w1 D# @ The Newton's second law is . r+ d* C2 ]- t% |) j& f \[F=ma\] & T R: d8 O0 s: g' Q' z9 T
0 o0 B3 ]/ s4 w( F1 U2 P$ w Greek Letters $\eta$ and $\mu$ o3 p. m# m" ]" K # Z4 {4 u. E9 x `2 A0 s Fraction $\frac{a}{b}$ . b$ e6 V, {/ R3 r" {; \ 7 }6 u* V: p3 b+ T9 x1 A9 G Power $a^b$ . _5 K( X5 }, \" J 2 z/ l; B$ w$ n N: y Subscript $a_b$ ! n( w `9 E8 ~7 l
; U' B3 e/ k% d$ n8 v' k7 W
Derivate $\frac{\partial y}{\partial t} $ 7 _; V, M% g$ ~$ p
# V# L: o) x& x5 O Vector $\vec{n}$ 8 o$ S* t3 I3 r9 e# i( H 0 v4 T9 q5 Z1 [( @1 n4 z Bold $\mathbf{n}$ : {* j, S7 X1 n( N9 O 2 H- l! r! S2 R$ j4 [# p To time differential $\dot{F}$ : f I: g6 a+ O/ }4 T
5 \- |* B: J f
Matrix (lcr here means left, center or right for each column) " m4 q* ~& O. z$ U& d
\[ : C4 @7 `2 C/ P5 V9 ?2 z
\left[ # l# Y$ L- ?$ p ?( P) p
\begin{array}{lcr} 2 D! L: l7 f& n' S
a1 & b22 & c333 \\ 4 l1 \" u0 X. D& x+ V% p& y$ y5 h
d444 & e555555 & f6 2 x& u8 O) @% j+ f& I/ L4 K2 W/ g
\end{array} & s2 I$ B: w+ {
\right] . h2 F( g1 _1 z+ d. s \] $ g# g) x: d* t4 K! j3 z1 @( p / i- n5 {8 J x0 {Equations(here \& is the symbol for aligning different rows) S m5 y, I0 p; b$ W% w5 b
\begin{align} , [; g" j% t$ \3 ~
a+b&=c\\ P, H9 R1 q5 b5 W: U2 ?' `: o$ r* k$ S d&=e+f+g " F) h2 }$ w, p" f6 Q% n# j
\end{align} # d( A8 A% D* ~9 [8 o
- k& F! o4 H% ]" j0 g# f5 D) i
\[ , k& R% ^: s# w1 r. n) t9 g
\left\{ ) W3 _( v' w/ G \begin{aligned} - K& Y: G7 k: ~- [! N, c6 \ &a+b=c\\ ! ^1 @( a- G# E
&d=e+f+g , B; l& Q! E% G! F1 j
\end{aligned} 7 s4 j4 a0 @* W \right. & M6 g8 W# b0 p2 b9 b\] " [2 v; e, O X
P. S: u3 j" F
\end{document} " D+ b9 p) r4 K Y* [' C3 R3 K+ O6 [ f6 k. x5 s9 }* X
具体细节可以自行搜索LaTeX的数学符号表或别人给的例子。 ) ^! ~2 f6 i1 d/ D8 i- O8 f 4 {$ b6 a' o' ` 2 u7 m2 o0 _" C% q
; d) G& {- Y5 @
$...$是开启行内数学模式,用于和文本合在一起使用。" u5 t8 X. ?) k/ c7 B. q7 g# E