# ^7 t0 F& _! ~3 F5 ^1.LaTeX软件的安装和使用 ) O& L( B/ Q" f, a' m方法A(自助):在MikTeX的官网下载免费的MikTeX编译包(150Mb)并安装。下载WinEdt(9.5Mb)(收费)或TexMaker(32Mb)(免费)等编辑界面软件并安装。 ' u L; ~8 n$ T; e+ ]方法B(打包):在ctex.org下载ctex套装(203Mb或1.3Gb)(含MikTeX及WinEdt) ' e- g2 r5 j3 @/ t' n: _# {; M& }! E5 i {& o) a
哈哈这一部分当然不包含在标题的30分钟里。 8 h6 d3 \' u" P9 d* E- Z; v - u9 l: b, b4 {新人不必纠结软件问题,随便什么软件随便什么版本只要下载下来能编译出pdf来就可以,先下载了装上来试试再说。在真正开始跑步之前没有必要纠结该买NIKE跑鞋还是ADI跑鞋,跑起来再说。不要瞻前顾后,just try it. " a) @# U8 c& C4 N/ j s, c+ H: T 1 z( }+ k" I! Z Q; F: R V9 }: i- l z/ ~
6 {: W3 j' u8 l3 @! x4 o
2.第一个文档 E5 u& P5 t0 x0 h9 B
打开WinEdt,建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8。 9 B ?6 j) ^3 X/ F; o! o' S4 l* A- }. Q/ \9 \
\documentclass{article} # q& f8 n5 G$ R" J\begin{document} 2 K2 d' \) U# v3 m, J/ q4 I
hello, world % j. t4 b1 r1 L3 n. d
\end{document} 8 ]* {" f; I6 ^+ t/ Z9 M/ e0 @
/ `+ [# z8 h5 }5 r0 I; q4 s0 v# U3 D
然后在WinEdt的工具栏中找到编译按钮(在垃圾桶和字母B中间),在下拉菜单中选择XeLaTeX,并点击编译。 (这里请注意一下我之前一直笔误写的XeTeX,给大家带来困扰深感歉意) 8 Q% \8 H7 W& t. W/ @; _4 w如果顺利的话,我们就可以顺利生成出第一个pdf文件,点击工具栏中的放大镜按钮就可以快速打开生成的pdf文件。 3 L3 @0 y2 E. Y 5 d' F! Y9 `( L0 G0 C6 U/ I- d % A+ f7 L" b& @+ q7 E5 V3.标题、作者和注释 2 ^& l) m t# O; `" a5 I
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 Y# c) l, I; b/ Y c* d! l" F$ f5 s$ S" V( q! ~! A% @
\documentclass{article} ( \. n6 u H" o0 m5 f) o9 e+ i# W) Z9 D \author{My Name} " O {; s. t& j: t
\title{The Title} # H: }" h. }8 }) _0 q' b, d- O
\begin{document} / C4 n `( K N; d: i; a! v \maketitle / }) n8 g. r D9 _& f
hello, world % This is comment 4 W5 V: d9 t* u0 x\end{document} 0 F+ A- v8 Z8 R# ^ ) f: s% k k. [- I%为本行右边所有内容被注释掉,在生成的pdf中不会显示。9 \2 z: D% i% Z/ O
- n% Y) S; U/ @. P1 y3 [* f* h6 X
块注释也有专门的语句,不过更方便的方式是选中一块区域点鼠标右键,点comment # ~* r g$ Y" f1 \0 e/ e4 p+ W! E
5 @& u* Z, e# x& I, N; C4.章节和段落 3 Z0 @1 `- U7 j: E
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 ( x% R3 _, X2 J% b( @8 K5 ?4 G7 H& }
\documentclass{article} - E. k5 l! o9 n9 y
\title{Hello World} ' z& L; d: `9 D\begin{document} & u" C9 l) F. B- C% P. f
\maketitle 0 Q; A, z4 O4 ]. Y. K: r: M+ F1 |
\section{Hello China} China is in East Asia. $ A: A A; A2 x! e1 `, i
\subsection{Hello Beijing} Beijing is the capital of China. " N1 J/ s0 k& C5 K. }
\subsubsection{Hello Dongcheng District} 6 ]7 V1 A5 d- U* O' o
\paragraph{Tian'anmen Square}is in the center of Beijing 9 q- X, Q4 F) y2 l# l
\subparagraph{Chairman Mao} is in the center of Tian'anmen Square # l6 A0 U/ h: q, v
\subsection{Hello Guangzhou} ' i/ V6 Y+ d2 K: K% Q5 C/ _) N
\paragraph{Sun Yat-sen University} is the best university in Guangzhou. 4 l& Z+ J# Q5 S, O/ R& z6 V
\end{document} + u0 p) P8 L$ k; m " _! N- n- k1 L& H9 I/ V退格只是我个人偏好,看起来层次清晰美观。实际操作上未必要如此,每一行之前的空格不影响编译生成PDF的排版结果。 ' z h. t) v; D; j' c0 U4 y * }2 ^& x2 M8 i! F : _5 w" i4 p% a" V0 E% i5.加入目录 6 K1 q, b; j. c; C4 v2 R1 J
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。 / p8 l1 `. l- }& s9 m
( ~( B9 [9 Z6 {8 [1 |8 }; u; X6 t\documentclass{article} ' j/ U' v( g9 g, ~\begin{document} : M' A( w: N! g; P \tableofcontents ! \8 b# G1 Z7 a6 b$ q7 k4 S% e \section{Hello China} China is in East Asia. ! i* z: ]6 @+ Y8 F! m \subsection{Hello Beijing} Beijing is the capital of China. ' {. M7 S9 T& J+ e8 F( h3 w) }7 R
\subsubsection{Hello Dongcheng District} : o* }% W, x6 m* K4 s Z \paragraph{Hello Tian'anmen Square}is in the center of Beijing . D2 `+ B6 Y3 f& c
\subparagraph{Hello Chairman Mao} is in the center of Tian'anmen Square 6 \4 w& x' D b x" c\end{document} , q) g" P ^6 b
! y" Q! S. |% T0 O2 T/ ]$ T3 N6.换行 $ Y+ q/ j5 k- E- Y$ s建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 ! d7 ^: W5 ~' l9 r9 X( x1 n
\documentclass{article} O+ w6 J1 J0 K\begin{document} . O x" f. `: e: F4 Q. G7 Y0 x
Beijing is 8 |: L/ l' U' |
the capital & n- p" Q. A; h4 {1 j" b. k; q3 } of China. 6 o, `4 X# v% g* G5 [5 N 6 ~1 b9 H0 r, X( b New York is 8 S& U$ K. I! ~( n5 v* F
# G# V, L1 e+ p; [ t ~ the capital 2 N$ w& _' Y! W) I2 t; f( [/ u# K9 ?0 _# v/ N# ~0 I0 A. @; o
of America. - Y, k- a# a# e- H, r$ y: p/ h+ `: O- o! Z$ E/ \- ?7 S" z
Amsterdam is \\ the capital \\ ; z& _; I7 n+ T3 h2 k' ~
of Netherlands. & ?! X* T8 |, X! r! Q( G
\end{document} 8 j5 S( g P8 `, A 6 h* ]* N0 t. l空一行为另起一段,\\为段内强制换行。 7 ]! t6 T4 | d
$ u" `6 Z' o/ `; q, }8 K! E 6 m) b, k$ R G9 }5 i! G2 a7.数学公式 4 y4 D1 o# Z" z0 J
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。 0 s0 Q8 | @5 t* e. y7 ~
& E3 s# K' l: d* S\documentclass{article} ' A' o' T1 g" n; f
\usepackage{amsmath} 3 w& [7 ?1 }+ L2 v5 A7 t8 y- ^
\usepackage{amssymb} $ n7 A/ v+ `9 d" |# C8 y
\begin{document} * \# s# f# i% X& ^
The Newton's second law is F=ma. 4 y( R, B3 P+ e8 }
4 X: c( m+ ~3 ?* R# A The Newton's second law is $F=ma$. 5 E+ t8 e' E Z' \; q4 V7 O5 B7 ]
The Newton's second law is # r3 I$ @, |$ v$ R $$F=ma$$ % G- ^8 j. q* g# h0 C/ \
% W8 f& _+ Q a; e* Y, h- o6 x The Newton's second law is 4 I1 e+ b' A* b& m) O \[F=ma\] 5 {+ z% q, Q1 ~4 Z4 i8 ~ / t, ^8 J' Z+ [% W/ g0 b5 I) [ Greek Letters $\eta$ and $\mu$ 2 I4 I2 L( w. v" l: Q% h. \& R4 D8 C5 |( V0 f) m
Fraction $\frac{a}{b}$ 1 r% f9 G3 s- \2 m9 X. j" v; L+ S; i) {% o* y% U' r/ V
Power $a^b$ % E8 d- A3 R: r# e- S" d
# h* I& t; H. j( ` Subscript $a_b$ , K8 y# t% n _, ^ @8 Z- L
" }2 R+ J8 t5 H' ^7 v
Derivate $\frac{\partial y}{\partial t} $ : L; N) [7 `& ^5 q+ i% K" b5 X9 z! D J, f& |3 z8 p" c" g
Vector $\vec{n}$ " C$ R: K$ q( g7 d2 k2 C3 p' p
( y* W; _, m/ j# o: J Bold $\mathbf{n}$ 0 P3 A. E. ~/ f ~: F/ O( u/ [& J. h8 J3 _- E1 c% Y# k; n
To time differential $\dot{F}$ 8 ?- d2 n0 k: d( g# [/ @) [7 ~, O3 k9 D) o6 D5 F
Matrix (lcr here means left, center or right for each column) + z, e/ S% S4 W5 o; n
\[ 9 X- N& d% D7 d/ v
\left[ ) O9 {# W3 k# E- `$ p+ ]. Y \begin{array}{lcr} ' ^- {- y0 |/ N$ R* J, _4 m; e a1 & b22 & c333 \\ 1 R4 f) v: P' h. {/ Q d444 & e555555 & f6 # [% v% u0 i1 H2 f
\end{array} ! b: g, s7 S: F$ u4 d \right] 2 `: a" h3 X4 Q0 ^9 f \] ! ]! p8 d: K. f# `" p , H7 ~4 g* K0 g1 WEquations(here \& is the symbol for aligning different rows) ' T0 ]: h' j" f& X+ Q
\begin{align} $ i# n1 _1 E8 {( i
a+b&=c\\ " v* \ W; a% S3 r9 o d&=e+f+g , Y5 U9 P) T3 O9 L0 C\end{align} * W4 ^% u `* {9 N1 a7 _% i% q9 T% | + v7 H" H) j6 l\[ * m. U. }* L0 j% l: T+ e
\left\{ ; l7 d, {/ P+ a) ~1 m/ P z8 m
\begin{aligned} & c" m* e5 X* J+ Q$ U- |. D &a+b=c\\ $ l4 ?7 o' }8 P, Q2 q$ d8 a &d=e+f+g / @5 a2 L3 c; V* d/ @0 b
\end{aligned} 4 q/ X6 k I8 R' M3 G \right. , @# h% K" W) s! P% J( H
\] 5 K5 R# u! U( }0 ^
' G0 G3 `! f/ K7 N5 ^
\end{document} ( s- t9 w a8 L" o8 [" g" X: K
5 u0 Y# [8 e `" { T
具体细节可以自行搜索LaTeX的数学符号表或别人给的例子。' `4 E! E1 E$ T0 m4 C
# E8 ~, ?( e, O' `/ L, F7 ^