LaTeX数学公式
2013-01-22 10:23
211 查看
zz from: http://blog.sina.com.cn/s/blog_5e16f1770100fs38.html
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}$$
效果:
![](http://img.ph.126.net/ZtV0wHfMf1s6vTx5d0QBQA==/1300977342373969308.jpg)
这里有更多的LaTeX上标下标的设置
4、希腊字母
更多请参见这里
5、数学函数
6、在公式中插入文本可以通过 \mbox{text} 在公式中添加text,比如:
\documentclass{article}
\usepackage{CJK}
\begin{CJK*}{GBK}{song}
\begin{document}
$$\mbox{对任意的$x>0$}, \mbox{有 }f(x)>0. $$
\end{CJK*}
\end{document}
效果:
![](http://img.ph.126.net/6o4l8faRI3xr-KZjaBo9Rw==/1300977342373969309.jpg)
7、分数及开方
\frac{numerator}{denominator} \sqrt{expression_r_r_r}表示开平方,
\sqrt
{expression_r_r_r} 表示开 n 次方.
8、省略号(3个点)
\ldots 表示跟文本底线对齐的省略号;\cdots 表示跟文本中线对齐的省略号,
比如:
![](http://img.ph.126.net/u_JMdIqr02Ok-AfZZJAyRw==/1300977342373969310.jpg)
表示为 $$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. 只用与匹配,本身是不显示的,比如,要输出:
![](http://img.ph.126.net/KY_GEjzjMTqtOS00ZzjcUQ==/1300977342373969311.jpg)
则用 $$\left. \frac{du}{dx} \right|_{x=0}.$$
10、多行的数学公式
![](http://img.ph.126.net/79WikIReBBj-vaE9sujO2A==/1300977342373969312.jpg)
可以表示为:
\begin{eqnarray*}
\cos 2\theta & = & \cos^2 \theta - \sin^2 \theta \\
& = & 2 \cos^2 \theta - 1.
\end{eqnarray*}
其中&是对其点,表示在此对齐。
*使latex不自动显示序号,如果想让latex自动标上序号,则把*去掉
11、矩阵
![](http://img.ph.126.net/F1mar-GbEoffWxn_0yK0wQ==/1300977342373969313.jpg)
表示为:
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
![](http://img.ph.126.net/7PzLYLG_WOuXcr39gGVdrQ==/1300977342373969314.jpg)
are obtained in LaTeX by typing
\frac{du}{dt} and \frac{d^2 u}{dx^2}
respectively. The mathematical symbol
![](http://img.ph.126.net/l0ymG8RiACA3GRTBCa_rWA==/1300977342373969315.jpg)
is
produced using \partial. Thus the Heat Equation
![](http://img.ph.126.net/WtVeiRRbsRbgfH-A7AjpnA==/1300977342373969316.jpg)
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
![](http://img.ph.126.net/hoTD4IC3wlbtcej03nfBGg==/1300977342373969317.jpg)
in displayed equations we type \lim_{x \to +\infty}, \inf_{x > s} and \sup_K respectively. Thus to obtain
![](http://img.ph.126.net/TR6BSSPRnoRoHdsLdQHFIg==/1300977342373969318.jpg)
(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
![](http://img.ph.126.net/9lvsnrHbzHk2i6bCb1Ml-Q==/1300977342373969319.jpg)
we type \sum_{i=1}^{2n}. Thus
![](http://img.ph.126.net/GUk7udRjUe4v9PeeBap6yA==/1300977342373969320.jpg)
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:
![](http://img.ph.126.net/gZhTS5NaxTrV2EVbOHbrgw==/1300977342373969321.jpg)
This is typeset using
\[ \int_a^b f(x)\,dx.\]
The integral sign is typeset using the control sequence \int, and the limits of integration (in this case 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
![](http://img.ph.126.net/9ec-yMBdZthCmS8zlSiYYA==/1300977342373969322.jpg)
![](http://img.ph.126.net/5AFOQG8UmXunJ7UFs1o2VQ==/1300977342373969323.jpg)
![](http://img.ph.126.net/z8XLCt40oreLIqi9PLxVYw==/1300977342373969324.jpg)
and
![](http://img.ph.126.net/w4mGN0gVZgTHwuJhOIjKTw==/1300977342373969325.jpg)
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 use the control sequence \! to remove
a thin strip of unwanted space. Thus, for example, the multiple integral
![](http://img.ph.126.net/kTgnL15sPGxV1kFPoYajQg==/1300977342373969326.jpg)
is obtained by typing
\[ \int_0^1 \! \int_0^1 x^2 y^2\,dx\,dy.\]
Had we typed
\[ \int_0^1 \int_0^1 x^2 y^2\,dx\,dy.\]
we would have obtained
![](http://img.ph.126.net/cRT1-l1uflNjj_F_26Dplw==/1300977342373969327.jpg)
A particularly noteworthy example comes when we are typesetting a multiple integral such as
![](http://img.ph.126.net/0bk6PGzePuUpgXyRoQFDPQ==/1300977342373969328.jpg)
Here we use \! three times to obtain suitable spacing between the integral signs. We typeset 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
![](http://img.ph.126.net/vuqBHHy6hFtzgSaN3rK7dg==/1300977342373969329.jpg)
The following (reasonably complicated) passage exhibits a number of the features which we have been discussing:
![](http://img.ph.126.net/G_kJe9QViRqZBvZwOCnOHA==/1300977342373969330.jpg)
One would typeset 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) subset~$V$ of $\textbf{R}^3$
and time~$t$,
\[ \int \!\!\! \int \!\!\! \int_V
\left| \psi(\mathbf{r},t) \right|^2\,dx\,dy\,dz\]
represents the probability that the particle is to be found
within the region~$V$ at time~$t$.
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}$$
效果:
![](http://img.ph.126.net/ZtV0wHfMf1s6vTx5d0QBQA==/1300977342373969308.jpg)
这里有更多的LaTeX上标下标的设置
4、希腊字母
更多请参见这里
5、数学函数
6、在公式中插入文本可以通过 \mbox{text} 在公式中添加text,比如:
\documentclass{article}
\usepackage{CJK}
\begin{CJK*}{GBK}{song}
\begin{document}
$$\mbox{对任意的$x>0$}, \mbox{有 }f(x)>0. $$
\end{CJK*}
\end{document}
效果:
![](http://img.ph.126.net/6o4l8faRI3xr-KZjaBo9Rw==/1300977342373969309.jpg)
7、分数及开方
\frac{numerator}{denominator} \sqrt{expression_r_r_r}表示开平方,
\sqrt
{expression_r_r_r} 表示开 n 次方.
8、省略号(3个点)
\ldots 表示跟文本底线对齐的省略号;\cdots 表示跟文本中线对齐的省略号,
比如:
![](http://img.ph.126.net/u_JMdIqr02Ok-AfZZJAyRw==/1300977342373969310.jpg)
表示为 $$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. 只用与匹配,本身是不显示的,比如,要输出:
![](http://img.ph.126.net/KY_GEjzjMTqtOS00ZzjcUQ==/1300977342373969311.jpg)
则用 $$\left. \frac{du}{dx} \right|_{x=0}.$$
10、多行的数学公式
![](http://img.ph.126.net/79WikIReBBj-vaE9sujO2A==/1300977342373969312.jpg)
可以表示为:
\begin{eqnarray*}
\cos 2\theta & = & \cos^2 \theta - \sin^2 \theta \\
& = & 2 \cos^2 \theta - 1.
\end{eqnarray*}
其中&是对其点,表示在此对齐。
*使latex不自动显示序号,如果想让latex自动标上序号,则把*去掉
11、矩阵
![](http://img.ph.126.net/F1mar-GbEoffWxn_0yK0wQ==/1300977342373969313.jpg)
表示为:
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
![](http://img.ph.126.net/7PzLYLG_WOuXcr39gGVdrQ==/1300977342373969314.jpg)
are obtained in LaTeX by typing
\frac{du}{dt} and \frac{d^2 u}{dx^2}
respectively. The mathematical symbol
![](http://img.ph.126.net/l0ymG8RiACA3GRTBCa_rWA==/1300977342373969315.jpg)
is
produced using \partial. Thus the Heat Equation
![](http://img.ph.126.net/WtVeiRRbsRbgfH-A7AjpnA==/1300977342373969316.jpg)
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
![](http://img.ph.126.net/hoTD4IC3wlbtcej03nfBGg==/1300977342373969317.jpg)
in displayed equations we type \lim_{x \to +\infty}, \inf_{x > s} and \sup_K respectively. Thus to obtain
![](http://img.ph.126.net/TR6BSSPRnoRoHdsLdQHFIg==/1300977342373969318.jpg)
(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
![](http://img.ph.126.net/9lvsnrHbzHk2i6bCb1Ml-Q==/1300977342373969319.jpg)
we type \sum_{i=1}^{2n}. Thus
![](http://img.ph.126.net/GUk7udRjUe4v9PeeBap6yA==/1300977342373969320.jpg)
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:
![](http://img.ph.126.net/gZhTS5NaxTrV2EVbOHbrgw==/1300977342373969321.jpg)
This is typeset using
\[ \int_a^b f(x)\,dx.\]
The integral sign is typeset using the control sequence \int, and the limits of integration (in this case 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
![](http://img.ph.126.net/9ec-yMBdZthCmS8zlSiYYA==/1300977342373969322.jpg)
![](http://img.ph.126.net/5AFOQG8UmXunJ7UFs1o2VQ==/1300977342373969323.jpg)
![](http://img.ph.126.net/z8XLCt40oreLIqi9PLxVYw==/1300977342373969324.jpg)
and
![](http://img.ph.126.net/w4mGN0gVZgTHwuJhOIjKTw==/1300977342373969325.jpg)
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 use the control sequence \! to remove
a thin strip of unwanted space. Thus, for example, the multiple integral
![](http://img.ph.126.net/kTgnL15sPGxV1kFPoYajQg==/1300977342373969326.jpg)
is obtained by typing
\[ \int_0^1 \! \int_0^1 x^2 y^2\,dx\,dy.\]
Had we typed
\[ \int_0^1 \int_0^1 x^2 y^2\,dx\,dy.\]
we would have obtained
![](http://img.ph.126.net/cRT1-l1uflNjj_F_26Dplw==/1300977342373969327.jpg)
A particularly noteworthy example comes when we are typesetting a multiple integral such as
![](http://img.ph.126.net/0bk6PGzePuUpgXyRoQFDPQ==/1300977342373969328.jpg)
Here we use \! three times to obtain suitable spacing between the integral signs. We typeset 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
![](http://img.ph.126.net/vuqBHHy6hFtzgSaN3rK7dg==/1300977342373969329.jpg)
The following (reasonably complicated) passage exhibits a number of the features which we have been discussing:
![](http://img.ph.126.net/G_kJe9QViRqZBvZwOCnOHA==/1300977342373969330.jpg)
One would typeset 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) subset~$V$ of $\textbf{R}^3$
and time~$t$,
\[ \int \!\!\! \int \!\!\! \int_V
\left| \psi(\mathbf{r},t) \right|^2\,dx\,dy\,dz\]
represents the probability that the particle is to be found
within the region~$V$ at time~$t$.
相关文章推荐
- 在hexo博客中使用Mathjax写LaTex数学公式
- 【转载】CSDN-markdown语法之如何使用LaTeX语法编写数学公式
- 用LaTeXMathML来发表数学公式
- LaTeX中数学符号和公式字体加粗的方法
- LaTeX数学公式
- LaTeX中的数学公式
- markdown之LaTex数学公式编辑
- CSDN-markdown语法之如何使用LaTeX语法编写数学公式
- 在 markdown 中编写 LaTex 数学公式
- 如何在 MathJax 中使用 Latex 编辑数学公式
- 书写数学公式插件 LaTeXiT
- LaTex与数学公式
- LaTeX中插入数学公式
- freebsd下支持LATEX书写数学公式的网站搭建
- MathJax basic tutorial and quick reference(LaTex数学公式语法)
- LaTeX技巧10:LaTeX数学公式输入初级入门
- 在博客里轻松使用LaTeX数学公式
- LaTeX实战经验:数学公式环境注意事项
- latex 数学符号,段落编号、公式等,随记
- CSDN-markdown语法之如何使用LaTeX语法编写数学公式