LATEX公式语法
see how any formula was written in any question or answer, including this one, right-click on the expression it and choose "Show Math As > TeX Commands". (When you do this, the '$' will not display. Make sure you add these. See the next point.)
For inline formulas, enclose the formula in
$...$. For displayed formulas, use$$...$$.
These render differently. For example, type
$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$
to show ∑ n i=0 i 2 =(n 2 +n)(2n+1)6 ∑i=0ni2=(n2+n)(2n+1)6 (which
is inline mode) or type
$$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$
to show∑ i=0 n i 2 =(n 2 +n)(2n+1)6 ∑i=0ni2=(n2+n)(2n+1)6(which is display mode).
For Greek letters, use
\alpha,\beta, …,\omega: α,β,…ω α,β,…ω.
For uppercase, use\Gamma,\Delta, …,\Omega: Γ,Δ,…,Ω Γ,Δ,…,Ω.For superscripts and subscripts, use
^and_. For example,x_i^2: x 2 i xi2,\log_2: log 2 x log2x.
xGroups. Superscripts, subscripts, and other operations apply only to the next “group”. A “group” is either a single symbol, or any formula surrounded by curly braces
{…}. If you do10^10, you will get
a surprise: 10 1 0 1010.
But10^{10}gives what you probably wanted: 10 10 1010.
Use curly braces to delimit a formula to which a superscript or subscript applies:x^5^6is an error;{x^y}^zis x y z xyz,
andx^{y^z}is x y z xyz.
Observe the difference betweenx_i^2x 2 i xi2 andx_{i^2}x i 2 xi2.Parentheses Ordinary symbols
()[]make parentheses and brackets (2+3)[4+4] (2+3)[4+4].
Use\{and\}for curly braces {} {}.These do not scale with the formula in between, so if you write
(\frac{\sqrt x}{y^3})the parentheses will be too small: (x √ y 3 ) (xy3).
Using\left(…\right)will make the sizes adjust automatically to the formula they enclose:\left(\frac{\sqrt x}{y^3}\right)is (x √ y 3 ) (xy3).\leftand\rightapply to all the following sorts of parentheses:(and)(x) (x),[and][x] [x],\{and\}{x} {x},||x| |x|,\langleand\rangle⟨x⟩ ⟨x⟩,\lceiland\rceil⌈x⌉ ⌈x⌉,
and\lfloorand\rfloor⌊x⌋ ⌊x⌋.
There are also invisible parentheses, denoted by.:\left.\frac12\right\rbraceis 12 } 12}.Sums and integrals
\sumand\int; the subscript is the lower limit and the superscript is the upper limit, so for example\sum_1^n∑ n 1 ∑1n.
Don't forget{…}if the limits are more than a single symbol. For example,\sum_{i=0}^\infty i^2is ∑ ∞ i=0 i 2 ∑i=0∞i2.
Similarly,\prod∏ ∏,\int∫ ∫,\bigcup⋃ ⋃,\bigcap⋂ ⋂,\iint∬ ∬.Fractions There are two ways to make these.
\frac abapplies to the next two groups, and produces ab ab;
for more complicated numerators and denominators use{…}:\frac{a+1}{b+1}is a+1b+1 a+1b+1.
If the numerator and denominator are complicated, you may prefer\over, which splits up the group that it is in:{a+1\over b+1}is a+1b+1 a+1b+1.Fonts
- Use
\mathbbor\Bbbfor "blackboard bold": CHNQRZ CHNQRZ. - Use
\mathbffor boldface: ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz. - Use
\mathttfor "typewriter" font: ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz. - Use
\mathrmfor roman font: ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz. - Use
\mathsffor sans-serif font: ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz. - Use
\mathcalfor "calligraphic" letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ - Use
\mathscrfor script letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ - Use
\mathfrakfor "Fraktur" (old German style) letters: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.
- Use
Radical signs Use
sqrt, which adjusts to the size of its argument:\sqrt{x^3}x 3 − − √ x3;\sqrt[3]{\fracxy √ 3 xy3.
xy}
For complicated expressions, consider using{...}^{1/2}instead.Some special functions such as "lim", "sin", "max", "ln", and so on are normally set in roman font instead of italic font. Use
\lim,\sin, etc. to make these:\sin xsinx sinx,
notsin xsinx sinx.
Use subscripts to attach a notation to\lim:\lim_{x\to 0}lim x→0 limx→0There are a very large number of special symbols and notations, too many to list here; see this shorter listing, or this
exhaustive listing. Some of the most common include:\lt \gt \le \ge \neq<>≤≥≠ <>≤≥≠.
You can use\notto put a slash through almost anything:\not\lt≮ ≮ but
it often looks bad.\times \div \pm \mp×÷±∓ ×÷±∓.\cdotis
a centered dot: x⋅y x⋅y\cup \cap \setminus \subset \subseteq \subsetneq \supset \in \notin \emptyset \varnothing∪∩∖⊂⊆⊊⊃∈∉∅∅ ∪∩∖⊂⊆⊊⊃∈∉∅∅{n+1 \choose 2k}or\binom{n+1}{2k}(n+12k) (n+12k)\to \rightarrow \leftarrow \Rightarrow \Leftarrow \mapsto→→←⇒⇐↦ →→←⇒⇐↦\land \lor \lnot \forall \exists \top \bot \vdash \vDash∧∨¬∀∃⊤⊥⊢⊨ ∧∨¬∀∃⊤⊥⊢⊨\star \ast \oplus \circ \bullet⋆∗⊕∘∙ ⋆∗⊕∘∙\approx \sim \simeq \cong \equiv \prec≈∼≃≅≡≺ ≈∼≃≅≡≺.\infty \aleph_0∞ℵ 0 ∞ℵ0\nabla∇∂ ∇∂
\partial\ImIR ℑℜ
\Re- For modular equivalence, use
\pmodlike this:a\equiv b\pmod na≡b(modn) a≡b(modn). \ldotsis the dots in a 1 ,a 2 ,…,a n a1,a2,…,an\cdotsis
the dots in a 1 +a 2 +⋯+a n a1+a2+⋯+an- Some Greek letters have variant forms:
\epsilon \varepsilonϵε ϵε,\phiϕφ ϕφ,
\varphi
and others. Script lowercase l is\ellℓ ℓ.
Detexify lets you draw a symbol on a web page and then lists the TE X TEX symbols
that seem to resemble it. These are not guaranteed to work in MathJax but are a good place to start. To check that a command is supported, note that MathJax.org maintains a list
of currently supported LA TE X LATEX commands,
and one can also check Dr. Carol JVF Burns's page of TE X TEX Commands
Available in MathJax.Spaces MathJax usually decides for itself how to space formulas, using a complex set of rules. Putting extra literal spaces into formulas will not change the amount of space MathJax puts in:
a␣banda␣␣␣␣bare both ab ab.
To add more space, use\,for a thin space ab ab;\;for
a wider space ab ab.\quadand\qquadare
large spaces: ab ab, ab ab.To set plain text, use
\text{…}: {x∈s∣x is
extra large} {x∈s∣x is
extra large}. You can nest$…$inside of\text{…}.Accents and diacritical marks Use
\hatfor a single symbol x ^ x^,\widehatfor
a larger formula xy ˆ xy^.
If you make it too wide, it will look silly. Similarly, there are\barx ¯ x¯ and\overlinexyz ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ xyz¯,
and\vecx ⃗ x→ and\overrightarrowxy − → xy→ and\overleftrightarrowxy ← → xy.
For dots, as in ddx xx ˙ =x ˙ 2 +xx ¨ ddxxx˙=x˙2+xx¨,
use\dotand\ddot.Special characters used for MathJax interpreting can be escaped using the
\character:\$$ $,\{{ {,\__ _,
etc. If you want\itself, you should use\backslash∖ ∖,
because\\is for a new line.
(Tutorial ends here.)
LATEX公式语法的更多相关文章
- LaTex公式语法教程及手册(附emlogpro公式显示插件katex说明)
目录 第一列 第二列 第三列 效果 求和(使用\sum标签) 文本效果 本插件简介 积分(使用\int标签) 文本大小 LaTex是什么 空格 特殊符号 LaTex公式使用教程及手册 定界符 LaTe ...
- latex基本语法
一直想着学会latex,但是自学起来太麻烦,总是出现各种不理解的错误,也没那么多时间钻研,就学了忘,忘了再学,这里就先摘录下它的基本命令吧.学好了是一件利器!(虽然不常用,但要尽量学会) LaTex基 ...
- LaTeX公式
在学习机器学习中会接触到大量的数学公式,所以在写博客是会非常的麻烦.用公式编辑器一个一个写会非常的麻烦,这时候我们可以使用LaTeX来插入公式. 写这篇博文的目的在于,大家如果要编辑一些简单的公式,就 ...
- markdown 插入latex公式练习
markdown 插入latex公式 $$公式$$表示行间公式,本来Tex中使用\(公式\)表示行内公式,但因为Markdown中\是转义字符,所以在Markdown中输入行内公式使用\\(公式\\) ...
- Mathjax与LaTex公式简介
MathJax与LaTex公式简介 (转载) PS: 原文链接写的非常好!!! 博主写这篇文章,一是为了防止原链接失效,二是在cnblogs上测试MathJax; 本文从math.stackexcha ...
- Latex 公式速查
本文记录了一些常用的数学公式对应的 Latex 字符,用于快速查找需要的字符 所有的在 Latex 使用的字符公式,都需要放在\(和\),$ 和 $,\begin{math} 和\end{math}之 ...
- 为WLW开发Latex公式插件
WLW是写博客的利器,支持离线.格式排版等,而且拥有众多的插件.博客园推荐了代码插入插件,但是没有提供WLW的公式编译插件.目前我的一般做法是:先在Word下使用MathType编辑好公式,然后将公式 ...
- 在word 2013中输入latex公式
注意:版权所有,转载请注明出处 向word输入LaTeX公式,插件有很多,前面在使用的是一个叫做Aurora的插件,结果不是免费的,用了一段时间就要收费是,所以就不用了,从网上找到别人的介绍,可以使用 ...
- Latex 公式在线可视化编辑器
寻觅 最近的一个demo需要用到Latex公式在线编辑器,从搜索引擎一般会得到类似http://latex.codecogs.com/eqneditor/editor.php的结果,这个编辑器的问题在 ...
随机推荐
- git为单独的仓库设置提交的用户名
在我们平时的学习中可能有这么一种需求,在公司进行开发的时候,一般会参与多个项目的开发,而项目提交代码时,一般请求情况下提供的用户都是同一个,而我们为了方便可能会使用全局进行git 用户名的配置.但是空 ...
- Linux过来人帮你理清学习思路
很多同学接触linux不多,对linux平台的开发更是一无所知. 而现在的趋势越来越表明,作为一个优秀的软件开发人员,或计算机it行业从业人员,="" 掌握linux是一种很重要的 ...
- stm32串口学习笔记
stm32作为现在嵌入式物联网单片机行业中经常要用多的技术,相信大家都有所接触,今天这篇就给大家详细的分析下有关于stm32的出口,还不是很清楚的朋友要注意看看了哦,在最后还会为大家分享有些关于stm ...
- cm3 逆向分析
目录 cm3 逆向分析 前言 逆向分析 cm3 逆向分析 前言 这道题没加壳,也没加密算法,主要看代码逻辑. 逆向分析 代码很短,一共这么几句. 看提示知道只让我们输入w.s.a.d这几个字符,并且用 ...
- 基于Lucene的全文检索实践
由于项目的需要,使用到了全文检索技术,这里将前段时间所做的工作进行一个实践总结,方便以后查阅.在实际的工作中,需要灵活的使用lucene里面的查询技术,以达到满足业务要求与搜索性能提升的目的. 一.全 ...
- mongodb入门命令-创建表数据(二)
1.mongodb入门命令 1.1 show databases; 或 show dbs; //查看当前的数据库 > show dbs; admin 0.000GB config 0.000GB ...
- CSS学习笔记:flex布局
目录 一.Flex布局简介 1. Flex布局的主要作用 2. Flex布局应用场景 二.Flex布局的使用 1. Flex布局的两种相关元素 2. 父项属性 2.1 flex- direction ...
- sql常见题目
1 --student学生表(sno,sname,sex,birthday,tel) 2 --Course课程表(cno,cname) 3 --Sc 学生成绩表(sno,cno,score) 4 1. ...
- 菜鸡的Java笔记 生产者与消费者
生产者与消费者 代码要求知道做什么用即可 线程间的通讯问题以及 Object 类的支持 基础模型 现在希望实现一种数据的生产和取出的操作 ...
- vue.js学习与实战笔记(1)
公司需要开发一个小型官网,个人决定放弃angular2,使用vue来进行开发,由于是培训出生,思想一时难以转变,所以只能从零开始,下面奉上学习笔记 vue.js主要参考官网进行学习与开发 由于vue不 ...