LaTeX数学公式输⼊初级⼊门LaTeX最强⼤的功能就是显⽰美丽的数学公式,下⾯我们来看这些公式是怎么实现的。
1、数学公式的前后要加上 $ 或 \( 和 \),⽐如:$f(x) = 3x + 7$和\(f(x) = 3x + 7\)效果是⼀样的;
如果⽤ \[ 和 \],或者使⽤ $$ 和 $$,则改公式独占⼀⾏;
如果⽤\begin{equation}和\end{equation},则公式除了独占⼀⾏还会⾃动被添加序号,如何公式不想编号则使⽤\begin{equation*}和\end{equation*}.
2、字符
普通字符在数学公式中含义⼀样,除了
# $ % & ~ _ ^ \ { }
若要在数学环境中表⽰这些符号# $ % & _ { },需要分别表⽰为\# \$ \% \& \_ \{ \},即在个字符前加上\。
明泰陵3、上标和下标
⽤ ^ 来表⽰上标,⽤ _ 来表⽰下标,看⼀简单例⼦:
$$\sum_{i=1}^n a_i=0$$
$$f(x)=x^{x^x}$$
底波拉
效果:
这⾥有更多的
4、希腊字母
更多请参见
5、数学函数
6、在公式中插⼊⽂本可以通过\mbox{text}在公式中添加text,⽐如:
\documentclass{article}中国人的思维
\upackage{CJK}
\begin{CJK*}{GBK}{song}
\begin{document}
$$\mbox{对任意的$x>0$}, \mbox{有 }f(x)>0. $$
\end{CJK*}
\end{document}
效果:希望近义词
7、分数及开⽅
\frac{numerator}{denominator} \sqrt{expression_r_r_r}表⽰开平⽅,
\sqrt[n]{expression_r_r_r}表⽰开 n 次⽅.
8、省略号(3个点)
\ldots表⽰跟⽂本底线对齐的省略号;\cdots表⽰跟⽂本中线对齐的省略号,
⽐如:
表⽰为$$f(x_1,x_x,\ldots,x_n) = x_1^2 + x_2^2 + \cdots + x_n^2 $$
9、括号和分隔符
() 和 [ ] 和|对应于⾃⼰;
{} 对应于 \{ \};
|| 对应于 \|。
当要显⽰⼤号的括号或分隔符时,要对应⽤\left和\right,如:
梦见乌龟是什么意思\[f(x,y,z) = 3y^2 z \left( 3 + \frac{7x+5}{1 + y^2} \right).\]对应于
\left.和\right. 只⽤与匹配,本⾝是不显⽰的,⽐如,要输出:
则⽤$$\left. \frac{du}{dx} \right|_{x=0}.$$
10、多⾏的数学公式
可以表⽰为:
\begin{eqnarray*}
\cos 2\theta & = & \cos^2 \theta - \sin^2 \theta \\
茯苓的药用价值
& = & 2 \cos^2 \theta - 1.
\end{eqnarray*}
其中&是对其点,表⽰在此对齐。
*使latex不⾃动显⽰序号,如果想让latex⾃动标上序号,则把*去掉
11、矩阵
表⽰为:
The \emph{characteristic polynomial} $\chi(\lambda)$ of the
$3 \times 3$~matrix
\[ \left( \begin{array}{ccc}
a &
b &
c \\
d &
e &
f \\
g & h & i \end{array} \right)\]
is given by the formula
\[ \chi(\lambda) = \left| \begin{array}{ccc}
\lambda - a & -b & -c \\
-d & \lambda - e & -f \\
-
g & -h & \lambda - i \end{array} \right|.\]
c表⽰向中对齐,l表⽰向左对齐,r表⽰向右对齐。
12、导数、极限、求和、积分(Derivatives, Limits, Sums and Integrals)
The expression_r_r_rs
陈梓萌are obtained in LaTeX by typing
\frac{du}{dt}and \frac{d^2 u}{dx^2}
is obtained in LaTeX by typing
\[ \frac{\partial u}{\partial t}
= h^2 \left( \frac{\partial^2 u}{\partial x^2}
+ \frac{\partial^2 u}{\partial y^2}
+ \frac{\partial^2 u}{\partial z^2}\right)\]
To obtain mathematical expression_r_r_rs such as
in displayed equations we type \lim_{x \to +\infty}, \inf_{x > s} and \sup_K respectively. Thus to obtain
(in LaTeX) we type
\[ \lim_{x \to 0} \frac{3x^2 +7x^3}{x^2 +5x^4} = 3.\]
To obtain a summation sign such as
we type \sum_{i=1}^{2n}. Thus
is obtained by typing
\[ \sum_{k=1}^n k^2 = \frac{1}{2} n (n+1).\]
We now discuss how to obtain integrals in mathematical documents. A typical integral is the following:
This is typet using
\[ \int_a^b f(x)\,dx.\]
The integral sign is typet using the control quence \int, and the limits of integration (in this ca a and b are treated as a subscript and a superscript on the integral sign.
Most integrals occurring in mathematical documents begin with an integral sign and contain one or more instances of d followed by another (Latin or Greek) letter, as in dx, dy and dt. To obtain the correct appearance one should put extra space before the d, using \,. Thus
and
are obtained by typing
\[ \int_0^{+\infty} x^n e^{-x} \,dx = n!.\]
\[ \int \cos \theta \,d\theta = \sin \theta.\]
\[ \int_{x^2 + y^2 \leq R^2} f(x,y)\,dx\,dy
= \int_{\theta=0}^{2\pi} \int_{r=0}^R
f(r\cos\theta,r\sin\theta) r\,dr\,d\theta.\]
and
\[ \int_0^R \frac{2x\,dx}{1+x^2} = \log(1+R^2).\]
respectively.
In some multiple integrals (i.e., integrals containing more than one integral sign) one finds that LaTeX puts too much space between the integral signs. The way to improve the appearance of of the integral is to u the control quence \! to remove a thin strip of unwanted space. Thus, for example, the multiple integral
is obtained by typing
\[ \int_0^1 \! \int_0^1 x^2 y^2\,dx\,dy.\]
Had we typed
随机数公式excel\[ \int_0^1 \int_0^1 x^2 y^2\,dx\,dy.\]
we would have obtained
A particularly noteworthy example comes when we are typetting a multiple integral such as
Here we u \! three times to obtain suitable spacing between the integral signs. We typet this integral using
\[ \int \!\!\! \int_D f(x,y)\,dx\,dy.\]
Had we typed
\[ \int \int_D f(x,y)\,dx\,dy.\]
we would have obtained
The following (reasonably complicated) passage exhibits a number of the features which we have been discussing:
One would typet this in LaTeX by typing In non-relativistic wave mechanics, the wave function $\psi(\mathbf{r},t)$ of a particle satisfies the
\emph{Schr\"{o}dinger Wave Equation}
\[ i\hbar\frac{\partial \psi}{\partial t}
= \frac{-\hbar^2}{2m} \left(
\frac{\partial^2}{\partial x^2}
+ \frac{\partial^2}{\partial y^2}
+ \frac{\partial^2}{\partial z^2}
\right) \psi + V \psi.\]
It is customary to normalize the wave equation by
demanding that
\[ \int \!\!\! \int \!\!\! \int_{\textbf{R}^3}
\left| \psi(\mathbf{r},0) \right|^2\,dx\,dy\,dz = 1.\]
A simple calculation using the Schr\"{o}dinger wave
equation shows that
\[ \frac{d}{dt} \int \!\!\! \int \!\!\! \int_{\textbf{R}^3}
\left| \psi(\mathbf{r},t) \right|^2\,dx\,dy\,dz = 0,\]
and hence
\[ \int \!\!\! \int \!\!\! \int_{\textbf{R}^3}
\left| \psi(\mathbf{r},t) \right|^2\,dx\,dy\,dz = 1\]
for all times~$t$. If we normalize the wave function in this
way then, for any (measurable) subt~$V$ of $\textbf{R}^3$
and time~$t$,
\[ \int \!\!\! \int \!\!\! \int_V
\left| \psi(\mathbf{r},t) \right|^2\,dx\,dy\,dz\]
reprents the probability that the particle is to be found
within the region~$V$ at time~$t$.