1 W: G2 K% r* X方法A(自助):在MikTeX的官网下载免费的MikTeX编译包(150Mb)并安装。下载WinEdt(9.5Mb)(收费)或TexMaker(32Mb)(免费)等编辑界面软件并安装。 b& O! m n7 ?1 }
方法B(打包):在ctex.org下载ctex套装(203Mb或1.3Gb)(含MikTeX及WinEdt)4 {! W. g# l2 K: ~
新人不必纠结软件问题,随便什么软件随便什么版本只要下载下来能编译出pdf来就可以,先下载了装上来试试再说。我推荐winedt也是方便我在介绍按钮样子的时候可以统一描述。 + {( U+ u. @2 b9 m! Q$ A2 ?$ }7 ]+ s# N
2.第一个文档 * t4 z. s! o8 p1 W# x打开WinEdt,建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8。 6 s8 g# q, ~ [1 X; c
, M5 c1 V4 T* k! Z8 @- e\documentclass{article} 2 ^% a0 x6 y% c1 L& h$ b\begin{document} ( c Z( P8 h/ {1 t: x$ E' M
hello, world : W, ?/ j2 I" [4 {4 e0 {7 N Z: s! E r\end{document} / v% E7 h" Y" w/ s! d* ]
9 V) L2 U0 C2 N8 L/ l* Z4 f0 r然后在WinEdt的工具栏中找到编译按钮(在垃圾桶和字母B中间),在下拉菜单中选择XeLaTeX,并点击编译。 如果顺利的话,我们就可以顺利生成出第一个pdf文件,点击工具栏中的放大镜按钮就可以快速打开生成的pdf文件。 & N6 {3 I4 `* h. c* C0 F& M ) k' r0 c2 z! U3.标题、作者和注释 6 _6 ~9 ~, S# n建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 ! V4 A( X8 X- E8 F! B! d4 E2 A / M* I8 |3 x& ?$ k\documentclass{article} ' h2 A2 e9 r8 w* K6 H' K) I2 q! Q
\author{My Name} 6 u/ c8 s2 p+ V, H
\title{The Title} 5 V" ?3 S5 |5 a7 n0 y\begin{document} ; w& Z4 s4 n& ~6 N/ \3 ~# q
\maketitle 4 I* l1 i% }( y; [ hello, world % This is comment # |8 K) c3 J5 Y* V K6 f
\end{document}3 B+ I9 O( U. l7 Y7 R% X+ d
%意为本行右边所有内容被注释掉,在生成的pdf中不会显示。5 q# S( g, c, c7 x5 k
* p1 T+ z6 K/ W3 G
4.章节和段落 8 P1 C$ Q3 A) I9 W0 N建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 ) H" @1 E" c M/ l6 C" o. N. ^ s& m; Y/ n% C
\documentclass{article} . N4 }/ g8 T: [8 W
\title{Hello World} & A3 N" w; {1 I8 J: J! v5 w1 A; k
\begin{document} % \" Z, X3 k) P- K5 e/ X6 Y' j \maketitle . \/ |/ u$ X0 w6 `0 V* m
\section{Hello China} China is in East Asia. 8 ]9 A4 [* v: F
\subsection{Hello Beijing} Beijing is the capital of China. # n" s& u$ b: g0 j1 ^ \subsubsection{Hello Dongcheng District} 2 @: @: r0 [5 v `7 Q7 K" E O \paragraph{Tian'anmen Square}is in the center of Beijing ' g3 I4 A. k( X- b# S# g
\subparagraph{Chairman Mao} is in the center of Tian'anmen Square . R0 k6 t( i7 Q4 @, b" z( r! l6 p
\subsection{Hello Guangzhou} 5 U+ S! M9 t* t5 B
\paragraph{Sun Yat-sen University} is the best university in Guangzhou. 8 R3 V. |# k% s4 Q3 W5 E3 r, B3 p
\end{document} 8 x2 q* T; o# g# L: H% q' `
7 @* ~0 L% o" e( j {1 ^8 w+ c退格只是为了看起来层次清晰美观。实际操作上未必要如此,每一行之前的空格不影响编译生成PDF的排版结果。 # O5 V% u' p" o" G5 l + v, p# s _; P# F1 n* i( b3 h* U5.加入目录 9 S* _4 [; z6 [1 W6 F& o
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 $ h$ l) |+ n+ Y/ d 1 G( P. ]9 |+ }8 r+ _3 x) b\documentclass{article} " q1 V) U4 U9 }- f\begin{document} 3 w9 k% O7 H {. U2 M \tableofcontents , W3 B; N4 \: ^- F0 d \section{Hello China} China is in East Asia. 9 O7 ~+ a+ F) u, I
\subsection{Hello Beijing} Beijing is the capital of China. / n$ }( e- ]2 k1 F9 L4 Y$ T- H
\subsubsection{Hello Dongcheng District} " E- p* d% D* F
\paragraph{Hello Tian'anmen Square}is in the center of Beijing ; o1 K$ A2 u& F- ^% X
\subparagraph{Hello Chairman Mao} is in the center of Tian'anmen Square % l- Z% i4 X* R1 e# [7 I7 M9 t1 C\end{document} , G0 n* T- G- e1 G8 U
, }- r' q% Q+ |* R; \( m% G
6.换行 1 K3 V4 [% }& w建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 * H6 o3 L6 f; y& ]8 X2 B* R
, U4 h: {( `0 A" T5 v
\documentclass{article} % O2 i: _. L `% d; g
\begin{document} . M. p* |- s T. @4 S% l/ z! V
Beijing is ) [5 J, I- p- @1 B0 S0 `* ` the capital & W0 H8 w; }& G" Q& L9 M
of China. 9 }0 X8 I: `5 U! g& F: H
( _5 k4 x- { T& Q1 \. r Washington is 8 _# X( I' i$ D; Y" N+ T7 \
9 |8 f( U; H' E! w6 S* U the capital ) x4 N2 N( ?# p+ z7 F
, A8 e, Y5 g: c Y( S+ R
of America. ; c: f$ `7 U8 X+ F0 a * O. S5 W/ ^6 B0 X Amsterdam is \\ the capital \\ 0 [, f! S% ^1 R7 Z- z4 X5 A3 n3 q of Netherlands. # U4 J" F, \8 g8 c3 I- n\end{document}* F+ y0 C' o/ b# L$ ~
# z" {( s: K8 N7 d1 b2 B9 b
空一行为另起一段,\\为段内强制换行。 6 R }: C$ b9 f9 n# x我对之前手滑写出New York is the capital of America这类低级错误表示非常抱歉。' e. ^( J! H @8 o
0 _- t! |: |# J- I
7.数学公式 8 r% E- C7 b( e v
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 ' b- N9 ~- Y' ^1 a+ j( @! y5 D
# J$ f6 ]5 ]# V+ ~/ {3 B& p
\documentclass{article} 7 c. b+ Q) L5 N- J* d# [$ H \usepackage{amsmath} ! |7 ]6 [% V8 S& t
\usepackage{amssymb} / E" A3 ]! m* @* Y! h$ }9 k
\begin{document} 2 f7 |% M) R: `. g. N' ?0 m' E
The Newton's second law is F=ma. ' F$ R. Y3 [3 y% I
3 W/ V2 s9 f3 l4 f' f) u3 c
The Newton's second law is $F=ma$. ( W# v' D$ @" k" R+ Z' S0 X
' P1 B, S) W. f a) E% i8 b' ]0 }
The Newton's second law is , u% I- M6 \' j4 K7 s
$$F=ma$$ , q! d/ _- {; j. r
( @; \" B6 A: m" u7 S+ \ The Newton's second law is # B |2 f' y7 `% k
\[F=ma\] + x% j4 `( U. S0 q& p- ^, L
/ Z. y6 A8 o% |" ^% ]
Greek Letters $\eta$ and $\mu$ 2 G. i2 ~; U" q* q' w( e3 ~ % T0 T1 p8 n$ x7 s; i1 f Fraction $\frac{a}{b}$ : J( }' W k, u1 X( Y) ?