+ q7 R3 u( U7 N B. e3 `2.第一个文档 7 J- T& o; T; U9 D5 U; B打开WinEdt,建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8。 " u$ Z( O% D, O+ ?& m8 R) W( \1 `$ v- _2 f3 Q: I1 e! |3 ?: z( @3 n. { a5 }
\documentclass{article} - G/ V8 d5 f/ R+ B; ^\begin{document} " k+ a. U' y* D
hello, world I. Q7 u6 N+ h0 V& g
\end{document} , e6 d) b( V$ F5 O; D& r
$ K, r2 q' F1 b5 J
然后在WinEdt的工具栏中找到编译按钮(在垃圾桶和字母B中间),在下拉菜单中选择XeLaTeX,并点击编译。 (这里请注意一下我之前一直笔误写的XeTeX,给大家带来困扰深感歉意) # \5 A9 i3 Y- k) k9 |! s' ?如果顺利的话,我们就可以顺利生成出第一个pdf文件,点击工具栏中的放大镜按钮就可以快速打开生成的pdf文件。 ; {. `6 x7 g# M Y7 ]* P* q
% s. b8 f* B$ K0 @ : a6 @; p/ f, k+ J! f3 Q/ K3.标题、作者和注释 " h3 S8 P- E, Y9 }建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 " x7 N6 o5 @' [& ^- G+ F3 ~ 0 _7 J$ S( |" u& w\documentclass{article} 3 L0 q: S+ C D/ w/ w
\author{My Name} 3 G2 A. T& m9 ~/ ^3 m
\title{The Title} 9 e' C5 I U; Y2 ]\begin{document} 8 D9 ^3 N: E5 A' d6 a0 T
\maketitle 3 }6 M; e' `6 U: L& O m; P hello, world % This is comment 5 b% {( h/ e! S& W
\end{document}" u8 c+ V w0 a, K8 x0 Z
" G6 i: e R" B$ B
%为本行右边所有内容被注释掉,在生成的pdf中不会显示。 # q! c# v+ Y, L, F7 F9 @ : y) m5 W) \ R2 u$ O. v7 i1 u, h, O块注释也有专门的语句,不过更方便的方式是选中一块区域点鼠标右键,点comment - `0 z4 f. y6 h! S
* d$ q5 O$ ~ G, p3 ]3 P" h o3 G8 L7 B% j% n1 \' r1 _$ h
4.章节和段落 5 a& q7 L4 R6 K$ g
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 ! ]+ x- M7 ]) s \3 s3 A" f5 J* u # N1 c9 g5 R( q\documentclass{article} ; y1 _ T$ x3 A$ f# \, C9 q
\title{Hello World} / i% Z) w/ @/ k& T. X\begin{document} . g* u, H! s+ P7 l) Y \maketitle + H9 E, s, m5 J: z \section{Hello China} China is in East Asia. * Z' d$ ]' i7 ?5 ]4 Z& a \subsection{Hello Beijing} Beijing is the capital of China. 8 z: p+ i" ~4 f6 X- S$ F7 R2 Q9 t
\subsubsection{Hello Dongcheng District} + Z# ^0 E2 i5 }+ K
\paragraph{Tian'anmen Square}is in the center of Beijing / s7 t' ?( B5 U9 N6 M
\subparagraph{Chairman Mao} is in the center of Tian'anmen Square 5 R0 }) j7 ?' _" S. z
\subsection{Hello Guangzhou} & S" L# ~6 e. A N
\paragraph{Sun Yat-sen University} is the best university in Guangzhou. * w6 h8 K2 J, T; t
\end{document} 2 ]4 O, s0 m1 O. @
0 J, Q# P( h, h) B2 p
退格只是我个人偏好,看起来层次清晰美观。实际操作上未必要如此,每一行之前的空格不影响编译生成PDF的排版结果。 % A. ^/ t8 I1 y3 y, C: @' ?2 r! i4 T" B4 K. w/ u! C& F
) c' l* }5 V: d
5.加入目录 1 s1 y" o+ @& {% H; H
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 * Q, m) {% y7 S% c& s) I 4 g" ^' \* `2 p# ]' Z% d\documentclass{article} + T& D6 w& f+ i5 {+ C\begin{document} ; _) H; U( p: A* W# k- i- p \tableofcontents 4 ~1 x! a: I2 u, G9 ~2 y% R
\section{Hello China} China is in East Asia. ( t4 o7 A6 J0 `$ e \subsection{Hello Beijing} Beijing is the capital of China. + r+ F9 R! t5 b$ V B7 _ \subsubsection{Hello Dongcheng District} # I) G/ t3 [+ Y4 c4 s+ U
\paragraph{Hello Tian'anmen Square}is in the center of Beijing 8 I! n# n n" G: l2 s; I; {. i
\subparagraph{Hello Chairman Mao} is in the center of Tian'anmen Square l$ P9 \2 ^: ]8 T\end{document} 1 p0 V3 N% [1 b% y+ Q
7 c. N7 M0 ]5 O$ n
6.换行 * l4 n% ^; m/ y# E0 [6 {+ ~5 b. I: E建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 6 H8 s+ W, Q( m- r\documentclass{article} : U8 M# Y( [$ v: `# ?
\begin{document} ) M9 z- d3 ~ P Beijing is / I2 u4 f" F; F: K9 v, `
the capital . P( Q6 Q y: S* j& C4 \) a
of China. . G( j5 K7 n$ @+ g H8 c2 n7 d3 b
( F0 }* j+ B2 K4 i* D4 z4 w& R
New York is + \# U. w2 J" q+ C* [
' A- d7 D2 o! J3 {2 k, q the capital ) }. d' i- L: I : e" h5 p+ N/ O% M of America. . k7 q/ _$ c7 |# F/ q3 t
" r# N3 b: C$ x8 O! M0 d
Amsterdam is \\ the capital \\ : f7 G7 e f# T, L0 ~3 { of Netherlands. # \# _- i. j5 ?
\end{document}- _0 H9 M' D) O, p
2 X" E- V, o; _, }: T' N2 ~
空一行为另起一段,\\为段内强制换行。 & Q# i: _& |8 e0 i' g8 v6 d0 j - p8 [! L. s6 a" k5 e0 ?) B% O2 y3 p. U9 U# o3 a( K' h7 p
7.数学公式 " [ P' t4 |0 }3 D
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 . n# t: v1 g, k6 S# [5 `( j
2 d! T# w6 K! N$ Q Y
\documentclass{article} ! `# \3 e! w# U9 U \usepackage{amsmath} ( @7 J6 C* z% V( v' _- G
\usepackage{amssymb} . E* M+ o( @+ {! f1 x( l\begin{document} , C( \, [. o- {+ ~6 o$ w& Z" l
The Newton's second law is F=ma. & j7 S' ~& X8 ~/ Z& g. p. r4 a% b
- z3 [( G: g( Z5 C; U
The Newton's second law is $F=ma$. / W' W1 b4 ?; p. c$ H7 G0 ` 1 @/ t ?" S9 ^4 y The Newton's second law is " F( _. u @8 r: A& P" m $$F=ma$$ # t8 F. B2 ~4 D/ ?) K/ ^ 7 H3 E5 A8 e2 T! l The Newton's second law is ! n4 N# o# C- w+ _0 {6 H
\[F=ma\] . T" @( Q/ B& d1 v+ O$ M9 I% ^$ U2 @
Greek Letters $\eta$ and $\mu$ s4 y/ F# c/ g) F" g8 @0 B9 c7 s3 ?# f/ Q) o9 T
Fraction $\frac{a}{b}$ 6 M7 V! Q \$ m9 T/ s; G* c' g0 x: w, J, N
Power $a^b$ ! L9 A" |+ }5 i( j/ y, `# k