1. 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.)

  2. 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).

  3. For Greek letters, use \alpha\beta, …, \omega: α,β,…ω α,β,…ω.
    For uppercase, use \Gamma\Delta, …, \Omega: Γ,Δ,…,Ω Γ,Δ,…,Ω.

  4. For superscripts and subscripts, use ^ and _. For example, x_i^2: x 2 i  xi2, \log_2
    x
    : log 2 x log2⁡x.

  5. Groups. 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 do 10^10, you will get
    a surprise: 10 1 0 1010.
    But 10^{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^6 is an error; {x^y}^z is x y  z  xyz,
    and x^{y^z} is x y z   xyz.
    Observe the difference between x_i^2 x 2 i  xi2 and x_{i^2} x i 2   xi2.

  6. 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).

    \left and\right apply to all the following sorts of parentheses: ( and ) (x) (x), [ and ] [x] [x], \{ and \} {x} {x}, | |x| |x|, \langle and \rangle ⟨x⟩ ⟨x⟩, \lceil and\rceil ⌈x⌉ ⌈x⌉,
    and \lfloor and \rfloor ⌊x⌋ ⌊x⌋.
    There are also invisible parentheses, denoted by .\left.\frac12\right\rbrace is 12 } 12}.

  7. Sums and integrals \sum and \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^2 is ∑ ∞ i=0 i 2  ∑i=0∞i2.
    Similarly, \prod ∏ ∏, \int ∫ ∫, \bigcup ⋃ ⋃, \bigcap ⋂ ⋂, \iint ∬ ∬.

  8. Fractions There are two ways to make these. \frac ab applies 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.

  9. Fonts

    • Use \mathbb or \Bbb for "blackboard bold": CHNQRZ CHNQRZ.
    • Use \mathbf for boldface: ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz.
    • Use \mathtt for "typewriter" font: ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz.
    • Use \mathrm for roman font: ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz.
    • Use \mathsf for sans-serif font: ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz.
    • Use \mathcal for "calligraphic" letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ
    • Use \mathscr for script letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ
    • Use \mathfrak for "Fraktur" (old German style) letters: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.
  10. Radical signs Use sqrt, which adjusts to the size of its argument: \sqrt{x^3} x 3  − −  √  x3; \sqrt[3]{\frac
    xy}
     xy   √ 3  xy3.
    For complicated expressions, consider using{...}^{1/2} instead.

  11. 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 x sinx sin⁡x,
    not sin x sinx sinx.
    Use subscripts to attach a notation to \lim\lim_{x\to 0}

    lim x→0  limx→0
  12. There 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 \not to put a slash through almost anything: \not\lt ≮ ≮ but
      it often looks bad.
    • \times \div \pm \mp ×÷±∓ ×÷±∓. \cdot is
      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
       ∇∂ ∇∂ \Im
      \Re
       IR ℑℜ
    • For modular equivalence, use \pmod like this: a\equiv b\pmod n a≡b(modn) a≡b(modn).
    • \ldots is the dots in a 1 ,a 2 ,…,a n  a1,a2,…,an \cdots is
      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
    .

  13. 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␣b and a␣␣␣␣b are both ab ab.
    To add more space, use \, for a thin space ab ab; \; for
    a wider space ab ab. \quad and \qquad are
    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{…}.

  14. Accents and diacritical marks Use \hat for a single symbol x ^  x^, \widehat for
    a larger formula xy ˆ  xy^.
    If you make it too wide, it will look silly. Similarly, there are\bar x ¯  x¯ and \overline xyz ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯   xyz¯,
    and \vec x ⃗  x→ and \overrightarrow xy − →   xy→ and \overleftrightarrow xy ← →   xy.
    For dots, as in ddx xx ˙ =x ˙  2 +xx ¨  ddxxx˙=x˙2+xx¨,
    use \dot and \ddot.

  15. 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公式语法的更多相关文章

  1. LaTex公式语法教程及手册(附emlogpro公式显示插件katex说明)

    目录 第一列 第二列 第三列 效果 求和(使用\sum标签) 文本效果 本插件简介 积分(使用\int标签) 文本大小 LaTex是什么 空格 特殊符号 LaTex公式使用教程及手册 定界符 LaTe ...

  2. latex基本语法

    一直想着学会latex,但是自学起来太麻烦,总是出现各种不理解的错误,也没那么多时间钻研,就学了忘,忘了再学,这里就先摘录下它的基本命令吧.学好了是一件利器!(虽然不常用,但要尽量学会) LaTex基 ...

  3. LaTeX公式

    在学习机器学习中会接触到大量的数学公式,所以在写博客是会非常的麻烦.用公式编辑器一个一个写会非常的麻烦,这时候我们可以使用LaTeX来插入公式. 写这篇博文的目的在于,大家如果要编辑一些简单的公式,就 ...

  4. markdown 插入latex公式练习

    markdown 插入latex公式 $$公式$$表示行间公式,本来Tex中使用\(公式\)表示行内公式,但因为Markdown中\是转义字符,所以在Markdown中输入行内公式使用\\(公式\\) ...

  5. Mathjax与LaTex公式简介

    MathJax与LaTex公式简介 (转载) PS: 原文链接写的非常好!!! 博主写这篇文章,一是为了防止原链接失效,二是在cnblogs上测试MathJax; 本文从math.stackexcha ...

  6. Latex 公式速查

    本文记录了一些常用的数学公式对应的 Latex 字符,用于快速查找需要的字符 所有的在 Latex 使用的字符公式,都需要放在\(和\),$ 和 $,\begin{math} 和\end{math}之 ...

  7. 为WLW开发Latex公式插件

    WLW是写博客的利器,支持离线.格式排版等,而且拥有众多的插件.博客园推荐了代码插入插件,但是没有提供WLW的公式编译插件.目前我的一般做法是:先在Word下使用MathType编辑好公式,然后将公式 ...

  8. 在word 2013中输入latex公式

    注意:版权所有,转载请注明出处 向word输入LaTeX公式,插件有很多,前面在使用的是一个叫做Aurora的插件,结果不是免费的,用了一段时间就要收费是,所以就不用了,从网上找到别人的介绍,可以使用 ...

  9. Latex 公式在线可视化编辑器

    寻觅 最近的一个demo需要用到Latex公式在线编辑器,从搜索引擎一般会得到类似http://latex.codecogs.com/eqneditor/editor.php的结果,这个编辑器的问题在 ...

