利用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}$$

效果:

i=1nai=0

f(x)=xxx

LaTeX数学公式输入初级入门

这里有更多的LaTeX上标下标的设置

4、希腊字母
更多请参见这里

5、数学函数
例如sin x, 输入应该为\sin x

6、在公式中插入文本可以通过 \mbox{text}在公式中添加text,比如:

$$\mbox{对任意的$x>0$}, \mbox{有 }f(x)>0. $$
效果:

x>0, f(x)>0.

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 $$
表示为

f(x1,xx,,xn)=x21+x22++x2n

9、括号和分隔符
() 和 [ ] 和 | 对应于自己;
{} 对应于 \{ \}
|| 对应于|
当要显示大号的括号或分隔符时,要对应用 \left 和 \right,如:

f(x,y,z)=3y2z(3+7x+51+y2)

对应于
$$f(x,y,z) = 3y^2 z\left( 3 + \frac{7x+5}{1 + y^2} \right)$$

\left. 和 \right. 只用与匹配,本身是不显示的,比如,要输出:

dudxx=0.

则用
$$\left. \frac{du}{dx} \right|_{x=0}.$$

10、多行的数学公式

LaTeX技巧10:LaTeX数学公式输入初级入门

cos2θ==cos2θsin2θ2cos2θ1.

可以表示为:

\begin{eqnarray*} \cos 2\theta & = & \cos^2 \theta - \sin^2 \theta \\ & = & 2 \cos^2 \theta - 1. \end{eqnarray*}

其中&是对其点,表示在此对齐。
*使latex不自动显示序号,如果想让latex自动标上序号,则把*去掉

11、矩阵

表示为:

$$ \left( \begin{array}{ccc}
a & b & c \\
d & e & f \\
g & h & i \end{array} \right)$$

adgbehcfi

$$\chi(\lambda) = \left| \begin{array}{ccc}
\lambda - a & -b & -c \\
-d & \lambda - e & -f \\
-g & -h & \lambda - i \end{array} \right|$$

χ(λ)=λadgbλehcfλi

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}

respectively. The mathematical symbol is produced using\partial. Thus the Heat Equation

ut=h2(2ux2+2uy2+2uz2)

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

limx+,infx>s

supK

in displayed equations we type \lim_{x \to +\infty}, \inf_{x > s} and \sup_K respectively. Thus to obtain

limx03x2+7x3x2+5x4=3.

(in LaTeX) we type

[ \lim_{x \to 0} \frac{3x^2 +7x^3}{x^2 +5x^4} = 3.]

To compulsively display “u \to \infty” under the limit,

1limu,1limu
or
1limu

we type in LaTeX

\frac{1}{\lim_{u \rightarrow \infty}}, \frac{1}{\lim\limits_{u \rightarrow \infty}} or
\frac{1}{ \displaystyle \lim_{u \rightarrow \infty}} respectively.

To obtain a summation sign such as

i=12n

we type \sum_{i=1}^{2n}. Thus
k=1nk2=12n(n+1).

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:

baf(x)dx.

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

+0xnexdx=n!.

cosθdθ=sinθ.

x2+y2R2f(x,y)dxdy=2πθ=0Rr=0f(rcosθ,rsinθ)rdrdθ.

and
R02xdx1+x2=log(1+R2).

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

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值