; r, T% o: T5 f t e; l7 C1 S. }& O" o0 R- C& k. N. ]+ J* O2 t/ A0 R( z
1.LaTeX软件的安装和使用 " z7 S& s! J9 n方法A(自助):在MikTeX的官网下载免费的MikTeX编译包(150Mb)并安装。下载WinEdt(9.5Mb)(收费)或TexMaker(32Mb)(免费)等编辑界面软件并安装。 . b) E/ f2 v5 O# Q; q
方法B(打包):在ctex.org下载ctex套装(203Mb或1.3Gb)(含MikTeX及WinEdt); n% ~" x( C- E ?: B
/ Y g3 E, H7 r4 [7 D8 @: |6 X' j/ B w
哈哈这一部分当然不包含在标题的30分钟里。' _5 K" u6 S _7 h; C0 x
5 a; q: X: p3 Y4 ]8 c. Z, ~然后在WinEdt的工具栏中找到编译按钮(在垃圾桶和字母B中间),在下拉菜单中选择XeLaTeX,并点击编译。 (这里请注意一下我之前一直笔误写的XeTeX,给大家带来困扰深感歉意) ( K+ B q r7 e$ }" O2 c如果顺利的话,我们就可以顺利生成出第一个pdf文件,点击工具栏中的放大镜按钮就可以快速打开生成的pdf文件。 # ^# s' e7 Z! d4 W0 l2 w E* ~2 \( e+ @, g
' a# d N" f6 d8 }2 E3 ]3.标题、作者和注释 : E/ V3 c* x# b建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 - o9 _+ x/ |& r' U, |! K, F' I0 e- }7 N# R8 ]$ I8 W4 y
\documentclass{article} 1 f) a+ L( n3 S' _) c
\author{My Name} , C1 Z+ l) m5 i* d j4 @
\title{The Title} / d" m5 O; Z3 H; ?1 K\begin{document} 6 g% A" O/ }: L, v5 G. n
\maketitle ) z$ N. v! a# n3 Y$ J& l/ t' L5 \
hello, world % This is comment 6 j9 P. {0 I4 f1 F5 S
\end{document} 0 T$ ^, ?9 k ~0 [5 O& f( D) e/ S+ P# X. }
%为本行右边所有内容被注释掉,在生成的pdf中不会显示。 - a$ [3 @% }( Q% y4 U$ T4 R- G( K5 N/ J/ V1 E
块注释也有专门的语句,不过更方便的方式是选中一块区域点鼠标右键,点comment - T; |& r+ M& X+ `6 a 0 v7 q5 I+ G: _0 o0 q# [' d& m! Q' t, C' v
4.章节和段落 % O+ C! L( B$ @4 z建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 ) o5 ~+ I5 m3 |# l8 B( s {
* I1 v5 B" X% m& `( E- }\documentclass{article} t) P' | O+ f \title{Hello World} `6 H3 Z: G- S4 |\begin{document} 2 G& ?/ i3 ~ { \maketitle " G9 H0 g d+ ` \section{Hello China} China is in East Asia. 2 [) r( l6 d2 ^* [$ O( M
\subsection{Hello Beijing} Beijing is the capital of China. 6 A3 _$ @1 v% t \subsubsection{Hello Dongcheng District} + Q( z. g6 M* c# q* T$ J) l
\paragraph{Tian'anmen Square}is in the center of Beijing % X1 I2 G& e) F2 S8 p! j$ u& g, ]
\subparagraph{Chairman Mao} is in the center of Tian'anmen Square & T# E; f5 ^ z6 v+ { A \subsection{Hello Guangzhou} % L% F( }: I- l7 L* P \paragraph{Sun Yat-sen University} is the best university in Guangzhou. + y) t! q# M/ V. w G; j\end{document} / _( p4 p! ~$ q$ L! M
6 B% ?. X9 J: c# H
退格只是我个人偏好,看起来层次清晰美观。实际操作上未必要如此,每一行之前的空格不影响编译生成PDF的排版结果。 $ r# u( e1 m0 M* C i/ e7 @: e9 M; [0 i; Q% C h: R
; p* G. K# D" d" q5.加入目录 $ }/ h) `+ d# r
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 9 g; J. D9 K' X: J9 {9 X; a. Z7 y # o( b6 m& P; C' c8 {% e- r$ j\documentclass{article} $ [$ T8 a/ q5 E4 F\begin{document} " r$ T) v4 q) y& Q* l
\tableofcontents 6 p3 z& N |# h4 |* P
\section{Hello China} China is in East Asia. ( }8 {- K" N, s/ N( k
\subsection{Hello Beijing} Beijing is the capital of China. " p2 U$ K5 T! S$ g \subsubsection{Hello Dongcheng District} # g2 P% {/ d& b" X( b% x* M \paragraph{Hello Tian'anmen Square}is in the center of Beijing 8 S! ~ b# E2 d; r0 ?& a
\subparagraph{Hello Chairman Mao} is in the center of Tian'anmen Square . ]) d* _! M; T! T4 u6 a4 e$ r4 p
\end{document} : t; v) `3 m% M% v+ k0 G - I0 ~$ ~0 o; }" p& J! G6.换行 - s( b) V5 W; F9 B9 U1 j
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 ! p w M& Q0 Q$ x( t\documentclass{article} 8 n$ E$ T9 _0 E\begin{document} 5 j$ r! A8 X6 _7 }5 d) h' X
Beijing is ) t" o5 l# v$ X% N( Q8 a the capital % Z9 G( U, ~( @9 D* e8 l& b of China. 3 l; L1 y% V9 W' N/ M6 [
6 ^; c* U0 j, p: M$ ]7 v/ t New York is " T! g* O1 I6 _
- O: h; M! i4 }2 X. F- K8 Z4 F the capital 4 c' }* u7 j1 W0 c1 j; c2 E4 H- H" J. r: T) J
of America. / M4 M% o1 V2 U0 w* U3 T4 M/ e$ \3 r9 J# M
Amsterdam is \\ the capital \\ 8 M; `$ h( p& h' ]0 i
of Netherlands. $ z |5 P3 Q0 o( _5 q3 e$ o\end{document} ; R( \* I b; L5 K- k- M$ a8 a . ]8 c) x! k+ N: b! ^9 G) s空一行为另起一段,\\为段内强制换行。 , E, Q" @8 z2 z1 Z+ ?2 g6 m: G; X2 Q- Q
, r3 z# g: f* R- G6 w+ Q5 W! m7.数学公式 : ?% f2 S! M B, a3 H, B3 h
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 " H. E& G" Y1 {' y" Q
) e8 E" q$ J9 s2 F" \# V. G8 D; V\documentclass{article} * { t" t2 ~' Z; h8 l, X. ~, \ \usepackage{amsmath} ( S* ]4 @# L5 B6 t \usepackage{amssymb} + `! ~( K% \, g- m
\begin{document} ! w+ c4 d* Z5 o: R& w# i. | The Newton's second law is F=ma. 7 H# ]3 c W h+ s `/ q1 W
3 ^$ B+ q& s1 y+ ?# {3 } The Newton's second law is $F=ma$. 1 f" i( r( k% m$ O! u+ Z ?4 n6 f; s
The Newton's second law is 0 ?! \5 q8 R* M! u $$F=ma$$ 4 \8 f6 j% g. ?$ U- R, Y3 b
7 n5 c8 ?9 o8 o8 M. w/ W The Newton's second law is + i2 y$ ?& K4 ?7 l6 c \[F=ma\] / R* e5 y2 L- `! ?! A / F/ i9 n6 ^% L2 R$ L3 b Greek Letters $\eta$ and $\mu$ 9 c5 ]2 l0 f1 @8 e; @# ?3 p! p' j9 Z- @