Latex数学公式大全,从求和符号到希腊字母、逻辑符号,应有尽有。
最近用Obsidian做笔记,一开始是打算用来建立自己的知识库,它的双向链接和知识图谱很惊艳,而且自带思维导图,~不过后来沦为了Markdown编辑器~
由于经常要输入公式,所以直接把这个贴在博客好了。
转自:mathjax-basic-tutorial-and-quick-reference
有关Letax快速入门半小时入门Letax(英)
(Deutsch: MathJax: LaTeX Basic Tutorial und Referenz)
To see how any formula was written in any question or answer, including this one, right-click on the expression and choose "Show Math As > TeX Commands". (When you do this, the '$' will not display. Make sure you add these: see the next point. There are also other ways to view the code for the formula or the whole post.)
To try formatting, visit the formatting sandbox post, select one of the answers that says “free for editing” and use the “edit” button to edit the answer however you like. Don't forget to change it back when you are finished, so it can be used again.
-
For inline formulas, enclose the formula in
$…$. For displayed formulas, use$$…$$.-
These render differently. For example, type the following to show inline mode:
$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$
∑ni=0i2=(n2+n)(2n+1)6∑𝑖=0𝑛𝑖2=(𝑛2+𝑛)(2𝑛+1)6 -
or type the following for display mode:
$$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$∑i=0ni2=(n2+n)(2n+1)6∑𝑖=0𝑛𝑖2=(𝑛2+𝑛)(2𝑛+1)6
-
-
For Greek letters, use
\alpha,\beta, …,\omega: α𝛼, β𝛽, …, ω𝜔.- For uppercase letters, use
\Gamma,\Delta, …,\Omega: ΓΓ, ΔΔ, …, ΩΩ. - Other Greek capital letters are the same as the Latin ones:
A,B,E,Zand so on: A,B,E,Z𝐴,𝐵,𝐸,𝑍…. - Some Greek letters have variant forms:
\epsilon \varepsilonϵ𝜖, ε𝜀,\phi \varphiϕ𝜙, φ𝜑, and others.
- For uppercase letters, use
-
For superscripts and subscripts, use
^and_. For example,x_i^2: x2i𝑥𝑖2,\log_2 x: log2xlog2𝑥. For the prime symbol, use an apostrophex' x'' x''': x′ x′′ x′′′𝑥′ 𝑥″ 𝑥‴. -
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: 10101010. But10^{10}gives what you probably wanted: 10101010. - Use curly braces to delimit a formula to which a superscript or subscript applies:
x^y^zis an error;{x^y}^zis xyz𝑥𝑦𝑧, andx^{y^z}is xyz𝑥𝑦𝑧. Observe the differences betweenx_i^2x2i𝑥𝑖2,x_{i^2}xi2𝑥𝑖2 and{x_i}^2xi2𝑥𝑖2.
- If you do
-
Parentheses Ordinary symbols
()[]make parentheses and brackets (2+3)4+4[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√y3)(𝑥𝑦3). Using\left(…\right)will make the sizes adjust automatically to the formula they enclose:\left(\frac{\sqrt x}{y^3}\right)is (x√y3)(𝑥𝑦3). -
\leftand\rightapply to all the following sorts of parentheses:(and)(x)(𝑥),[and][x][𝑥],\{and\}{x}{𝑥},||x||𝑥|,\vert|x||𝑥|,\Vert∥x∥‖𝑥‖,\langleand\rangle⟨x⟩⟨𝑥⟩,\lceiland\rceil⌈x⌉⌈𝑥⌉, and\lfloorand\rfloor⌊x⌋⌊𝑥⌋.\middlecan be used to add additional dividers. There are also invisible parentheses, denoted by.: use\left.x^2\right\rvert_3^5 = 5^2-3^2to getx2∣∣53=52−32𝑥2|35=52−32
-
-
Sums and integrals
\sumand\int; the subscript is the lower limit and the superscript is the upper limit, so for example\sum_1^n∑n1∑1𝑛. Don't forget{…}if the limits are more than a single symbol. For example,\sum_{i=0}^\infty i^2is ∑∞i=0i2∑𝑖=0∞𝑖2.- Similarly,
\prod∏∏,\int∫∫,\bigcup⋃⋃,\bigcap⋂⋂,\iint∬∬,\iiint∭∭,\idotsint∫⋯∫∫⋯∫.
- Similarly,
-
Fractions There are three ways to make fractions.
\frac abapplies to the next two groups, and produces ab𝑎𝑏; for more complicated numerators and denominators use{…}:\frac{a+1}{b+1}is a+1b+1𝑎+1𝑏+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𝑎+1𝑏+1. - For continued fractions, use
\cfracinstead of\frac.
- If the numerator and denominator are complicated, you may prefer
-
Fonts
- Use
\mathbbor\Bbbfor "blackboard bold": CHNQRZ𝐶𝐻𝑁𝑄𝑅𝑍. - Use
\mathbffor boldface: CHNQRZ𝐶𝐻𝑁𝑄𝑅𝑍 chnqrz𝑐ℎ𝑛𝑞𝑟𝑧.- For expression based characters, use
\boldsymbolinstead: α𝛼
- For expression based characters, use
- Use
\mathitfor italics: CHNQRZ𝐶𝐻𝑁𝑄𝑅𝑍 chnqrz𝑐ℎ𝑛𝑞𝑟𝑧. - Use
\pmbfor boldfaced italics: CHNQRZCHNQRZ𝐶𝐻𝑁𝑄𝑅𝑍𝐶𝐻𝑁𝑄𝑅𝑍 chnqrzchnqrz𝑐ℎ𝑛𝑞𝑟𝑧𝑐ℎ𝑛𝑞𝑟𝑧. - Use
\mathttfor "typewriter" font: CHNQRZ𝐶𝐻𝑁𝑄𝑅𝑍 chnqrz𝑐ℎ𝑛𝑞𝑟𝑧. - Use
\mathrmfor roman font: CHNQRZCHNQRZ chnqrzchnqrz. - Use
\mathsffor sans-serif font: CHNQRZ𝐶𝐻𝑁𝑄𝑅𝑍 chnqrz𝑐ℎ𝑛𝑞𝑟𝑧. - Use
\mathcalfor "calligraphic" letters: CHNQRZ𝐶𝐻𝑁𝑄𝑅𝑍 (Uppercase only.) - Use
\mathscrfor script letters: CHNQRZ𝐶𝐻𝑁𝑄𝑅𝑍 chnqrz𝑐ℎ𝑛𝑞𝑟𝑧 - Use
\mathfrakfor "Fraktur" (old German style) letters: CHNQRZ𝐶𝐻𝑁𝑄𝑅𝑍 chnqrz𝑐ℎ𝑛𝑞𝑟𝑧.
-
Radical signs / roots Use
sqrt, which adjusts to the size of its argument:\sqrt{x^3}x3−−√𝑥3;\sqrt[3]{\frac xy}xy−−√3𝑥𝑦3. 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 xsinxsin𝑥, notsin xsinx𝑠𝑖𝑛𝑥. Use subscripts to attach a notation to\lim:\lim_{x\to 0}limx→0lim𝑥→0
Nonstandard function names can be set with
\operatorname{foo}(x)foo(x)foo(𝑥). -
There are a very large number of special symbols and notations, too many to list here; see the short listing LATEX𝐿𝐴𝑇𝐸𝑋 and AMS𝐴𝑀𝑆-LATEX𝐿𝐴𝑇𝐸𝑋 Symbols prepared by Dr. Emre Sermutlu, or the exhaustive listing The Comprehensive LATEX𝐿𝐴𝑇𝐸𝑋 Symbol List by Scott Pakin. 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𝑥⋅𝑦 -
\cup \cap \setminus \subset \subseteq \subsetneq \supset \in \notin \emptyset \varnothing∪∪, ∩∩, ∖∖, ⊂⊂, ⊆⊆, ⊊⊊, ⊃⊃, ∈∈, ∉∉, ∅∅, ∅∅ -
{n+1 \choose 2k}or\binom{n+1}{2k}(n+12k)(𝑛+12𝑘) -
\to \gets \rightarrow \leftarrow \Rightarrow \Leftarrow \mapsto \implies \iff→→, ←←, →→, ←←, ⇒⇒, ⇐⇐, ↦↦, ⟹⟹, ⟺⟺ -
\land \lor \lnot \forall \exists \top \bot \vdash \vDash∧∧, ∨∨, ¬¬, ∀∀, ∃∃, ⊤⊤, ⊥⊥, ⊢⊢, ⊨⊨ -
\star \ast \oplus \circ \bullet⋆⋆, ∗∗, ⊕⊕, ∘∘, ∙∙ -
\approx \sim \simeq \cong \equiv \prec \lhd≈≈, ∼∼, ≃≃, ≅≅, ≡≡, ≺≺, ⊲⊲ -
\infty \aleph_0∞ℵ0∞ℵ0\nabla \partial∇∇, ∂∂\Im \ReIℑ, Rℜ -
For modular equivalence, use
\pmodlike this:a\equiv b\pmod na≡b(modn)𝑎≡𝑏(mod𝑛). For the binary mod operator, use\bmodlike this:a\bmod 17amod17𝑎mod17. -
Use
\dotsfor the triple dots in a1,a2,…,an𝑎1,𝑎2,…,𝑎𝑛 and a1+a2+⋯+an𝑎1+𝑎2+⋯+𝑎𝑛 -
Script lowercase l is
\ellℓℓ.Detexify lets you draw a symbol on a web page and then lists the TEX𝑇𝐸𝑋 symbols that seem to resemble it. These are not guaranteed to work in MathJax, but it's a good place to start. To check that a command is supported, note that MathJax.org maintains a list of currently supported LATEX𝐿𝐴𝑇𝐸𝑋 commands, and one can also check Dr. Carol JVF Burns's page of 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𝑎𝑏. To add more space, use\,for a thin space ab𝑎𝑏;\;for a wider space ab𝑎𝑏.\quadand\qquadare large spaces: ab𝑎𝑏, ab𝑎𝑏.To set plain text, use
\text{…}: {x∈s∣x is extra large}{𝑥∈𝑠∣𝑥 is extra large}. You can nest$…$inside of\text{…}, for example to access spaces. -
Accents and diacritical marks Use
\hatfor a single symbol x𝑥,\widehatfor a larger formula xyˆ𝑥𝑦^. If you make it too wide, it will look silly. Similarly, there are\barx¯𝑥¯ and\overlinexyz¯¯¯¯¯¯¯¯𝑥𝑦𝑧¯, and\vecx⃗ 𝑥→ and\overrightarrowxy−→𝑥𝑦→ and\overleftrightarrowxy←→𝑥𝑦↔. For dots, as in ddxxx˙=x˙2+xx¨𝑑𝑑𝑥𝑥𝑥˙=𝑥˙2+𝑥𝑥¨, use\dotand\ddot. -
Special characters used for MathJax interpreting can be escaped using the
\character: $ $$,\{{{,\}}},\___,\###,\&&&. If you want\itself, you should use\backslash(symbol) or\setminus(binary operation) for ∖∖, because\\is for a new line.
(Tutorial ends here.)

浙公网安备 33010602011771号