4 e d% k+ n# b0 N5 F' G. n- o\documentclass{article} # l% z1 W) U) m' W- s( q; \\begin{document} 2 M* c9 L2 s' v6 ~9 _- h7 D% x2 d
hello, world ; j* X" C+ M* T' x+ I, s; x& S\end{document} 9 D) L4 O% J5 O8 U0 s" U" I
* s! R# }0 p' {( N6 G4 `$ M8 t$ [; @; l
然后在WinEdt的工具栏中找到编译按钮(在垃圾桶和字母B中间),在下拉菜单中选择XeLaTeX,并点击编译。 如果顺利的话,我们就可以顺利生成出第一个pdf文件,点击工具栏中的放大镜按钮就可以快速打开生成的pdf文件。 , ]5 o% }0 I" [- a. ?6 s8 A( {9 [0 D2 u ]0 W( L( T2 k/ O; X
3.标题、作者和注释 # ^/ E/ X& p) R+ o6 f建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 7 ~# H4 s0 L# Q7 l# k+ v : L( x7 M1 V& S3 k1 S/ j0 y\documentclass{article} 1 s1 k8 x" s6 @" E1 K8 x0 i
\author{My Name} $ R$ l8 M3 ?( Z- J2 u) v% N% V
\title{The Title} 8 e, y- I* H$ H
\begin{document} $ a$ P2 G5 _+ A! ] \maketitle 3 O& s, `: D! I
hello, world % This is comment " A: m9 j, q0 E& }
\end{document} # a9 m& Q6 u% Q; s$ M%意为本行右边所有内容被注释掉,在生成的pdf中不会显示。 * [2 a* k# C$ [4 |9 m2 u4 B: B& O( [& Q# q8 Q
4.章节和段落 ( Z) H# \ f+ l$ U* f, T建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 . x- F, J" O7 [- E6 P1 c6 T- M( t9 V
' [$ w x) U! L! ~& n& p\documentclass{article} + A! R% b \3 x6 W2 R7 ~! i" K3 x" E \title{Hello World} : N0 s/ ?) o& G6 ^( P\begin{document} # t0 J. n% X# E* ~$ w5 F% E \maketitle $ p- h9 H% b& A0 k# u
\section{Hello China} China is in East Asia. . }8 m' }# j& ^ \subsection{Hello Beijing} Beijing is the capital of China. ; [" \% w$ {9 N; G9 ~8 l \subsubsection{Hello Dongcheng District} , X% G% }6 U0 W3 ~; I B \paragraph{Tian'anmen Square}is in the center of Beijing 6 x; Y2 Y5 {# O, I! L" D6 A, m: M
\subparagraph{Chairman Mao} is in the center of Tian'anmen Square 4 M' N' G4 b2 ]. f4 u( I/ g$ x \subsection{Hello Guangzhou} . E. A0 m) s! P \paragraph{Sun Yat-sen University} is the best university in Guangzhou. & c0 ]6 o( {9 X1 e\end{document} 5 T1 k9 {& o! l+ `6 T: z& r 0 z' r! h2 Q$ E$ N- C退格只是为了看起来层次清晰美观。实际操作上未必要如此,每一行之前的空格不影响编译生成PDF的排版结果。 0 X2 ^2 ~) ]2 n6 O. Y1 b
* i( o% D# E# f& n% p' M/ W5.加入目录 % T. H4 a* j. D7 s2 @建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 + W) e' G% ]4 h# f
2 \2 @4 U0 N' ?! p! L1 D5 m\documentclass{article} 8 m# \, R6 y: y$ n' o\begin{document} + }! n* }+ M) w9 D5 F" h6 P \tableofcontents . P+ F- [8 P) X& p2 {, q. p9 Q
\section{Hello China} China is in East Asia. - s: v; A2 i1 v$ }% ]# r4 z) V \subsection{Hello Beijing} Beijing is the capital of China. 1 d' c, O/ I3 v+ q* V- C! r0 A6 \
\subsubsection{Hello Dongcheng District} % K# s+ \4 ]6 t/ _4 F7 j \paragraph{Hello Tian'anmen Square}is in the center of Beijing 4 C; F$ r$ C) [+ T* F; j0 J \subparagraph{Hello Chairman Mao} is in the center of Tian'anmen Square 4 `8 Y6 N* t' q: g1 _\end{document} ! k5 h+ q5 c2 Q/ ?- S& S/ \8 w2 Y' S! k# o0 ]; y7 v, P0 d
6.换行 * o. G2 E5 z; u) T" p9 ]0 x4 q1 p! d
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 ; [) w1 f! Y) f! s6 D- ^) Q) V* e
\documentclass{article} 1 B t, A; T( b% A
\begin{document} " Y8 H* b$ ~# l Beijing is 0 n5 ^/ ~, e' e- d: H2 J% H, R the capital & a# @3 W& j5 @, r
of China. 9 R7 Y r% M. g+ r
3 u, k+ p) k2 q6 [ S R. w; `0 n
Washington is 5 k6 v' {7 l) [& [+ w( G* ]/ T' ^
: @. f: o3 ?, X- j. l the capital : P: g8 k. x" i) C8 [ 0 Z3 j0 f! w* M& I( Q7 }1 q of America. 3 h2 s& B9 D0 ^- h% L, H5 d( O
8 |3 N4 V4 I3 z( z5 @ s
Amsterdam is \\ the capital \\ # ?' b' g7 I- X of Netherlands. - A+ f& D, l# Z8 V6 K6 ~8 f5 q3 u
\end{document} ' m6 v+ n8 R7 Y7 u / T Z6 C% [( b6 x空一行为另起一段,\\为段内强制换行。0 W4 z K, }2 L8 |+ Y& O
我对之前手滑写出New York is the capital of America这类低级错误表示非常抱歉。 ; a( q0 } X7 Q6 o1 b& u5 [+ G& ~& _3 x, z- h* S/ E
7.数学公式 o3 k5 b4 d$ o, g$ V k建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 3 S9 G3 Z2 t" q' ? |( }6 D! b% l
\documentclass{article} : j! k# n) c4 C! D/ L& r" a \usepackage{amsmath} ' ?; U9 d2 V5 R+ p2 `8 x1 v
\usepackage{amssymb} + f6 O7 Q+ N* [) w+ `5 P\begin{document} . }" [. g5 M- x1 d" O
The Newton's second law is F=ma. 1 J9 l# o/ ]3 h' u
6 u/ R: ~$ y/ Y& e z
The Newton's second law is $F=ma$. ; C- s+ X4 ^- x4 z4 _ " ~3 V: x. Z; ^! F, g7 G# B The Newton's second law is $ v, R$ i6 R5 @) i7 _8 P& d $$F=ma$$ * P5 H/ p: i; v6 a" z; D& a! B# f( u# N! i) x+ z* J
The Newton's second law is $ f* p/ V2 S: h. D3 e6 i
\[F=ma\] ( f5 Y- ?2 X6 q7 z% ~
& r8 M# D. z. V( _. d
Greek Letters $\eta$ and $\mu$ 7 s8 i9 G% f; {4 T 5 S$ I# ?( a+ q D$ \3 k: f Fraction $\frac{a}{b}$ + U0 r, k9 t; z( B6 l9 s / o0 M3 J& _. i0 |/ I Power $a^b$ 0 H. U. e. {2 K: |9 I& m0 I2 {6 M6 m- F7 ?) Y
Subscript $a_b$ # y4 a9 i" e: \3 P8 l0 z) d
. A( v. ?/ B. p Derivate $\frac{\partial y}{\partial t} $ ( \8 ?: C) P5 f: A1 Q6 W