; u! x: R) S" Q; b8 m方法A(自助):在MikTeX的官网下载免费的MikTeX编译包(150Mb)并安装。下载WinEdt(9.5Mb)(收费)或TexMaker(32Mb)(免费)等编辑界面软件并安装。 , b# W. d Y! O8 z方法B(打包):在ctex.org下载ctex套装(203Mb或1.3Gb)(含MikTeX及WinEdt)4 t. p* J( _2 v B$ j/ z( H
新人不必纠结软件问题,随便什么软件随便什么版本只要下载下来能编译出pdf来就可以,先下载了装上来试试再说。我推荐winedt也是方便我在介绍按钮样子的时候可以统一描述。$ R; B( i% n9 T% w
a1 I' X' m2 H" Z, _
2.第一个文档 9 j6 l. A9 i& u2 n. ~打开WinEdt,建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8。 ' T1 M1 L4 a2 ^) H0 ?$ g+ O- J( \6 o1 O" E) r
\documentclass{article} # t! @1 I; D u* s2 y
\begin{document} * X' d }# C5 ~- O hello, world : e. k3 N7 E4 H- i; N( J
\end{document} & S" j- p! T7 J, f( w1 K0 a* n# P' c
然后在WinEdt的工具栏中找到编译按钮(在垃圾桶和字母B中间),在下拉菜单中选择XeLaTeX,并点击编译。 如果顺利的话,我们就可以顺利生成出第一个pdf文件,点击工具栏中的放大镜按钮就可以快速打开生成的pdf文件。 ; H3 W& X" j+ Q+ ~
2 B4 W8 {' g# l# ?- O( o3.标题、作者和注释 7 B. X G3 x1 @9 U; A# \/ ^" t$ x" w8 v5 y建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 : t, s* n( L5 A. _* n- Z. `9 h+ x% V l$ M! D R3 M6 J8 a! D$ w" N\documentclass{article} 3 ^1 N0 j6 M3 b9 l$ `: f3 \ \author{My Name} 3 l6 E3 a+ s5 T4 _0 b0 s% C
\title{The Title} 1 D# J! W9 i9 q/ ~9 N* r0 e1 z
\begin{document} ( _) j3 s6 P! I/ y
\maketitle # e, }1 g: l0 i
hello, world % This is comment 5 H6 M5 I1 y0 j, N7 e- V6 t\end{document}4 e1 H. K6 O) ?% L5 g7 Y
%意为本行右边所有内容被注释掉,在生成的pdf中不会显示。/ Z! Z$ O6 |2 w1 ?4 @- Z: E# E
; x; w" P+ m: d% P; R2 L8 N8 L4.章节和段落 $ @1 @( q" `3 b# p; B) a1 Q建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 7 H, D; y$ e$ V7 l ^4 b4 Y5 X # j: i+ L+ v# S0 R0 K/ z0 n\documentclass{article} 6 Z3 k! f+ |* F7 A4 Z" l% E4 W \title{Hello World} 5 q. `3 O) P# v* Q7 E\begin{document} 0 j( p& V& L* U- {. B% n
\maketitle 5 z7 q; f) O6 W5 [5 E- f0 t/ M \section{Hello China} China is in East Asia. / B8 V4 r1 ^6 _5 x e \subsection{Hello Beijing} Beijing is the capital of China. 1 _9 h# p+ W: m; O7 r \subsubsection{Hello Dongcheng District} 6 e: m' q9 i% ]. w x; b/ Y \paragraph{Tian'anmen Square}is in the center of Beijing / H1 q5 \ ^! c
\subparagraph{Chairman Mao} is in the center of Tian'anmen Square 1 o( `# w8 h; n- e$ X \subsection{Hello Guangzhou} 7 K' c$ u5 v( l' R+ u& l; ^, x \paragraph{Sun Yat-sen University} is the best university in Guangzhou. ) u2 g) o! D- @: [' d4 \) j. m0 w
\end{document} * z( |) N1 [) |& i0 {4 Z; m
& }/ w. R4 M- _; B/ x退格只是为了看起来层次清晰美观。实际操作上未必要如此,每一行之前的空格不影响编译生成PDF的排版结果。 9 _% Q' n8 ?/ ~$ O2 J1 p ! P8 z9 X j" g) ]* M b5.加入目录 [ y" F. d- U" C7 H% t
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 3 J/ A4 O* y1 e8 B7 I7 C# V ' @; X: h" ]' e: ~8 D/ O m! @4 O\documentclass{article} 8 c7 }9 Z% m/ Z9 ?5 {. e
\begin{document} - A3 l% C0 L/ Y- d
\tableofcontents : o5 r( m) R, ]4 @ \section{Hello China} China is in East Asia. : f7 {: W/ E# H% J. k0 w4 {9 M
\subsection{Hello Beijing} Beijing is the capital of China. 9 }2 X8 \7 ^8 u. G/ E \subsubsection{Hello Dongcheng District} ! H) d( m% e3 k8 W
\paragraph{Hello Tian'anmen Square}is in the center of Beijing r b* }# S0 M4 m \subparagraph{Hello Chairman Mao} is in the center of Tian'anmen Square ) W+ M Y& g/ P# u8 B7 H2 q\end{document} 1 L+ n) \ [* ~. L5 J2 ~3 i u8 A; f
6.换行 # C6 _, M8 L, X- h7 L/ \. M
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 ) ~' ?% f& ~; r9 e! h
0 q* Y H1 z/ G$ @" b" Y: T( f. O
\documentclass{article} 4 ?- m! l+ a# \8 T& B, A: z
\begin{document} 3 e _% o% f9 L. t9 `' r
Beijing is : K$ a0 Z, p [2 ^
the capital % R2 j. d4 J! {
of China. 0 E+ I+ Y& w) M) D J1 f2 i$ j
5 F: K! g3 |/ K Washington is , ]; j5 w$ }+ u* _% S
/ m' S/ U* S! X; s9 C the capital ; N0 A) ]4 F; i! [! z
) v% U6 X5 P6 a! z* G of America. 5 M% k( Q _$ u$ l- |
! {' \3 G5 U( P1 K" Q! K Amsterdam is \\ the capital \\ 9 Y: _ P, W4 I" n: N4 ` of Netherlands. : q: y" [. e* W: k" `
\end{document} & [$ s! f7 s: k* o! ^7 E : I# N8 C3 |) L4 Y& C/ J空一行为另起一段,\\为段内强制换行。0 [! K1 Y: J9 j7 [; k4 n
我对之前手滑写出New York is the capital of America这类低级错误表示非常抱歉。+ v& p( C# E# Z% \: W
& ]6 ?( k. h7 N1 |' p( M
7.数学公式 * ?3 \& ]& l3 _) H+ _建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 4 w( N5 ]* k9 v$ _
/ X+ O0 D: Z: B. W9 u& q5 V
\documentclass{article} * X9 g# M( j" R" ^ w! ? \usepackage{amsmath} ; V% N; h5 c* G" ]5 L' Q4 v. S \usepackage{amssymb} # m4 \* R9 T3 F/ W/ Z0 U/ y* @\begin{document} M% x6 |1 \* a
The Newton's second law is F=ma. 9 K7 V) j3 y4 w, ]# A 5 H U& k j7 f" P The Newton's second law is $F=ma$. * l, k6 T4 H7 j, x% V4 l
$ q& @* Z! P8 s* A9 [/ y+ O6 Q The Newton's second law is $ {: ?4 `! a4 }7 y $$F=ma$$ ! t# ]3 m$ a7 u- e
, a7 V. D( o$ {3 ]9 q$ u' S* K The Newton's second law is 2 ^! d! E: s2 `. J
\[F=ma\] ( J5 Y. x- J5 }* J$ }1 P# P2 h. \ J2 m
Greek Letters $\eta$ and $\mu$ 5 R! m& W* Z$ Z4 j; ^6 a# Q0 H* T/ y! x' r. R! y7 V0 ^) c: ]
Fraction $\frac{a}{b}$ # r+ u( k7 R* O% x 0 A, s' f' p$ H: R1 K0 M" N Power $a^b$ " y ~1 \3 n5 B6 w