随机推荐

  1. 手写vue-router & 什么是Vue插件

    博文分享 这篇文章你可以学习到: 实现一个自己的vue-router 了解什么是Vue的插件 学习b站大佬后做的笔记整理和源码实现 1.1.3一步一步带你弄懂vue-router核心原理及实现哔哩哔哩 ...

  2. HTML基础-3

    图像标签(<img>)和源属性(Src) 在 HTML 中,图像由 <img> 标签定义. <img> 是空标签,意思是说,它只包含属性,并且没有闭合标签. 要在页 ...

  3. 恶意代码分析实战五:OllyDebug动态结合

    目录 恶意代码分析实战五:OllyDebug动态结合 OllyDebug界面介绍 OllyDebug载入程序方法 OllyDebug地址跳转 OllyDebug下断点 OllyDebug单步执行 Ol ...

  4. Jmeter接口数据流测试及持续集成部署:(一)Jmeter环境搭建:安装JDK、安装Jmeter、安装Fiddler、安装ant

    Jmeter环境搭建 1.安装JDK 官方下载地址:https://www.oracle.com/java/technologies/downloads/ 安装方法:双击jdk安装包,一直下一步安装即 ...

  5. jenkins内置变量的使用

    参考链接:  https://www.cnblogs.com/puresoul/p/4828913.html 一.查看Jenkins有哪些环境变量 1.新建任意一个job 2.增加构建步骤:Execu ...

  6. cmd命令配置MySQL

    当安装完MySql后,每次windows启动的时候都会将MySql服务启动起来. 如果是winxp则不需要使用管理员权限既可以很简单的打开和关闭,具体在cmd中敲入命令: 1.启动MySql服务: n ...

  7. 【Microsoft Azure 的1024种玩法】四. 利用Azure Virtual machines 打造个人专属云盘,速度吊打某云盘

    [简介] 1.Azure Virtual machines是Azure 提供的多种可缩放按需分配计算资源之一,Nextcloud是一款开源免费的私有云存储网盘项目,可以让你快速便捷地搭建一套属于自己或 ...

  8. [luogu7418]Counting Graphs P

    参考[luogu7417],同样求出最短路,得到二元组$(x,y)$并排序,记$tot_{(x,y)}$为$(x,y)$的数量 其中所给的两个条件,即分别要求: 1.$(x,y)$只能和$(x\pm ...

  9. [cf1349D]Slime and Biscuits

    枚举最终的获得所有饼干的人$i$(以下简称"获胜者"),对于$i$获胜的情况,令其贡献为游戏轮数,否则其贡献为0,记$F_{i}$为期望贡献(即所有情况概率*贡献之和),答案即为$ ...

  10. 填坑总结:python内存泄漏排查小技巧

    摘要:最近服务遇到了内存泄漏问题,运维同学紧急呼叫解决,于是在解决问题之余也系统记录了下内存泄漏问题的常见解决思路. 本文分享自华为云社区<python内存泄漏排查小技巧>,作者:luti ...