LaTeX的数学公式有两种:行中公式和独立公式。行中公式放在文中与其它文字混编,独立公式单独成行。 行中公式可以用如下两种方法表示:
\(数学公式\) 或 $数学公式$ 独立公式可以用如下两种方法表示:
\[数学公式\] 或 $$数学公式$$ 例子:\[J\alpha(x) = \sum{m=0}^\infty \frac{(-1)^m}{m! \Gamma (m + \alpha + 1)} {\left({ \frac{x}{2} }\right)}^{2m + \alpha}\]
显示: Jα(x)=∑∞m=0(−1)mm!Γ(m+α+1)(x2)2m+α
^表示上标, _表示下标。如果上下标的内容多于一个字符,要用{}把这些内容括起来当成一个整体。上下标是可以嵌套的,也可以同时使用。 例子:x^{y^z}=(1+{\rm e}^x)^{-2xy^w}
显示: xyz=(1+ex)−2xyw 另外,如果要在左右两边都有上下标,可以用\sideset命令。
例子:\sideset{^12}{^34}\bigotimes
显示: ⨂1<em>2⨂3</em>4
()、[]和|表示自己,{}表示{}。当要显示大号的括号或分隔符时,要用\left和\right命令。
例子:f(x,y,z) = 3y^2z \left( 3+\frac{7x+5}{1+y^2} \right)
显示: f(x,y,z)=3y2z(3+7x+51+y2) 有时候要用\left.或\right.进行匹配而不显示本身。
例子:\left. \frac{{\rm d}u}{{\rm d}x} \right| _{x=0}
显示: dudx∣∣x=0
例子:\frac{1}{3} 或 1 \over 3
显示: 13 或 13
例子:\sqrt{2} 和 \sqrt[n]{3}
显示: 2√ 和 3√n
数学公式中常见的省略号有两种,\ldots表示与文本底线对齐的省略号,\cdots表示与文本中线对齐的省略号。
例子:f(x1,x2,\ldots,xn) = x1^2 + x2^2 + \cdots + xn^2
显示: f(x1,x2,…,xn)=x21+x22+⋯+x2n
例子:\vec{a} \cdot \vec{b}=0
显示: a⃗ ⋅b⃗ =0
例子:\int_0^1 x^2 {\rm d}x
显示: ∫10x2dx
例子:\lim_{n \rightarrow +\infty} \frac{1}{n(n+1)}
显示: limn→+∞1n(n+1)
例子:\sum{i=0}^n \frac{1}{i^2} 和 \prod{i=0}^n \frac{1}{i^2}
显示: ∑<em>i=0n1i2 和 ∏</em>i=0n1i2
例子: \alpha \beta \gamma \Gamma \delta \Delta \epsilon \varepsilon \zeta \eta \theta \Theta \vartheta \iota \kappa \lambda \Lambda \mu \nu \xi \Xi \pi \Pi \varpi \rho \varrho \sigma \Sigma \varsigma \tau \upsilon \Upsilon \phi \Phi \varphi \chi \psi \Psi \omega \Omega
显示:
αβγΓδΔϵε ζηθΘ ϑικλΛ μνξΞ πΠ ϖ ρϱ σΣς τυΥϕΦ φ χψΨ ωΩ± :\pm
× :\times
\div :\div
\mid :\mid
\nmid :\nmid
\cdot :\cdot
\circ :\circ
\ast :\ast
\bigodot :\bigodot
\bigotimes :\bigotimes
\bigoplus :\bigoplus
\leq :\leq
\geq :\geq
\neq :\neq
\approx :\approx
\equiv :\equiv
\sum :\sum
\prod :\prod
\coprod :\coprod
\emptyset :\emptyset
\in :\in
\notin :\notin
\subset :\subset
\supset :\supset
\subseteq :\subseteq
\supseteq :\supseteq
\bigcap :\bigcap
\bigcup :\bigcup
\bigvee :\bigvee
\bigwedge :\bigwedge
\biguplus :\biguplus
\bigsqcup :\bigsqcup
\log :\log
\lg :\lg
\ln :\ln
\bot :\bot
\angle :\angle
30^\circ :30^\circ
\sin :\sin
\cos :\cos
\tan :\tan
\cot :\cot
\sec :\sec
\csc :\csc
\prime :\prime
\int :\int
\iint :\iint
\iiint :\iiint
\iiiint :\iiiint
\oint :\oint
\lim :\lim
\infty :\infty
\nabla :\nabla
\because :\because
\therefore :\therefore
\forall :\forall
\exists :\exists
\not= :\not=
\not> :\not>
\not\subset :\not\subset
\hat{y} :\hat{y}
\check{y} :\check{y}
\breve{y} :\breve{y}
\overline{a+b+c+d} :\overline{a+b+c+d}
\underline{a+b+c+d} :\underline{a+b+c+d}
\overbrace{a+\underbrace{b+c}{1.0}+d}^{2.0} :\overbrace{a+\underbrace{b+c}{1.0}+d}^{2.0}
\uparrow :\uparrow
\downarrow :\downarrow
\Uparrow :\Uparrow
\Downarrow :\Downarrow
\rightarrow :\rightarrow
\leftarrow :\leftarrow
\Rightarrow :\Rightarrow
\Leftarrow :\Leftarrow
\longrightarrow :\longrightarrow
\longleftarrow :\longleftarrow
\Longrightarrow :\Longrightarrow
\Longleftarrow :\Longleftarrow 要输出字符 空格 # $ % & _ { } ,用命令: \空格 # \$ \% \& _ { }