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

效果:

这里有更多的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}

效果:

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}

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

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_Krespectively. 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 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

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 use the control sequence \! 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

\[ \int_0^1 \int_0^1 x^2 y^2\,dx\,dy.\]

we would have obtained

A particularly noteworthy example comes when we are typesetting a multiple integral such as

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

The following (reasonably complicated) passage exhibits a number of the features which we have been discussing:

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$.

LaTeX技巧10:LaTeX数学公式输入初级入门的更多相关文章

  1. LaTeX技巧:LaTeX括号总结

    功能 语法 显示 不好看     ( \frac{1}{2} ) 好一点 \left( \frac{1}{2} \right) 您可以使用\left和\right来显示不同的括号: 功能 语法 显示 ...

  2. LaTeX技巧203:如何实现等号对齐_LaTeX_Fun_新浪博客

    LaTeX技巧203:如何实现等号对齐_LaTeX_Fun_新浪博客 我们在进行公式的输入排版的时候,通常希望公式比较齐整,所以需要一些等号对齐,或者左对齐,关于公式的左对齐前文已经介绍了方法.htt ...

  3. LaTeX技巧472:定义一个LaTeX参考文献不带编号且有缩进的方法

    LaTeX_Fun的博客 LaTeX技巧381:参考文献项第二行缩进如何定义? \makeatletter\renewenvironment{thebibliography}[1]{\section* ...

  4. 【LaTeX排版】LaTeX使用--入门基础<一>

    经过两个多星期,毕业论文终于写完了.由于自己对Word软件并不是很熟悉,再加上在数模时见识过LaTex的强大之处,于是就决定用LaTex进行论文的排版.使用LaTex可以避免像Word那样换台机器而出 ...

  5. LaTeX技巧561:LaTeX如何让每一章带有目录?

    转自: http://blog.sina.com.cn/s/blog_5e16f1770102ds8b.html LaTeX技巧561:LaTeX如何让每一章带有目录? [问题描述] 当前章节列出该章 ...

  6. LaTeX技巧96:LaTeX 图片控制命令,位置控制

    LaTeX技巧96:LaTeX 图片控制命令,位置控制 2012-04-05 17:25:44 zd0303 阅读数 28512更多 分类专栏: Latex   LaTeX 控制图片的位置,就是加感叹 ...

  7. Spring Cloud实战之初级入门(四)— 利用Hystrix实现服务熔断与服务监控

    目录 1.环境介绍 2.服务监控 2.1 加入依赖 2.2 修改配置文件 2.3 修改启动文件 2.4 监控服务 2.5 小结 3. 利用hystrix实现消费服务熔断 3.1 加入服务熔断 3.2 ...

  8. mui初级入门教程(六)— 模板页面实现原理及多端适配指南

    文章来源:小青年原创发布时间:2016-07-26关键词:mui,webview,template,os,多端适配转载需标注本文原始地址: http://zhaomenghuan.github.io. ...

  9. 响应式Web初级入门

    本文来自我的前端博客,原文地址:http://www.hacke2.cn/about-responsive/ 跨终端时代的到来 当你乘坐各种交通工具(公交.地铁.轻轨.火车)时你会发现,人们都个个低下 ...

随机推荐

  1. [转]QT中QString与string的转化,解决中文乱码问题

    QString str2qstr(const string str) { return QString::fromLocal8Bit(str.data()); } string qstr2str(co ...

  2. 远程Service的显示 / 隐式启动

    在进程间通信时,常会设计开启远程 Service 的情况.开启远程 Service 的方式有两种,一种时显示开启,一种是隐式开启.下面分别来看: 一.隐式开启 服务端:Service 所在 Andro ...

  3. HRBUST - 2358 Magic network

    HRBUST - 2358 思路:dfs序 + 树状数组 代码: #pragma GCC optimize(2) #pragma GCC optimize(3) #pragma GCC optimiz ...

  4. Integer与int区别

    Integer与int的区别:估计大多数人只会说道两点,一开始我也不太清楚,Ingeter是int的包装类,int的初值为0,Ingeter的初值为null.但是如果面试官再问一下Integer i ...

  5. https 学习笔记

    参考 : http://www.cnblogs.com/JimmyZhang/archive/2008/10/02/Cryptograph.html https://blog.csdn.net/Jog ...

  6. POSTMAN模拟http请求

    附加小知识: chrome浏览器fitler中的XHR作用是什么? 记录ajax中的请求. AJAX :异步 JavaScript 和 XML 1.是一种用于创建快速动态网页的技术. 2. 通过在后台 ...

  7. (转)C# 的三种序列化方法

    序列化是将一个对象转换成字节流以达到将其长期保存在内存.数据库或文件中的处理过程.它的主要目的是保存对象的状态以便以后需要的时候使用.与其相反的过程叫做反序列化. 序列化一个对象 为了序列化一个对象, ...

  8. HeadFirst Ruby 第十四章总结 Web apps: Serving HTML

    前言 这一章节主要讲了如何利用 Ruby 中的 Sinatra 这个 gem 来创建一个 Web app 的具体流程,其中的要点包括了: Sinatra, a third party library ...

  9. validateRequest 相关的作用

    在 Web 应用程序中,要阻止依赖于恶意输入字符串的黑客攻击,约束和验证用户输入是必不可少的.跨站点脚本攻击就是此类攻击的一个示例.其他类型的恶意数据或不需 要的数据可以通过各种形式的输入在请求中传入 ...

  10. English trip V1 - B 3. I'd Like a Room,Please 请给我一间房? Teacher:Julia Key:

    In this lesson you will learn to say what you need. 课上内容(Lesson) twin size bed  单人床 elevator     n. ...