There are three methods for displaying formulas in Wikipedia: raw HTML, HTML with math templates (abbreviated here as {{math}}), and a subset of LaTeX implemented with the HTML markup (referred to as LaTeX in this article). Each method has some advantages and some disadvantages, which he evolved over time with improvements to the MediaWiki software. The Manual of Style Mathematics has not always evolved accordingly. So the how-to recommendations that appear below may differ from those of the Manual of Style. In this case, they express a consensus resulting of the practice of the most experienced members of WikiProject Mathematics and many discussions at Wikipedia talk:WikiProject Mathematics.
For example, the famous Einstein formula can be entered in raw HTML as {{nowrap|''E'' {{=}} ''mc''2}}, which is rendered as E = mc2 (the template {{nowrap}} is used here only for oiding a line break inside the formula). With {{math}}, it can be entered as {{math|''E'' {{=}} ''mc''{{sup|2}}}}, which is rendered as E = mc2. With LaTeX, it is entered as E=mc^2, and rendered as E = m c 2 {\displaystyle E=mc^{2}} .
Use of raw HTML[edit]Variable names and many symbols appear very different to the reader when raw HTML is used compared to the other rendering methods. This may be confusing in the common case where several methods are used in the same article. Moreover, mathematicians who are used to reading and writing texts written with LaTeX often find the raw HTML rendering awful.
So, raw HTML should normally not be used for new content. However, raw HTML is still present in many mathematical articles. It is generally a good editing practice to convert it to {{math}} format, but consistency must be respected; that is, such a conversion must be done in a whole article, or at least in a whole section. Moreover, such a conversion must be identified as such in the edit summary, and making other changes in the same edit should be oided. This is to help other users identify changes that are possibly controversial (the "diff" of a conversion may be very large, and may hide other changes).
Converting raw HTML to {{math}} is rather simple: when the formula is enclosed with {{nowrap}}, it suffices to change "nowrap" into "math". However, if the formula contains an equal sign, one has to add 1= just before the formula for oiding confusion with the template syntax; for example, {{math|1=''E'' = ''mc''{{sup|2}}}}. Also, vertical bars (|), if any, must either be replaced with {{!}} or oided by using {{abs}}.
LaTeX vs. {{math}}[edit] See also: Wikipedia:Rendering mathBoth accepted by MOS:MATH, these two methods of writing mathematical expressions—using {{math}} and LaTeX—he both advantages and disadvantages. The visual rendering of variable names is largely consistent between them, and displaying variables within the same paragraph using either method generally does not cause formatting issues.
The disadvantages of LaTeX are the following:
On some browser configurations, LaTeX inline formulas appear with a slight vertical misalignment, or with a font size that may be slightly different from that of the surrounding text. This is not a problem with a block displayed formula, and also typically not with inline formulas that exceed the normal line height marginally (for example, formulas with subscripts and superscripts). The use of LaTeX in a piped link or in a section heading does not appear in blue in the linked text or the table of contents. Moreover, links to section headings containing LaTeX formulas do not always work as expected. Finally, hing many LaTeX formulas may significantly increase the processing time of a page. LaTeX formulas should be oided in image captions or footnotes, because when the image is clicked for a larger display or a footnote is selected on a mobile device, LaTeX in the caption or footnote will not render.Disadvantages of {{math}} include that not all formulas can be displayed, and while it may be possible to display a complicated formula with {{math}}, it may be poorly rendered. Except for the most common symbols such as letters, numerals, and basic punctuation, rendering of Unicode mathematical symbols can be inconsistent in size or alignment where fallback fonts do not match, and some readers may not he any font which includes certain uncommon symbols. Spaces within a formula must be directly managed (for example, by including explicit hair or thin spaces). Variable names must be italicized explicitly, and superscripts and subscripts must use an explicit tag or template. Except for short formulas, the source of a formula typically has more markup overhead and can be difficult to read.
The common practice of most members of WikiProject Mathematics is the following:
Use of {{mvar}} and {{math}} for isolated variables and {{math}} for simple inline formulas; or alternately the use of LaTeX for these purposes (optionally using the {{tmath}} template), especially on articles with many complex formulas or where rendering seems inconsistent Use of {{mvar}} and {{math}} for formulas in image captions, even if the rendering is mediocre Use of LaTeX for separately displayed formulas and more complicated inline formulas Use of LaTeX for formulas involving symbols that are not regularly rendered in Unicode (see Manual of Style/Mathematics § Blackboard bold) Avoid formulas in section headings, and when this is necessary, use raw HTML (see Finite field § GF(p2) for an odd prime p for an example)The choice between {{math}} and LaTeX depends on the editor. Converting a page from one format to another must be done with stronger reasons than editor preference.
Display format of LaTeX[edit]By default SVG images with non-visible MathML are generated. The text-only form of the LaTeX can be set via Preferences → Appearance → Math.
The hidden MathML can be used by screen readers and other assistive technology. In Firefox, to display the MathML:
Install the Native MathML extension Or copy its CSS rules to your User/common.css.In either case, you must he fonts that support MathML (see Mozilla Fonts for MathML) installed on your system. For copy-paste support in Firefox, you can also install MathML Copy.
Spaces and ordinary text[edit]Formulas using multiple words and hyphens are not functional in . For example, this code, which gives a simple formula for calculating pollution risks:
Risk = Measured environmental concentration \over Predicted no-effect concentration
produces this unreadable result:
R i s k = M e a s u r e d e n v i r o n m e n t a l c o n c e n t r a t i o n P r e d i c t e d n o − e f f e c t c o n c e n t r a t i o n {\displaystyle Risk=Measuredenvironmentalconcentration \over Predictedno-effectconcentration}
Use of HTML templates[edit] ShortcutWP:MATHSYMBOLWP:MATHSYMBOL See also: Wikipedia:Rendering mathTeX (LaTeX) markup is not the only way to render mathematical formulas. For simple inline formulas, the template {{math}} and its associated templates are often preferred. The following comparison table shows that similar results can be achieved with the two methods. (See also Help:Special characters.)
LaTeX syntax LaTeX rendering HTML syntax HTML rendering \alpha α {\displaystyle \alpha } {{math|''α''}} or {{mvar|α}} α or α f(x) = x^2 f ( x ) = x 2 {\displaystyle f(x)=x^{2}} {{math|1=''f''(''x'') = ''x''2}} f(x) = x2 \{1,e,\pi\} { 1 , e , π } {\displaystyle \{1,e,\pi \}} {{math|{{mset|1, ''e'', ''π''}}}} {1, e, π} |z| \leq 2 | z | ≤ 2 {\displaystyle |z|\leq 2} {{math|{{abs|''z''}} ≤ 2}} |z| ≤ 2Here is a summary of the mathematical templates:
vteMath templates Functions Numeral systems Functions elementary arithmetic precision val (value formatting) percentage Numeral systems {{#invoke:BaseConvert|XtoY}} binary decimal2Base hex2dec hexadecimal octal quaternary rn roman ternary vigesimal Conversions convert many units (see: list) cvt abbreviated {{convert}} convinfobox {{convert}} for infoboxes bbl to t barrels of oil to tonnes long ton long hundredweights, quarters and pounds to kilograms;long tons and hundredweights to pounds and metric tons miles-chains miles and chains to kilometres linking "chains" decdeg degrees, minutes, and seconds to decimal degrees deg2dms decimal degrees to degrees, minutes, and seconds deg2hms decimal degrees to hour angle (in hours, minutes, and seconds) hms2deg hour angle (in hours, minutes, and seconds) to decimal degrees inflation calculate inflation of Consumer Price Index-related prices pop density population density in an area track gauge railway track gaugesNotation and formatting bigmath bigger font to match TeX \displaystyle (standalone formulas only) math short text-based formulas mathcal [mathematical] calligraphic font; alternative to LaTeX \mathcal{...} tombstone symbol indicating the end of a proof mvar individual italicized maths variables in normal text val measurement values, uncertainties and units overline underline a line set above/below a sequence of characters vec various overarrows, underarrows, etc. abs absolute values (paired vertical lines) langle rangle angbr angular brackets bra-ket braket bra ket bra–ket notation ldelim rdelim multiline delimiters (2–5 lines inclusive) ceil, floor calculations :mw:Help:#expr; formatting indicators ⌈3.14⌉, ⌊3.14⌋ (no calculation performed) pars parentheses that can be resized (∑) fraction slant fractions 3⁄5 (not for maths/science articles; use standing or upright fractions {{sfrac}} instead) sfrac "standing" or upright fractions 3/5 (use in maths/science articles instead of{{fraction}}) intmath integral symbols sub sup su subscripts and superscripts overset underset arbitrary characters/diacritics set above/below one another tmath Wrap TeX in tags Boxes Tags Notices BoxesTags arithmetic operations calculus Infobox mathematical function functions metricate undue precision units attentionWhen writing sets or expressions involving braces, vertical bars, or equal signs within {{math}}, care is required, as these characters can conflict with template syntax. To oid such issues:
Use {{mset}} to safely enclose elements in curly braces ({}) Use {{abs}} to wrap values in absolute value bars (| · |), oiding parser function confusion with template pipes. For a single vertical bar (|), use {{!}}. For an equal sign (=) within template parameters, use {{=}}. HTML entities[edit]Though Unicode characters are generally preferred, sometimes HTML entities are needed to oid problems with wikitext or confusion with other characters:
− •′ ″ ⋅ · – — ; ; − • ′ ″ ⋅ · – —In the table below, the HTML syntax on the left produces the symbols on the right, but these symbols can also be entered directly into the wikitext either by typing them if they are ailable on the keyboard, by copy-pasting them, or by using the special character button (
) in the toolbar. (When editing any Wikipedia page in a desktop web browser, use the "Insert" pulldown menu immediately below the article text, or the "Special characters" menu immediately above the article text.) Normally, lowercase Greek letters should be entered in italics, that is, enclosed between two single quotes (for example,''β'').
α β γ δ ε ζη θ ι κ λ μ νξ ο π ρ σ ςτ υ φ χ ψ ω
Γ Δ Θ Λ Ξ Π Σ Φ Ψ ΩΓ Δ Θ Λ Ξ ΠΣ Φ Ψ Ω
∫ ∑ ∏ − ± ∞ ≈ ∝ = ≡ ≠ ≤ ≥ × · ⋅ ÷ ∂ ′ ″ ∇ ‰ ° ∴ ∅∫ ∑ ∏ − ± ∞≈ ∝ = ≡ ≠ ≤ ≥× · ⋅ ÷ ∂ ′ ″∇ ‰ ° ∴ ∅
∈ ∉ ∩ ∪ ⊂ ⊃ ⊆ ⊇ ¬ ∧ ∨ ∃ ∀ ⇒ ⇔ → ↔ ↑ ↓ ℵ - – —∈ ∉ ∩ ∪ ⊂ ⊃ ⊆ ⊇¬ ∧ ∨ ∃ ∀⇒ ⇔ → ↔ ↑ ↓ℵ - – —
Superscripts and subscripts[edit] x2 x3 x21x2x3x{{su|b=1|p=2|lh=1}} Spacing[edit]To oid line-wrapping in the middle of a formula, use {{math}}. If necessary, a non-breaking space ( ) can be inserted with ;. When an inline formula is long enough, it can be helpful to allow it to break across lines. Whether using LaTeX or templates, split the formula at each acceptable breakpoint into separate tags or {{math}} templates with any binary relations or operators and intermediate whitespace included at the trailing end rather than leading end of a part.
Typically whitespace should be a regular space ( ) or none at all. In rare circumstances, such as where one character overlaps another due to one being in italics, a thin space can be added with {{thin space}}.
Additional[edit]For more on Wikipedia how-tos and math style guidelines, see:
MOS:FRAC for how to input fractions in various circumstances MOS:RADICAL for how to square and other roots in various circumstances Per MOS:ELLIPSIS, "..." (three ASCII periods) is used instead of "…" (single character) Arrow (symbol) § Arrows in Unicode Mathematical operators and symbols in Unicode Wikipedia:Manual of Style/MathematicsFor more on special characters:
Unicode character name index can be used to find the Unicode number of a character. W3C list of MathML characters indexed by code or by name List of XML and HTML character entity references – includes all named entities Glossary of mathematical symbols LaTeX basics[edit]Math markup goes inside .... Chemistry markup goes inside ... or .... {{tmath|...}} can be used in place of ... to oid line-wrapping of adjacent text (with ceats). All these tags use TeX.
The TeX code has to be put literally: MediaWiki templates, predefined templates, and parameters cannot be used within math tags: pairs of double braces are ignored and "#" gives an error message. However, math tags work in the true and false parameters of an #if expression, etc. See m:Template:Demo of attempt to use parameters within TeX (backlinks edit) for more information.
The now deprecated tag was considered too ambiguous, and it has been replaced by .[1]
LaTeX commands[edit]LaTeX commands are case-sensitive, and take one of the following two formats:
They start with a backslash \ and then he a name consisting of letters only. Command names are terminated by a space, a number or any other "non-letter" character. They consist of a backslash \ and exactly one non-letter.Some commands need an argument, which has to be given between curly braces {} after the command name. Some commands support optional parameters, which are added after the command name in square brackets []. The general syntax is:
\commandname[option1,option2,...]{argument1}{argument2}...
Special characters[edit]The following symbols are reserved characters that either he a special meaning under LaTeX or are unailable in all the fonts. If you enter them directly in your text, they will normally not render, but rather do things you did not intend.
# $ % ^ & _ { } ~ \These characters can be entered by prefixing the escape character backslash \ or using special sequences:
\# \$ \% ^\wedge \& \_ \{ \} \sim \backslashyielding:
# $ % ∧ & _ { } ∼ ∖ {\displaystyle \#\$\%^{\wedge }\&\_\{\}\sim \backslash }
The backslash character \ can not be entered by adding another backslash in front of it (\\); this sequence is used for line breaking. For introducing a backslash in math mode, you can use \backslash instead which gives ∖ {\displaystyle \backslash } .
The command \tilde produces a tilde which is placed over the next letter. For example, \tilde{a} gives a ~ {\displaystyle {\tilde {a}}} . To produce just a tilde character ~, use \tilde{\ } which gives ~ {\displaystyle {\tilde {\ }}} , placing a ~ over an empty box. Alternatively \sim produces ∼ {\displaystyle \sim } , a large centred ~ which may be more appropriate in some situations.
The command \hat produces a hat over the next character, for example \hat{o} produces o ^ {\displaystyle {\hat {o}}} . For a stretchable version, use \widehat{abc} giving a b c ^ {\displaystyle {\widehat {abc}}} . The wedge \wedge is normally used as a mathematical operator ∧ {\displaystyle \wedge } . The sequence {}^\wedge produces ∧ {\displaystyle {}^{\wedge }} the best equivalent to the ASCII caret ^ character.
Spaces[edit]"Whitespace" characters, such as blank or tab, are treated uniformly as "space" by LaTeX. Several consecutive whitespace characters are treated as one "space". See § Spacing for commands that produces spaces of different size.
LaTeX environments[edit]Environments in LaTeX he a role that is quite similar to commands, but they usually he effect on a wider part of formula. Their syntax is:
\begin{environmentname} text to be influenced \end{environmentname}Environments supported by Wikipedia include matrix, align, etc. See § Fractions, matrices, multilines.
Rendering[edit]The font sizes and types are independent of browser settings or CSS. Font sizes and types will often deviate from what HTML renders. Vertical alignment with the surrounding text can also be a problem; a work-around is described in § Alignment with normal text flow. The CSS selector of the images is img.tex.
Apart from function and operator names, as is customary in mathematics, variables and letters are in italics; digits are not. For other text, (like variable labels) to oid being rendered in italics like variables, use \text or \mathrm (formerly \rm). You can also define new function names using \operatorname{...}. For example, \text{abc} gives abc {\displaystyle {\text{abc}}} . \operatorname{...} provides spacing before and after the operator name when appropriate, as when a\operatorname{sn}b is rendered as a sn b {\displaystyle a\operatorname {sn} b} (with space to the left and right of "sn") and a\operatorname{sn}(b+c) as a sn ( b + c ) {\displaystyle a\operatorname {sn} (b+c)} (with space to the left and not to the right). LaTeX's starred version, \operatorname* is not supported, but a workaround is to add \limits instead. For example, \operatorname{sn}_{b>c}(b+c) \qquad \operatorname{sn}\limits_{b>c}(b+c) renders as:
sn b > c ( b + c ) sn b > c ( b + c ) {\displaystyle \operatorname {sn} _{b>c}(b+c)\qquad \operatorname {sn} \limits _{b>c}(b+c)}LaTeX does not he full support for Unicode characters, and not all characters render. Most Latin characters with accents render correctly. However some do not, in particular those that include multiple diacritics (e.g. with Latin letters used in Vietnamese) or that cannot be precomposed into a single character (such as the uppercase Latin letter W with ring W̊), or that use other diacritics (like the ogonek or the double gre accent, used in Central European languages like Polish, or the horn attached above some vowels in Vietnamese), or other modified letter forms (used in IPA notations, African languages, or in medieval texts), some digram ligatures (like IJ in Dutch), or Latin letters borrowed from Greek, or small capitals, as well as superscripts and subscript letters. For example, \text{ð} and \text{þ} (used in Icelandic) will give errors.
The normal way of entering quotation marks in text mode (two back ticks for the left and two apostrophes for the right), such as \text{a ``quoted'' word} will not work correctly. As a workaround, you can use the Unicode left and right quotation mark characters, which are ailable from the special characters button (
), or "Symbols" dropdown panel beneath the editor: \text{a “quoted” word}.
MediaWiki stores rendered formulas in a cache so that the images of those formulas do not need to be created each time the page is opened by a user. To force the rerendering of all formulas of a page, you must open it with the getter variables action=purge&mathpurge=true. Imagine for example there is a wrong rendered formula in the article Integral. To force the re-rendering of this formula you need to open the URL: https://en.wikipedia.org/w/index.php?title=Integral&action=purge&mathpurge=true
Afterwards you need to bypass your browser cache, so that the new created images of the formulas are actually downloaded.
Formatting using LaTeX[edit] Functions, symbols, special characters[edit] Accents and diacritics[edit] \dot{a}, \ddot{a}, \acute{a}, \gre{a} a ˙ , a ¨ , a ´ , a ` {\displaystyle {\dot {a}},{\ddot {a}},{\acute {a}},{\gre {a}}} \check{a}, \breve{a}, \tilde{a}, \bar{a} a ˇ , a ˘ , a ~ , a ¯ {\displaystyle {\check {a}},{\breve {a}},{\tilde {a}},{\bar {a}}} \hat{a}, \widehat{a}, \vec{a} a ^ , a ^ , a → {\displaystyle {\hat {a}},{\widehat {a}},{\vec {a}}} Standard numerical functions[edit] \exp_a b = a^b, \exp b = e^b, 10^m exp a b = a b , exp b = e b , 10 m {\displaystyle \exp _{a}b=a^{b},\exp b=e^{b},10^{m}} \ln c = \log c, \lg d = \log_{10} d ln c = log c , lg d = log 10 d {\displaystyle \ln c=\log c,\lg d=\log _{10}d} \sin a, \cos b, \tan c, \cot d, \sec f, \csc g sin a , cos b , tan c , cot d , sec f , csc g {\displaystyle \sin a,\cos b,\tan c,\cot d,\sec f,\csc g} \arcsin h, \arccos i, \arctan j arcsin h , arccos i , arctan j {\displaystyle \arcsin h,\arccos i,\arctan j} \sinh k, \cosh l, \tanh m, \coth n sinh k , cosh l , tanh m , coth n {\displaystyle \sinh k,\cosh l,\tanh m,\coth n} \operatorname{sh}k, \operatorname{ch}l, \operatorname{th}m, \operatorname{coth}n sh k , ch l , th m , coth n {\displaystyle \operatorname {sh} k,\operatorname {ch} l,\operatorname {th} m,\operatorname {coth} n} \operatorname{argsh}o, \operatorname{argch}p, \operatorname{argth}q argsh o , argch p , argth q {\displaystyle \operatorname {argsh} o,\operatorname {argch} p,\operatorname {argth} q} \sgn r, \left\vert s \right\vert sgn r , | s | {\displaystyle \operatorname {sgn} r,\left\vert s\right\vert } \min(x,y), \max(x,y) min ( x , y ) , max ( x , y ) {\displaystyle \min(x,y),\max(x,y)} Bounds[edit] \min x, \max y, \inf s, \sup t min x , max y , inf s , sup t {\displaystyle \min x,\max y,\inf s,\sup t} \lim u, \liminf v, \limsup w lim u , lim inf v , lim sup w {\displaystyle \lim u,\liminf v,\limsup w} \dim p, \deg q, \det m, \ker\phi dim p , deg q , det m , ker ϕ {\displaystyle \dim p,\deg q,\det m,\ker \phi } \injlim, \varinjlim, \projlim, \varprojlim inj lim , lim → , proj lim , lim ← {\displaystyle \injlim ,\varinjlim ,\projlim ,\varprojlim } Projections[edit] \Pr j, \hom l, \lVert z \rVert, \arg z Pr j , hom l , ‖ z ‖ , arg z {\displaystyle \Pr j,\hom l,\lVert z\rVert ,\arg z} Differentials and derivatives[edit] dt, \mathrm{d}t, \partial t, \nabla\psi d t , d t , ∂ t , ∇ ψ {\displaystyle dt,\mathrm {d} t,\partial t,\nabla \psi } dy/dx, \mathrm{d}y/\mathrm{d}x, \frac{dy}{dx}, \frac{\mathrm{d}y}{\mathrm{d}x} d y / d x , d y / d x , d y d x , d y d x {\displaystyle dy/dx,\mathrm {d} y/\mathrm {d} x,{\frac {dy}{dx}},{\frac {\mathrm {d} y}{\mathrm {d} x}}} \frac{\partial^2}{\partial x_1\partial x_2}y, \left.\frac{\partial^3 f}{\partial^2 x \partial y}\right\vert_{p_0} ∂ 2 ∂ x 1 ∂ x 2 y , ∂ 3 f ∂ 2 x ∂ y | p 0 {\displaystyle {\frac {\partial ^{2}}{\partial x_{1}\partial x_{2}}}y,\left.{\frac {\partial ^{3}f}{\partial ^{2}x\partial y}}\right\vert _{p_{0}}} \prime, \backprime, f^\prime, f', f'', f^{(3)}, \dot y, \ddot y ′ , ‵ , f ′ , f ′ , f ″ , f ( 3 ) , y ˙ , y ¨ {\displaystyle \prime ,\backprime ,f^{\prime },f',f'',f^{(3)}\!,{\dot {y}},{\ddot {y}}} Letter-like symbols or constants[edit] \infty, \aleph, \complement, \backepsilon, \eth, \Finv, \hbar, \N, \R, \Z, \C, \Q ∞ , ℵ , ∁ , ∍ , ð , Ⅎ , ℏ , N , R , Z , C , Q {\displaystyle \infty ,\aleph ,\complement ,\backepsilon ,\eth ,\Finv ,\hbar ,\mathbb {N} ,\mathbb {R} ,\mathbb {Z} ,\mathbb {C} ,\mathbb {Q} } \Im, \imath, \jmath, \Bbbk, \ell, \mho, \wp, \Re, \circledS, \S, \P, \AA ℑ , ı , ȷ , k , ℓ , ℧ , ℘ , ℜ , Ⓢ , § , ¶ , Å {\displaystyle \Im ,\imath ,\jmath ,\Bbbk ,\ell ,\mho ,\wp ,\Re ,\circledS ,\S ,\P ,\mathrm {\AA} } Modular arithmetic[edit] s_k \equiv 0 \pmod{m} s k ≡ 0 ( mod m ) {\displaystyle s_{k}\equiv 0{\pmod {m}}} a \bmod b a mod b {\displaystyle a{\bmod {b}}} \gcd(m, n), \operatorname{lcm}(m, n) gcd ( m , n ) , lcm ( m , n ) {\displaystyle \gcd(m,n),\operatorname {lcm} (m,n)} \mid, \nmid, \shortmid, \nshortmid ∣ , ∤ , ∣ , ∤ {\displaystyle \mid ,\nmid ,\shortmid ,\nshortmid } Radicals[edit] \surd, \sqrt{2}, \sqrt[n]{2}, \sqrt[3]{\frac{x^3+y^3}{2}} √ , 2 , 2 n , x 3 + y 3 2 3 {\displaystyle \surd ,{\sqrt {2}},{\sqrt[{n}]{2}},{\sqrt[{3}]{\frac {x^{3}+y^{3}}{2}}}} Operators[edit] +, -, \pm, \mp, \dotplus + , − , ± , ∓ , ∔ {\displaystyle +,-,\pm ,\mp ,\dotplus } \times, \div, \divideontimes, /, \backslash × , ÷ , ⋇ , / , ∖ {\displaystyle \times ,\div ,\divideontimes ,/,\backslash } \cdot, * \ast, \star, \circ, \bullet ⋅ , ∗ ∗ , ⋆ , ∘ , ∙ {\displaystyle \cdot ,*\ast ,\star ,\circ ,\bullet } \boxplus, \boxminus, \boxtimes, \boxdot ⊞ , ⊟ , ⊠ , ⊡ {\displaystyle \boxplus ,\boxminus ,\boxtimes ,\boxdot } \oplus, \ominus, \otimes, \oslash, \odot ⊕ , ⊖ , ⊗ , ⊘ , ⊙ {\displaystyle \oplus ,\ominus ,\otimes ,\oslash ,\odot } \circleddash, \circledcirc, \circledast ⊝ , ⊚ , ⊛ {\displaystyle \circleddash ,\circledcirc ,\circledast } \bigoplus, \bigotimes, \bigodot ⨁ , ⨂ , ⨀ {\displaystyle \bigoplus ,\bigotimes ,\bigodot } Sets[edit] \{ \}, \O \empty \emptyset, \varnothing { } , ∅ ∅ ∅ , ∅ {\displaystyle \{\},\emptyset \emptyset \emptyset ,\varnothing } \in, \notin \not\in, \ni, \not\ni ∈ , ∉∉ , ∋ , ∌ {\displaystyle \in ,\notin \not \in ,\ni ,\not \ni } \cap, \Cap, \sqcap, \bigcap ∩ , ⋒ , ⊓ , ⋂ {\displaystyle \cap ,\Cap ,\sqcap ,\bigcap } \cup, \Cup, \sqcup, \bigcup, \bigsqcup, \uplus, \biguplus ∪ , ⋓ , ⊔ , ⋃ , ⨆ , ⊎ , ⨄ {\displaystyle \cup ,\Cup ,\sqcup ,\bigcup ,\bigsqcup ,\uplus ,\biguplus } \setminus, \smallsetminus, \times ∖ , ∖ , × {\displaystyle \setminus ,\smallsetminus ,\times } \subset, \Subset, \sqsubset ⊂ , ⋐ , ⊏ {\displaystyle \subset ,\Subset ,\sqsubset } \supset, \Supset, \sqsupset ⊃ , ⋑ , ⊐ {\displaystyle \supset ,\Supset ,\sqsupset } \subseteq, \nsubseteq, \subsetneq, \varsubsetneq, \sqsubseteq ⊆ , ⊈ , ⊊ , ⊊ , ⊑ {\displaystyle \subseteq ,\nsubseteq ,\subsetneq ,\varsubsetneq ,\sqsubseteq } \supseteq, \nsupseteq, \supsetneq, \varsupsetneq, \sqsupseteq ⊇ , ⊉ , ⊋ , ⊋ , ⊒ {\displaystyle \supseteq ,\nsupseteq ,\supsetneq ,\varsupsetneq ,\sqsupseteq } \subseteqq, \nsubseteqq, \subsetneqq, \varsubsetneqq ⫅ , ⊈ , ⫋ , ⫋ {\displaystyle \subseteqq ,\nsubseteqq ,\subsetneqq ,\varsubsetneqq } \supseteqq, \nsupseteqq, \supsetneqq, \varsupsetneqq ⫆ , ⊉ , ⫌ , ⫌ {\displaystyle \supseteqq ,\nsupseteqq ,\supsetneqq ,\varsupsetneqq } Relations[edit] =, \ne, \neq, \equiv, \not\equiv = , ≠ , ≠ , ≡ , ≢ {\displaystyle =,\neq ,\neq ,\equiv ,\not \equiv } \doteq, \doteqdot, \mathrel{\overset{\underset\mathrm{def}{}}=}, \mathrel{\stackrel\mathrm{def}=}, := ≐ , ≑ , = d e f , = d e f , := {\displaystyle \doteq ,\doteqdot ,\mathrel {\overset {\underset {\mathrm {def} }{}}{=}} ,\mathrel {\stackrel {\mathrm {def} }{=}} ,:=} \sim, \nsim, \backsim, \thicksim, \simeq, \backsimeq, \eqsim, \cong, \ncong ∼ , ≁ , ∽ , ∼ , ≃ , ⋍ , ≂ , ≅ , ≆ {\displaystyle \sim ,\nsim ,\backsim ,\thicksim ,\simeq ,\backsimeq ,\eqsim ,\cong ,\ncong } \approx, \thickapprox, \approxeq, \asymp, \propto, \varpropto ≈ , ≈ , ≊ , ≍ , ∝ , ∝ {\displaystyle \approx ,\thickapprox ,\approxeq ,\asymp ,\propto ,\varpropto } ̸̸ , ≯ , ≫ , ≫̸ , ⋙ , ⋙̸ , ⋗ {\displaystyle >,\ngtr ,\gg ,\not \gg ,\ggg ,\not \ggg ,\gtrdot } \le, \leq, \lneq, \leqq, \nleq, \nleqq, \lneqq, \lvertneqq ≤ , ≤ , ⪇ , ≦ , ≰ , ≰ , ≨ , ≨ {\displaystyle \leq ,\leq ,\lneq ,\leqq ,\nleq ,\nleqq ,\lneqq ,\lvertneqq } \ge, \geq, \gneq, \geqq, \ngeq, \ngeqq, \gneqq, \gvertneqq ≥ , ≥ , ⪈ , ≧ , ≱ , ≱ , ≩ , ≩ {\displaystyle \geq ,\geq ,\gneq ,\geqq ,\ngeq ,\ngeqq ,\gneqq ,\gvertneqq } \lessgtr, \lesseqgtr, \lesseqqgtr, \gtrless, \gtreqless, \gtreqqless ≶ , ⋚ , ⪋ , ≷ , ⋛ , ⪌ {\displaystyle \lessgtr ,\lesseqgtr ,\lesseqqgtr ,\gtrless ,\gtreqless ,\gtreqqless } \leqslant, \nleqslant, \eqslantless ⩽ , ⪇ , ⪕ {\displaystyle \leqslant ,\nleqslant ,\eqslantless } \geqslant, \ngeqslant, \eqslantgtr ⩾ , ⪈ , ⪖ {\displaystyle \geqslant ,\ngeqslant ,\eqslantgtr } \lesssim, \lnsim, \lessapprox, \lnapprox ≲ , ⋦ , ⪅ , ⪉ {\displaystyle \lesssim ,\lnsim ,\lessapprox ,\lnapprox } \gtrsim, \gnsim, \gtrapprox, \gnapprox ≳ , ⋧ , ⪆ , ⪊ {\displaystyle \gtrsim ,\gnsim ,\gtrapprox ,\gnapprox } \prec, \nprec, \preceq, \npreceq, \precneqq ≺ , ⊀ , ⪯ , ⋠ , ⪵ {\displaystyle \prec ,\nprec ,\preceq ,\npreceq ,\precneqq } \succ, \nsucc, \succeq, \nsucceq, \succneqq ≻ , ⊁ , ⪰ , ⋡ , ⪶ {\displaystyle \succ ,\nsucc ,\succeq ,\nsucceq ,\succneqq } \preccurlyeq, \curlyeqprec ≼ , ⋞ {\displaystyle \preccurlyeq ,\curlyeqprec } \succcurlyeq, \curlyeqsucc ≽ , ⋟ {\displaystyle \succcurlyeq ,\curlyeqsucc } \precsim, \precnsim, \precapprox, \precnapprox ≾ , ⋨ , ⪷ , ⪹ {\displaystyle \precsim ,\precnsim ,\precapprox ,\precnapprox } \succsim, \succnsim, \succapprox, \succnapprox ≿ , ⋩ , ⪸ , ⪺ {\displaystyle \succsim ,\succnsim ,\succapprox ,\succnapprox } Geometric[edit] \parallel, \nparallel, \shortparallel, \nshortparallel ∥ , ∦ , ∥ , ∦ {\displaystyle \parallel ,\nparallel ,\shortparallel ,\nshortparallel } \perp, \angle, \sphericalangle, \measuredangle, 45^\circ for degrees ⊥ , ∠ , ∢ , ∡ , 45 ∘ {\displaystyle \perp ,\angle ,\sphericalangle ,\measuredangle ,45^{\circ }} \Box, \square, \blacksquare, \diamond, \Diamond, \lozenge, \blacklozenge, \bigstar ◻ , ◻ , ◼ , ⋄ , ◊ , ◊ , ⧫ , ★ {\displaystyle \Box ,\square ,\blacksquare ,\diamond ,\Diamond ,\lozenge ,\blacklozenge ,\bigstar } \bigcirc, \triangle, \bigtriangleup, \bigtriangledown ◯ , △ , △ , ▽ {\displaystyle \bigcirc ,\triangle ,\bigtriangleup ,\bigtriangledown } \vartriangle, \triangledown △ , ▽ {\displaystyle \vartriangle ,\triangledown } \blacktriangle, \blacktriangledown, \blacktriangleleft, \blacktriangleright ▴ , ▾ , ◂ , ▸ {\displaystyle \blacktriangle ,\blacktriangledown ,\blacktriangleleft ,\blacktriangleright } Logic[edit] \forall, \exists, \nexists ∀ , ∃ , ∄ {\displaystyle \forall ,\exists ,\nexists } \therefore, \because, \And ∴ , ∵ , & {\displaystyle \therefore ,\because ,\And } \lor, \vee, \curlyvee, \bigveedon't use \or which is now deprecated
∨ , ∨ , ⋎ , ⋁ {\displaystyle \lor ,\vee ,\curlyvee ,\bigvee } \land, \wedge, \curlywedge, \bigwedgedon't use \and which is now deprecated
∧ , ∧ , ⋏ , ⋀ {\displaystyle \land ,\wedge ,\curlywedge ,\bigwedge } \lnot, \neg, \not\operatorname{R}, \bot, \top ¬ , ¬ , ⧸ R , ⊥ , ⊤ {\displaystyle \lnot ,\neg ,\not \operatorname {R} ,\bot ,\top } \vdash, \dashv, \vDash, \Vdash, \models ⊢ , ⊣ , ⊨ , ⊩ , ⊨ {\displaystyle \vdash ,\dashv ,\vDash ,\Vdash ,\models } \Vvdash, \nvdash, \nVdash, \nvDash, \nVDash ⊪ , ⊬ , ⊮ , ⊭ , ⊯ {\displaystyle \Vvdash ,\nvdash ,\nVdash ,\nvDash ,\nVDash } \ulcorner, \urcorner, \llcorner, \lrcorner ⌜ , ⌝ , ⌞ , ⌟ {\displaystyle \ulcorner ,\urcorner ,\llcorner ,\lrcorner } Arrows[edit] \Rrightarrow, \Lleftarrow ⇛ , ⇚ {\displaystyle \Rrightarrow ,\Lleftarrow } \Rightarrow, \nRightarrow, \Longrightarrow, \implies ⇒ , ⇏ , ⟹ , ⟹ {\displaystyle \Rightarrow ,\nRightarrow ,\Longrightarrow ,\implies } \Leftarrow, \nLeftarrow, \Longleftarrow ⇐ , ⇍ , ⟸ {\displaystyle \Leftarrow ,\nLeftarrow ,\Longleftarrow } \Leftrightarrow, \nLeftrightarrow, \Longleftrightarrow, \iff ⇔ , ⇎ , ⟺ , ⟺ {\displaystyle \Leftrightarrow ,\nLeftrightarrow ,\Longleftrightarrow ,\iff } \Uparrow, \Downarrow, \Updownarrow ⇑ , ⇓ , ⇕ {\displaystyle \Uparrow ,\Downarrow ,\Updownarrow } \rightarrow, \to, \nrightarrow, \longrightarrow → , → , ↛ , ⟶ {\displaystyle \rightarrow ,\to ,\nrightarrow ,\longrightarrow } \leftarrow, \gets, \nleftarrow, \longleftarrow ← , ← , ↚ , ⟵ {\displaystyle \leftarrow ,\gets ,\nleftarrow ,\longleftarrow } \leftrightarrow, \nleftrightarrow, \longleftrightarrow ↔ , ↮ , ⟷ {\displaystyle \leftrightarrow ,\nleftrightarrow ,\longleftrightarrow } \uparrow, \downarrow, \updownarrow ↑ , ↓ , ↕ {\displaystyle \uparrow ,\downarrow ,\updownarrow } \nearrow, \swarrow, \nwarrow, \searrow ↗ , ↙ , ↖ , ↘ {\displaystyle \nearrow ,\swarrow ,\nwarrow ,\searrow } \mapsto, \longmapsto ↦ , ⟼ {\displaystyle \mapsto ,\longmapsto } \rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft \upharpoonright \downharpoonleft \downharpoonright \rightleftharpoons \leftrightharpoons ⇀ , ⇁ , ↼ , ↽ , ↿ , ↾ , ⇃ , ⇂ , ⇌ , ⇋ {\displaystyle \rightharpoonup ,\rightharpoondown ,\leftharpoonup ,\leftharpoondown ,\upharpoonleft ,\upharpoonright ,\downharpoonleft ,\downharpoonright ,\rightleftharpoons ,\leftrightharpoons } \curvearrowleft \circlearrowleft \Lsh \upuparrows \rightrightarrows \rightleftarrows \rightarrowtail \looparrowright ↶ , ↺ , ↰ , ⇈ , ⇉ , ⇄ , ↣ , ↬ {\displaystyle \curvearrowleft ,\circlearrowleft ,\Lsh ,\upuparrows ,\rightrightarrows ,\rightleftarrows ,\rightarrowtail ,\looparrowright } \curvearrowright \circlearrowright \Rsh \downdownarrows \leftleftarrows \leftrightarrows \leftarrowtail \looparrowleft ↷ , ↻ , ↱ , ⇊ , ⇇ , ⇆ , ↢ , ↫ {\displaystyle \curvearrowright ,\circlearrowright ,\Rsh ,\downdownarrows ,\leftleftarrows ,\leftrightarrows ,\leftarrowtail ,\looparrowleft } \hookrightarrow \hookleftarrow \multimap \leftrightsquigarrow \rightsquigarrow \twoheadrightarrow \twoheadleftarrow ↪ , ↩ , ⊸ , ↭ , ⇝ , ↠ , ↞ {\displaystyle \hookrightarrow ,\hookleftarrow ,\multimap ,\leftrightsquigarrow ,\rightsquigarrow ,\twoheadrightarrow ,\twoheadleftarrow } Special[edit] \amalg \P \S \% \dagger \ddagger \ldots \cdots \vdots \ddots ⨿ ¶ § % † ‡ … ⋯ ⋮ ⋱ {\displaystyle \amalg \P \S \%\dagger \ddagger \ldots \cdots \vdots \ddots } \smile \frown \wr \triangleleft \triangleright ⌣⌢ ≀ ◃ ▹ {\displaystyle \smile \frown \wr \triangleleft \triangleright } \diamondsuit, \heartsuit, \clubsuit, \spadesuit, \Game, \flat, \natural, \sharp ♢ , ♡ , ♣ , ♠ , ⅁ , ♭ , ♮ , ♯ {\displaystyle \diamondsuit ,\heartsuit ,\clubsuit ,\spadesuit ,\Game ,\flat ,\natural ,\sharp } Unsorted (new stuff)[edit] \diagup \diagdown \centerdot \ltimes \rtimes \leftthreetimes \rightthreetimes ╱ , ╲ , ⋅ , ⋉ , ⋊ , ⋋ , ⋌ {\displaystyle \diagup ,\diagdown ,\centerdot ,\ltimes ,\rtimes ,\leftthreetimes ,\rightthreetimes } \eqcirc \circeq \triangleq \bumpeq \Bumpeq \doteqdot \risingdotseq \fallingdotseq ≖ , ≗ , ≜ , ≏ , ≎ , ≑ , ≓ , ≒ {\displaystyle \eqcirc ,\circeq ,\triangleq ,\bumpeq ,\Bumpeq ,\doteqdot ,\risingdotseq ,\fallingdotseq } \intercal \barwedge \veebar \doublebarwedge \between \pitchfork ⊺ , ⊼ , ⊻ , ⩞ , ≬ , ⋔ {\displaystyle \intercal ,\barwedge ,\veebar ,\doublebarwedge ,\between ,\pitchfork } \vartriangleleft \ntriangleleft \vartriangleright \ntriangleright ⊲ , ⋪ , ⊳ , ⋫ {\displaystyle \vartriangleleft ,\ntriangleleft ,\vartriangleright ,\ntriangleright } \trianglelefteq \ntrianglelefteq \trianglerighteq \ntrianglerighteq ⊴ , ⋬ , ⊵ , ⋭ {\displaystyle \trianglelefteq ,\ntrianglelefteq ,\trianglerighteq ,\ntrianglerighteq }For a little more semantics on these symbols, see this brief TeX Cookbook or here TeX Cookbook.
Larger expressions[edit] Subscripts, superscripts, integrals[edit] Feature Syntax How it looks rendered Superscript a^2, a^{x+3} a 2 , a x + 3 {\displaystyle a^{2},a^{x+3}} Subscript a_2 a 2 {\displaystyle a_{2}} Grouping 10^{30} a^{2+2} 10 30 a 2 + 2 {\displaystyle 10^{30}a^{2+2}} a_{i,j} b_{f'} a i , j b f ′ {\displaystyle a_{i,j}b_{f'}} Combining sub & super without and with horizontal separation x_2^3 x 2 3 {\displaystyle x_{2}^{3}} {x_2}^3 x 2 3 {\displaystyle {x_{2}}^{3}} Super super 10^{10^{8}} 10 10 8 {\displaystyle 10^{10^{8}}} Preceding and/or additional sub & super \sideset{_1^2}{_3^4}\prod_a^b ∏ 1 2 ∏ 3 4 a b {\displaystyle \sideset {_{1}^{2}}{_{3}^{4}}\prod _{a}^{b}} {}_1^2\!\Omega_3^4 1 2 Ω 3 4 {\displaystyle {}_{1}^{2}\!\Omega _{3}^{4}} Stacking \overset{\alpha}{\omega} ω α {\displaystyle {\overset {\alpha }{\omega }}} \underset{\alpha}{\omega} ω α {\displaystyle {\underset {\alpha }{\omega }}} \overset{\alpha}{\underset{\gamma}{\omega}} ω γ α {\displaystyle {\overset {\alpha }{\underset {\gamma }{\omega }}}} \stackrel{\alpha}{\omega} ω α {\displaystyle {\stackrel {\alpha }{\omega }}} Derivatives x', y'', f', f'' x ′ , y ″ , f ′ , f ″ {\displaystyle x',y'',f',f''} x^\prime, y^{\prime\prime} x ′ , y ′ ′ {\displaystyle x^{\prime },y^{\prime \prime }} Derivative dots \dot{x}, \ddot{x} x ˙ , x ¨ {\displaystyle {\dot {x}},{\ddot {x}}} Underlines, overlines, vectors \hat a \ \bar b \ \vec c a ^ b ¯ c → {\displaystyle {\hat {a}}\ {\bar {b}}\ {\vec {c}}} \overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f} a b → c d ← d e f ^ {\displaystyle {\overrightarrow {ab}}\ {\overleftarrow {cd}}\ {\widehat {def}}} \overline{g h i} \ \underline{j k l} g h i ¯ j k l _ {\displaystyle {\overline {ghi}}\ {\underline {jkl}}} Arc (workaround) \overset{\frown} {AB} A B ⌢ {\displaystyle {\overset {\frown }{AB}}} Arrows A \xleftarrow{n+\mu-1} B \xrightarrow[T]{n\pm i-1} C A ← n + μ − 1 B → T n ± i − 1 C {\displaystyle A{\xleftarrow {n+\mu -1}}B{\xrightarrow[{T}]{n\pm i-1}}C} Overbraces \overbrace{ 1+2+\cdots+100 }^{5050} 1 + 2 + ⋯ + 100 ⏞ 5050 {\displaystyle \overbrace {1+2+\cdots +100} ^{5050}} Underbraces \underbrace{ a+b+\cdots+z }_{26} a + b + ⋯ + z ⏟ 26 {\displaystyle \underbrace {a+b+\cdots +z} _{26}} Sum \sum_{k=1}^N k^2 ∑ k = 1 N k 2 {\displaystyle \sum _{k=1}^{N}k^{2}} Sum (force \textstyle) \textstyle \sum_{k=1}^N k^2 ∑ k = 1 N k 2 {\displaystyle \textstyle \sum _{k=1}^{N}k^{2}} Sum in a fraction (default \textstyle) \frac{\sum_{k=1}^N k^2}{a} ∑ k = 1 N k 2 a {\displaystyle {\frac {\sum _{k=1}^{N}k^{2}}{a}}} Sum in a fraction (force \displaystyle) \frac{\displaystyle \sum_{k=1}^N k^2}{a} ∑ k = 1 N k 2 a {\displaystyle {\frac {\displaystyle \sum _{k=1}^{N}k^{2}}{a}}} Sum in a fraction (alternative limits style) \frac{\sum\limits^{N}_{k=1} k^2}{a} ∑ k = 1 N k 2 a {\displaystyle {\frac {\sum \limits _{k=1}^{N}k^{2}}{a}}} Product \prod_{i=1}^N x_i ∏ i = 1 N x i {\displaystyle \prod _{i=1}^{N}x_{i}} Product (force \textstyle) \textstyle \prod_{i=1}^N x_i ∏ i = 1 N x i {\displaystyle \textstyle \prod _{i=1}^{N}x_{i}} Coproduct \coprod_{i=1}^N x_i ∐ i = 1 N x i {\displaystyle \coprod _{i=1}^{N}x_{i}} Coproduct (force \textstyle) \textstyle \coprod_{i=1}^N x_i ∐ i = 1 N x i {\displaystyle \textstyle \coprod _{i=1}^{N}x_{i}} Limit \lim_{n \to \infty}x_n lim n → ∞ x n {\displaystyle \lim _{n\to \infty }x_{n}} Limit (force \textstyle) \textstyle \lim_{n \to \infty}x_n lim n → ∞ x n {\displaystyle \textstyle \lim _{n\to \infty }x_{n}} Integral \int_{1}^{3}\frac{e^3/x}{x^2}\, dx ∫ 1 3 e 3 / x x 2 d x {\displaystyle \int _{1}^{3}{\frac {e^{3}/x}{x^{2}}}\,dx} Integral (alternative limits style) \int\limits_{1}^{3}\frac{e^3/x}{x^2}\, dx ∫ 1 3 e 3 / x x 2 d x {\displaystyle \int \limits _{1}^{3}{\frac {e^{3}/x}{x^{2}}}\,dx} Integral (force \textstyle) \textstyle \int_{-N}^{N} e^x dx ∫ − N N e x d x {\displaystyle \textstyle \int _{-N}^{N}e^{x}dx} Integral (force \textstyle, alternative limits style) \textstyle \int\limits_{-N}^{N} e^x dx ∫ − N N e x d x {\displaystyle \textstyle \int \limits _{-N}^{N}e^{x}dx} Double integral \iint_D dx\,dy ∬ D d x d y {\displaystyle \iint _{D}dx\,dy} Triple integral \iiint_E dx\,dy\,dz ∭ E d x d y d z {\displaystyle \iiint _{E}dx\,dy\,dz} Quadruple integral \iiiint_F dx\,dy\,dz\,dt ⨌ F d x d y d z d t {\displaystyle \iiiint _{F}dx\,dy\,dz\,dt} Line or path integral \int_{(x,y)\in C} x^3\, dx + 4y^2\, dy ∫ ( x , y ) ∈ C x 3 d x + 4 y 2 d y {\displaystyle \int _{(x,y)\in C}x^{3}\,dx+4y^{2}\,dy} Closed line or path integral \oint_{(x,y)\in C} x^3\, dx + 4y^2\, dy ∮ ( x , y ) ∈ C x 3 d x + 4 y 2 d y {\displaystyle \oint _{(x,y)\in C}x^{3}\,dx+4y^{2}\,dy} Intersections \bigcap_{i=1}^n E_i ⋂ i = 1 n E i {\displaystyle \bigcap _{i=1}^{n}E_{i}} Unions \bigcup_{i=1}^n E_i ⋃ i = 1 n E i {\displaystyle \bigcup _{i=1}^{n}E_{i}} Fractions, matrices, multilines[edit] Feature Syntax How it looks rendered Fractions \frac{2}{4}=0.5 or {2 \over 4}=0.5 2 4 = 0.5 {\displaystyle {\frac {2}{4}}=0.5} Small fractions (force \textstyle) \tfrac{2}{4} = 0.5 2 4 = 0.5 {\displaystyle {\tfrac {2}{4}}=0.5} Large (normal) fractions (force \displaystyle) \dfrac{2}{4} = 0.5 \qquad \dfrac{2}{c + \dfrac{2}{d + \dfrac{2}{4}}} = a 2 4 = 0.5 2 c + 2 d + 2 4 = a {\displaystyle {\dfrac {2}{4}}=0.5\qquad {\dfrac {2}{c+{\dfrac {2}{d+{\dfrac {2}{4}}}}}}=a} Large (nested) fractions \cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a 2 c + 2 d + 2 4 = a {\displaystyle {\cfrac {2}{c+{\cfrac {2}{d+{\cfrac {2}{4}}}}}}=a} Cancellations in fractions \cfrac{x}{1 + \cfrac{\cancel{y}}{\cancel{y}}} = \cfrac{x}{2} x 1 + y y = x 2 {\displaystyle {\cfrac {x}{1+{\cfrac {\cancel {y}}{\cancel {y}}}}}={\cfrac {x}{2}}} Binomial coefficients \binom{n}{k} ( n k ) {\displaystyle {\binom {n}{k}}} Small binomial coefficients (force \textstyle) \tbinom{n}{k} ( n k ) {\displaystyle {\tbinom {n}{k}}} Large (normal) binomial coefficients (force \displaystyle) \dbinom{n}{k} ( n k ) {\displaystyle {\dbinom {n}{k}}} Matrices \begin{matrix} -x & y \\ z & -v \end{matrix} − x y z − v {\displaystyle {\begin{matrix}-x&y\\z&-v\end{matrix}}} \begin{vmatrix} -x & y \\ z & -v \end{vmatrix} | − x y z − v | {\displaystyle {\begin{vmatrix}-x&y\\z&-v\end{vmatrix}}} \begin{Vmatrix} -x & y \\ z & -v \end{Vmatrix} ‖ − x y z − v ‖ {\displaystyle {\begin{Vmatrix}-x&y\\z&-v\end{Vmatrix}}} \begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0 \end{bmatrix} [ 0 ⋯ 0 ⋮ ⋱ ⋮ 0 ⋯ 0 ] {\displaystyle {\begin{bmatrix}0&\cdots &0\\\vdots &\ddots &\vdots \\0&\cdots &0\end{bmatrix}}} \begin{Bmatrix} x & y \\ z & v \end{Bmatrix} { x y z v } {\displaystyle {\begin{Bmatrix}x&y\\z&v\end{Bmatrix}}} \begin{pmatrix} x & y \\ z & v \end{pmatrix} ( x y z v ) {\displaystyle {\begin{pmatrix}x&y\\z&v\end{pmatrix}}} \bigl( \begin{smallmatrix} a&b\\ c&d \end{smallmatrix} \bigr) ( a b c d ) {\displaystyle {\bigl (}{\begin{smallmatrix}a&b\\c&d\end{smallmatrix}}{\bigr )}} Case distinctions f(n) = \begin{cases} n/2, & \text{if }n\text{ is even} \\ 3n+1, & \text{if }n\text{ is odd} \end{cases} f ( n ) = { n / 2 , if n is even 3 n + 1 , if n is odd {\displaystyle f(n)={\begin{cases}n/2,&{\text{if }}n{\text{ is even}}\\3n+1,&{\text{if }}n{\text{ is odd}}\end{cases}}} Simultaneous equations \begin{cases} 3x + 5y + z \\ 7x - 2y + 4z \\ -6x + 3y + 2z \end{cases} { 3 x + 5 y + z 7 x − 2 y + 4 z − 6 x + 3 y + 2 z {\displaystyle {\begin{cases}3x+5y+z\\7x-2y+4z\\-6x+3y+2z\end{cases}}} Multiline equations \begin{align} f(x) & = (a+b)^2 \\ & = a^2+2ab+b^2 \\ \end{align} f ( x ) = ( a + b ) 2 = a 2 + 2 a b + b 2 {\displaystyle {\begin{aligned}f(x)&=(a+b)^{2}\\&=a^{2}+2ab+b^{2}\\\end{aligned}}} \begin{alignat}{2} f(x) & = (a-b)^2 \\ & = a^2-2ab+b^2 \\ \end{alignat} f ( x ) = ( a − b ) 2 = a 2 − 2 a b + b 2 {\displaystyle {\begin{alignedat}{2}f(x)&=(a-b)^{2}\\&=a^{2}-2ab+b^{2}\\\end{alignedat}}} Multiline equations with multiple alignments per row \begin{align} f(a,b) & = (a+b)^2 && = (a+b)(a+b) \\ & = a^2+ab+ba+b^2 && = a^2+2ab+b^2 \\ \end{align} f ( a , b ) = ( a + b ) 2 = ( a + b ) ( a + b ) = a 2 + a b + b a + b 2 = a 2 + 2 a b + b 2 {\displaystyle {\begin{aligned}f(a,b)&=(a+b)^{2}&&=(a+b)(a+b)\\&=a^{2}+ab+ba+b^{2}&&=a^{2}+2ab+b^{2}\\\end{aligned}}} \begin{alignat}{3} f(a,b) & = (a+b)^2 && = (a+b)(a+b) \\ & = a^2+ab+ba+b^2 && = a^2+2ab+b^2 \\ \end{alignat} f ( a , b ) = ( a + b ) 2 = ( a + b ) ( a + b ) = a 2 + a b + b a + b 2 = a 2 + 2 a b + b 2 {\displaystyle {\begin{alignedat}{3}f(a,b)&=(a+b)^{2}&&=(a+b)(a+b)\\&=a^{2}+ab+ba+b^{2}&&=a^{2}+2ab+b^{2}\\\end{alignedat}}} Multiline equations (must define number of columns used ({lcl})) (should not be used unless needed) \begin{array}{lcl} z & = & a \\ f(x,y,z) & = & x + y + z \end{array} z = a f ( x , y , z ) = x + y + z {\displaystyle {\begin{array}{lcl}z&=&a\\f(x,y,z)&=&x+y+z\end{array}}} Multiline equations (more) \begin{array}{lcr} z & = & a \\ f(x,y,z) & = & x + y + z \end{array} z = a f ( x , y , z ) = x + y + z {\displaystyle {\begin{array}{lcr}z&=&a\\f(x,y,z)&=&x+y+z\end{array}}} Multiline alignment using & to left align (top example) versus && to right align (bottom example) the last column \begin{alignat}{4} F:\; && C(X) && \;\to\; & C(X) \\ && g && \;\mapsto\; & g^2 \end{alignat} \begin{alignat}{4} F:\; && C(X) && \;\to\; && C(X) \\ && g && \;\mapsto\; && g^2 \end{alignat} F : C ( X ) → C ( X ) g ↦ g 2 {\displaystyle {\begin{alignedat}{4}F:\;&&C(X)&&\;\to \;&C(X)\\&&g&&\;\mapsto \;&g^{2}\end{alignedat}}}
F : C ( X ) → C ( X ) g ↦ g 2 {\displaystyle {\begin{alignedat}{4}F:\;&&C(X)&&\;\to \;&&C(X)\\&&g&&\;\mapsto \;&&g^{2}\end{alignedat}}}
Breaking up a long expression so that it wraps when necessary (this sometimes requires workarounds for correct spacing) The function f is defined by f(x) = {}\sum_{n=0}^\infty a_n x^n = {}a_0+a_1x+a_2x^2+\cdots. The function f {\displaystyle f} is defined by f ( x ) = {\displaystyle f(x)={}} ∑ n = 0 ∞ a n x n = {\textstyle \sum _{n=0}^{\infty }a_{n}x^{n}={}} a 0 + a 1 x + a 2 x 2 + ⋯ . {\displaystyle a_{0}+a_{1}x+a_{2}x^{2}+\cdots .} Arrays \begin{array}{|c|c|c|} a & b & S \\ \hline 0 & 0 & 1 \\ 0 & 1 & 1 \\ 1 & 0 & 1 \\ 1 & 1 & 0 \\ \end{array} a b S 0 0 1 0 1 1 1 0 1 1 1 0 {\displaystyle {\begin{array}{|c|c|c|}a&b&S\\\hline 0&0&1\\0&1&1\\1&0&1\\1&1&0\\\end{array}}} Parenthesizing big expressions, brackets, bars[edit] Feature Syntax How it looks rendered Bad ✗ ( \frac{1}{2} )^n ( 1 2 ) n {\displaystyle ({\frac {1}{2}})^{n}} Good ✓ \left ( \frac{1}{2} \right )^n ( 1 2 ) n {\displaystyle \left({\frac {1}{2}}\right)^{n}}You can use various delimiters with \left and \right:
Feature Syntax How it looks rendered Parentheses \left ( \frac{a}{b} \right ) ( a b ) {\displaystyle \left({\frac {a}{b}}\right)} Brackets \left [ \frac{a}{b} \right ] \quad \left \lbrack \frac{a}{b} \right \rbrack [ a b ] [ a b ] {\displaystyle \left[{\frac {a}{b}}\right]\quad \left\lbrack {\frac {a}{b}}\right\rbrack } Braces \left \{ \frac{a}{b} \right \} \quad \left \lbrace \frac{a}{b} \right \rbrace { a b } { a b } {\displaystyle \left\{{\frac {a}{b}}\right\}\quad \left\lbrace {\frac {a}{b}}\right\rbrace } Angle brackets \left \langle \frac{a}{b} \right \rangle ⟨ a b ⟩ {\displaystyle \left\langle {\frac {a}{b}}\right\rangle } Bars and double bars \left | \frac{a}{b} \right \vert \quad \left \Vert \frac{c}{d} \right \| | a b | ‖ c d ‖ {\displaystyle \left|{\frac {a}{b}}\right\vert \quad \left\Vert {\frac {c}{d}}\right\|} Floor and ceiling functions: \left \lfloor \frac{a}{b} \right \rfloor \quad \left \lceil \frac{c}{d} \right \rceil ⌊ a b ⌋ ⌈ c d ⌉ {\displaystyle \left\lfloor {\frac {a}{b}}\right\rfloor \quad \left\lceil {\frac {c}{d}}\right\rceil } Slashes and backslashes \left / \frac{a}{b} \right \backslash / a b \ {\displaystyle \left/{\frac {a}{b}}\right\backslash } Up, down, and up-down arrows \left \uparrow \frac{a}{b} \right \downarrow \quad \left \Uparrow \frac{a}{b} \right \Downarrow \quad \left \updownarrow \frac{a}{b} \right \Updownarrow ↑ a b ↓ ⇑ a b ⇓ ↕ a b ⇕ {\displaystyle \left\uparrow {\frac {a}{b}}\right\downarrow \quad \left\Uparrow {\frac {a}{b}}\right\Downarrow \quad \left\updownarrow {\frac {a}{b}}\right\Updownarrow } Delimiters can be mixed,as long as \left and \right match \left [ 0,1 \right ) \left \langle \psi \right | [ 0 , 1 ) {\displaystyle \left[0,1\right)} ⟨ ψ | {\displaystyle \left\langle \psi \right|} Use \left. and \right. if you do not want a delimiter to appear \left . \frac{A}{B} \right \} \to X A B } → X {\displaystyle \left.{\frac {A}{B}}\right\}\to X} Size of the delimiters (add "l" or "r" to indicate the side for proper spacing) ( \bigl( \Bigl( \biggl( \Biggl( \dots \Biggr] \biggr] \Bigr] \bigr] ] ( ( ( ( ( … ] ] ] ] ] {\displaystyle ({\bigl (}{\Bigl (}{\biggl (}{\Biggl (}\dots {\Biggr ]}{\biggr ]}{\Bigr ]}{\bigr ]}]} \{ \bigl\{ \Bigl\{ \biggl\{ \Biggl\{ \dots \Biggr\rangle \biggr\rangle \Bigr\rangle \bigr\rangle \rangle { { { { { … ⟩ ⟩ ⟩ ⟩ ⟩ {\displaystyle \{{\bigl \{}{\Bigl \{}{\biggl \{}{\Biggl \{}\dots {\Biggr \rangle }{\biggr \rangle }{\Bigr \rangle }{\bigr \rangle }\rangle } \| \big\| \Big\| \bigg\| \Bigg\| \dots \Bigg| \bigg| \Big| \big| | ‖ ‖ ‖ ‖ ‖ … | | | | | {\displaystyle \|{\big \|}{\Big \|}{\bigg \|}{\Bigg \|}\dots {\Bigg |}{\bigg |}{\Big |}{\big |}|} \lfloor \bigl\lfloor \Bigl\lfloor \biggl\lfloor \Biggl\lfloor \dots \Biggr\rceil \biggr\rceil \Bigr\rceil \bigr\rceil \ceil ⌊ ⌊ ⌊ ⌊ ⌊ … ⌉ ⌉ ⌉ ⌉ ⌉ {\displaystyle \lfloor {\bigl \lfloor }{\Bigl \lfloor }{\biggl \lfloor }{\Biggl \lfloor }\dots {\Biggr \rceil }{\biggr \rceil }{\Bigr \rceil }{\bigr \rceil }\rceil } \uparrow \big\uparrow \Big\uparrow \bigg\uparrow \Bigg\uparrow \dots \Bigg\Downarrow \bigg\Downarrow \Big\Downarrow \big\Downarrow \Downarrow ↑ ↑ ↑ ↑ ↑ ⋯ ⇓ ⇓ ⇓ ⇓ ⇓ {\displaystyle \uparrow {\big \uparrow }{\Big \uparrow }{\bigg \uparrow }{\Bigg \uparrow }\dots {\Bigg \Downarrow }{\bigg \Downarrow }{\Big \Downarrow }{\big \Downarrow }\Downarrow } \updownarrow \big\updownarrow \Big\updownarrow \bigg\updownarrow \Bigg\updownarrow \dots \Bigg\Updownarrow \bigg\Updownarrow \Big\Updownarrow \big\Updownarrow \Updownarrow ↕ ↕ ↕ ↕ ↕ ⋯ ⇕ ⇕ ⇕ ⇕ ⇕ {\displaystyle \updownarrow {\big \updownarrow }{\Big \updownarrow }{\bigg \updownarrow }{\Bigg \updownarrow }\dots {\Bigg \Updownarrow }{\bigg \Updownarrow }{\Big \Updownarrow }{\big \Updownarrow }\Updownarrow } / \big/ \Big/ \bigg/ \Bigg/ \dots \Bigg\backslash \bigg\backslash \Big\backslash \big\backslash \backslash / / / / / … \ \ \ \ ∖ {\displaystyle /{\big /}{\Big /}{\bigg /}{\Bigg /}\dots {\Bigg \backslash }{\bigg \backslash }{\Big \backslash }{\big \backslash }\backslash } Display attribute[edit]The tag can take a display attribute with possible values of inline and block.
Inline[edit]If the value of the display attribute is inline, the contents will be rendered in inline mode: there will be no new paragraph for the equation and the operators will be rendered to consume only a small amount of vertical space.
The sum ∑ i = 0 ∞ 2 − i {\textstyle \sum _{i=0}^{\infty }2^{-i}} converges to 2.
The next line-width is not disturbed by large operators.
The code for the math example reads:
\sum_{i=0}^\infty 2^{-i}The quotation marks around inline are optional and display=inline is also valid.[2]
Technically, the command \textstyle will be added to the user input before the TeX command is passed to the renderer. The result will be displayed without further formatting by outputting the image or MathML element to the page.
Block[edit]In block-style, the equation is rendered in its own paragraph and the operators are rendered consuming less horizontal space. The equation is indented.
The sum ∑ i = 0 ∞ 2 − i {\displaystyle \sum _{i=0}^{\infty }2^{-i}} converges to 2.
It was entered as
\sum_{i=0}^\infty 2^{-i}Technically, the command \displaystyle will be added to the user input (if the user input does not already contain the string \displaystyle or \align) before the TeX command is passed to the renderer. The result will be displayed in a new paragraph. Therefore, the style of the MathImage is altered, i.e. the style attribute display: block; margin: auto; is added. For MathML, it is ensured that display=inline is replaced by display block which produces a new paragraph.
Not specified[edit]If nothing is specified, the equation is rendered in the same display style as "block", but without using a new paragraph. If the equation does appear on a line by itself, it is not automatically indented.
The sum ∑ i = 0 ∞ 2 − i {\displaystyle \sum _{i=0}^{\infty }2^{-i}} converges to 2.
The next line-width is disturbed by large operators.
Or:
The sum
∑ i = 0 ∞ 2 − i {\displaystyle \sum _{i=0}^{\infty }2^{-i}}
converges to 2.
In both cases, the math is coded as:
\sum_{i=0}^\infty 2^{-i} Equation numbering[edit] ShortcutWP:DISPLAYTAGWP:DISPLAYTAGThe templates {{NumBlk}} and {{EquationRef}} can be used to number equations. The template {{EquationNote}} can be used to refer to a numbered equation from surrounding text. For example, the following syntax:
{{NumBlk|:|x^2 + y^2 + z^2 = 1|{{EquationRef|1}}}}produces the following result (note the equation number in the right margin):
x 2 + y 2 + z 2 = 1 {\displaystyle x^{2}+y^{2}+z^{2}=1} 1Later on, the text can refer to this equation by its number using syntax like this:
As seen in equation ({{EquationNote|1}}), example text...The result looks like this:
As seen in equation (1), example text...The equation number produced by {{EquationNote}} is a link that the user can click to go immediately to the cited equation.
Alphabets and typefaces[edit] See also: Wikipedia:LaTeX symbols § FontsTexvc (used in MediaWiki 1.32 and older) cannot render arbitrary Unicode characters. Those it can handle, can be entered by the expressions below. For others, such as Cyrillic, they can be entered as Unicode or HTML entities in running text, but cannot be used in displayed formulas.[needs update]
Greek alphabet \Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta A B Γ Δ E Z H Θ {\displaystyle \mathrm {A} \mathrm {B} \Gamma \Delta \mathrm {E} \mathrm {Z} \mathrm {H} \Theta } \Iota \Kappa \Lambda \Mu \Nu \Xi \Omicron \Pi I K Λ M N Ξ O Π {\displaystyle \mathrm {I} \mathrm {K} \Lambda \mathrm {M} \mathrm {N} \Xi \mathrm {O} \Pi } \Rho \Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega P Σ T Υ Φ X Ψ Ω {\displaystyle \mathrm {P} \Sigma \mathrm {T} \Upsilon \Phi \mathrm {X} \Psi \Omega } \alpha \beta \gamma \delta \epsilon \zeta \eta \theta α β γ δ ϵ ζ η θ {\displaystyle \alpha \beta \gamma \delta \epsilon \zeta \eta \theta } \iota \kappa \lambda \mu \nu \xi \omicron \pi ι κ λ μ ν ξ o π {\displaystyle \iota \kappa \lambda \mu \nu \xi \mathrm {o} \pi } \rho \sigma \tau \upsilon \phi \chi \psi \omega ρ σ τ υ ϕ χ ψ ω {\displaystyle \rho \sigma \tau \upsilon \phi \chi \psi \omega } \varGamma \varDelta \varTheta \varLambda \varXi \varPi \varSigma \varPhi \varUpsilon \varOmega Γ Δ Θ Λ Ξ Π Σ Φ Υ Ω {\displaystyle \varGamma \varDelta \varTheta \varLambda \varXi \varPi \varSigma \varPhi \varUpsilon \varOmega } \varepsilon \digamma \varkappa \varpi \varrho \varsigma \vartheta \varphi ε ϝ ϰ ϖ ϱ ς ϑ φ {\displaystyle \varepsilon \digamma \varkappa \varpi \varrho \varsigma \vartheta \varphi } Hebrew symbols \aleph \beth \gimel \daleth ℵ ℶ ℷ ℸ {\displaystyle \aleph \beth \gimel \daleth } Blackboard bold/scripts \mathbb{ABCDEFGHI} A B C D E F G H I {\displaystyle \mathbb {ABCDEFGHI} } \mathbb{JKLMNOPQR} J K L M N O P Q R {\displaystyle \mathbb {JKLMNOPQR} } \mathbb{STUVWXYZ} S T U V W X Y Z {\displaystyle \mathbb {STUVWXYZ} } Boldface \mathbf{ABCDEFGHI} A B C D E F G H I {\displaystyle \mathbf {ABCDEFGHI} } \mathbf{JKLMNOPQR} J K L M N O P Q R {\displaystyle \mathbf {JKLMNOPQR} } \mathbf{STUVWXYZ} S T U V W X Y Z {\displaystyle \mathbf {STUVWXYZ} } \mathbf{abcdefghijklm} a b c d e f g h i j k l m {\displaystyle \mathbf {abcdefghijklm} } \mathbf{nopqrstuvwxyz} n o p q r s t u v w x y z {\displaystyle \mathbf {nopqrstuvwxyz} } \mathbf{0123456789} 0123456789 {\displaystyle \mathbf {0123456789} } Boldface (Greek) \boldsymbol{\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta} A B Γ Δ E Z H Θ {\displaystyle {\boldsymbol {\mathrm {A} \mathrm {B} \Gamma \Delta \mathrm {E} \mathrm {Z} \mathrm {H} \Theta }}} \boldsymbol{\Iota \Kappa \Lambda \Mu \Nu \Xi \Omicron \Pi} I K Λ M N Ξ O Π {\displaystyle {\boldsymbol {\mathrm {I} \mathrm {K} \Lambda \mathrm {M} \mathrm {N} \Xi \mathrm {O} \Pi }}} \boldsymbol{\Rho \Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega} P Σ T Υ Φ X Ψ Ω {\displaystyle {\boldsymbol {\mathrm {P} \Sigma \mathrm {T} \Upsilon \Phi \mathrm {X} \Psi \Omega }}} \boldsymbol{\alpha \beta \gamma \delta \epsilon \zeta \eta \theta} α β γ δ ϵ ζ η θ {\displaystyle {\boldsymbol {\alpha \beta \gamma \delta \epsilon \zeta \eta \theta }}} \boldsymbol{\iota \kappa \lambda \mu \nu \xi \omicron \pi} ι κ λ μ ν ξ o π {\displaystyle {\boldsymbol {\iota \kappa \lambda \mu \nu \xi \mathrm {o} \pi }}} \boldsymbol{\rho \sigma \tau \upsilon \phi \chi \psi \omega} ρ σ τ υ ϕ χ ψ ω {\displaystyle {\boldsymbol {\rho \sigma \tau \upsilon \phi \chi \psi \omega }}} \boldsymbol{\varepsilon\digamma\varkappa\varpi} ε ϝ ϰ ϖ {\displaystyle {\boldsymbol {\varepsilon \digamma \varkappa \varpi }}} \boldsymbol{\varrho\varsigma\vartheta\varphi} ϱ ς ϑ φ {\displaystyle {\boldsymbol {\varrho \varsigma \vartheta \varphi }}} Italics (default for Latin alphabet) \mathit{0123456789} 0123456789 {\displaystyle {\mathit {0123456789}}} Greek italics (default for lowercase Greek) \mathit{\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta} A B Γ Δ E Z H Θ {\displaystyle {\mathit {\mathrm {A} \mathrm {B} \Gamma \Delta \mathrm {E} \mathrm {Z} \mathrm {H} \Theta }}} \mathit{\Iota \Kappa \Lambda \Mu \Nu \Xi \Omicron \Pi} I K Λ M N Ξ O Π {\displaystyle {\mathit {\mathrm {I} \mathrm {K} \Lambda \mathrm {M} \mathrm {N} \Xi \mathrm {O} \Pi }}} \mathit{\Rho \Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega} Σ T Υ Φ X Ψ Ω {\displaystyle {\mathit {\Sigma \mathrm {T} \Upsilon \Phi \mathrm {X} \Psi \Omega }}} Greek uppercase boldface italics \boldsymbol{\varGamma \varDelta \varTheta \varLambda} Γ Δ Θ Λ {\displaystyle {\boldsymbol {\varGamma \varDelta \varTheta \varLambda }}} \boldsymbol{\varXi \varPi \varSigma \varUpsilon \varOmega} Ξ Π Σ Υ Ω {\displaystyle {\boldsymbol {\varXi \varPi \varSigma \varUpsilon \varOmega }}} Roman typeface \mathrm{ABCDEFGHI} A B C D E F G H I {\displaystyle \mathrm {ABCDEFGHI} } \mathrm{JKLMNOPQR} J K L M N O P Q R {\displaystyle \mathrm {JKLMNOPQR} } \mathrm{STUVWXYZ} S T U V W X Y Z {\displaystyle \mathrm {STUVWXYZ} } \mathrm{abcdefghijklm} a b c d e f g h i j k l m {\displaystyle \mathrm {abcdefghijklm} } \mathrm{nopqrstuvwxyz} n o p q r s t u v w x y z {\displaystyle \mathrm {nopqrstuvwxyz} } \mathrm{0123456789} 0123456789 {\displaystyle \mathrm {0123456789} } Sans serif \mathsf{ABCDEFGHI} A B C D E F G H I {\displaystyle {\mathsf {ABCDEFGHI}}} \mathsf{JKLMNOPQR} J K L M N O P Q R {\displaystyle {\mathsf {JKLMNOPQR}}} \mathsf{STUVWXYZ} S T U V W X Y Z {\displaystyle {\mathsf {STUVWXYZ}}} \mathsf{abcdefghijklm} a b c d e f g h i j k l m {\displaystyle {\mathsf {abcdefghijklm}}} \mathsf{nopqrstuvwxyz} n o p q r s t u v w x y z {\displaystyle {\mathsf {nopqrstuvwxyz}}} \mathsf{0123456789} 0123456789 {\displaystyle {\mathsf {0123456789}}} Sans serif Greek (capital only) \mathsf{\Alpha \Beta \Gamma \Delta \Epsilon \Zeta \Eta \Theta} A B Γ Δ E Z H Θ {\displaystyle {\mathsf {\mathrm {A} \mathrm {B} \Gamma \Delta \mathrm {E} \mathrm {Z} \mathrm {H} \Theta }}} \mathsf{\Iota \Kappa \Lambda \Mu \Nu \Xi \Omicron \Pi} I K Λ M N Ξ O Π {\displaystyle {\mathsf {\mathrm {I} \mathrm {K} \Lambda \mathrm {M} \mathrm {N} \Xi \mathrm {O} \Pi }}} \mathsf{\Rho \Sigma \Tau \Upsilon \Phi \Chi \Psi \Omega} Σ T Υ Φ X Ψ Ω {\displaystyle {\mathsf {\Sigma \mathrm {T} \Upsilon \Phi \mathrm {X} \Psi \Omega }}} Calligraphy/script \mathcal{ABCDEFGHI} A B C D E F G H I {\displaystyle {\mathcal {ABCDEFGHI}}} \mathcal{JKLMNOPQR} J K L M N O P Q R {\displaystyle {\mathcal {JKLMNOPQR}}} \mathcal{STUVWXYZ} S T U V W X Y Z {\displaystyle {\mathcal {STUVWXYZ}}} \mathcal{abcdefghi} a b c d e f g h i {\displaystyle {\mathcal {abcdefghi}}} \mathcal{jklmnopqr} j k l m n o p q r {\displaystyle {\mathcal {jklmnopqr}}} \mathcal{stuvwxyz} s t u v w x y z {\displaystyle {\mathcal {stuvwxyz}}} Fraktur typeface \mathfrak{ABCDEFGHI} A B C D E F G H I {\displaystyle {\mathfrak {ABCDEFGHI}}} \mathfrak{JKLMNOPQR} J K L M N O P Q R {\displaystyle {\mathfrak {JKLMNOPQR}}} \mathfrak{STUVWXYZ} S T U V W X Y Z {\displaystyle {\mathfrak {STUVWXYZ}}} \mathfrak{abcdefghijklm} a b c d e f g h i j k l m {\displaystyle {\mathfrak {abcdefghijklm}}} \mathfrak{nopqrstuvwxyz} n o p q r s t u v w x y z {\displaystyle {\mathfrak {nopqrstuvwxyz}}} \mathfrak{0123456789} 0123456789 {\displaystyle {\mathfrak {0123456789}}} Small scriptstyle text {\scriptstyle\text{abcdefghijklm}} abcdefghijklm {\displaystyle {\scriptstyle {\text{abcdefghijklm}}}} Mixed text faces[edit] Feature Syntax How it looks rendered Italicised characters (spaces are ignored) x y z x y z {\displaystyle xyz} Non-italicised characters \text{x y z} x y z {\displaystyle {\text{x y z}}} Mixed italics (bad) \text{if} n \text{is even} if n is even {\displaystyle {\text{if}}n{\text{is even}}} Mixed italics (good) \text{if }n\text{ is even} if n is even {\displaystyle {\text{if }}n{\text{ is even}}} Mixed italics (alternative: ~ or "\ " forces a space) \text{if}~n\ \text{is even} if n is even {\displaystyle {\text{if}}~n\ {\text{is even}}} Color[edit]Equations can use color with the \color command. For example,
How it looks rendered Syntax Feature x 2 + 2 x − 1 {\displaystyle {\color {Blue}x^{2}}+{\color {Orange}2x}-{\color {LimeGreen}1}} {\color{Blue}x^2}+{\color{Orange}2x}-{\color{LimeGreen}1} x = − b ± b 2 − 4 a c 2 a {\displaystyle x={\frac {{\color {Blue}-b}\pm {\sqrt {\color {Red}b^{2}-4ac}}}{\color {Green}2a}}} x=\frac{{\color{Blue}-b}\pm\sqrt{\color{Red}b^2-4ac}}{\color{Green}2a}The \color command colors all symbols to its right. However, if the \color command is enclosed in a pair of braces (e.g. {\color{Red}...}) then no symbols outside of those braces are affected.
How it looks rendered Syntax Feature x ≠ y = z {\displaystyle x\color {red}\neq y=z} x\color{red}\neq y=zColors red everything to the right of \color{red}. To only color the ≠ {\displaystyle \neq } symbol red, place braces around \color{red}\neq or insert \color{black} to the right of \neq.
x ≠ y = z {\displaystyle x{\color {red}\neq }y=z} x{\color{red}\neq} y=z x ≠ y = z {\displaystyle x\color {red}\neq \color {black}y=z} x\color{red}\neq\color{black} y=z − b ± b 2 − 4 a c 2 a = x {\displaystyle {\frac {-b\color {Green}\pm {\sqrt {b^{2}\color {Blue}-4{\color {Red}a}c}}}{2a}}=x} \frac{-b\color{Green}\pm\sqrt{b^2\color{Blue}-4{\color{Red}a}c}}{2a}=x The outermost braces in {\color{Red}a}c limit the effect of \color{Red} to the symbol a. Similarly, \color{Blue} does not affect any symbols outside of the \sqrt{} that encloses it, and \color{Green} does not affect any symbols outside of the numerator.There are several alternate notations styles
How it looks rendered Syntax Feature x 2 + 2 x − 1 {\displaystyle {\color {Blue}x^{2}}+{\color {Orange}2x}-{\color {LimeGreen}1}} {\color{Blue}x^2}+{\color{Orange}2x}-{\color{LimeGreen}1} works with both texvc and MathJax x 2 + 2 x − 1 {\displaystyle \color {Blue}x^{2}\color {Black}+\color {Orange}2x\color {Black}-\color {LimeGreen}1} \color{Blue}x^2\color{Black}+\color{Orange}2x\color{Black}-\color{LimeGreen}1 works with both texvc and MathJax x 2 + 2 x − 1 {\displaystyle \color {Blue}{x^{2}}+\color {Orange}{2x}-\color {LimeGreen}{1}} \color{Blue}{x^2}+\color{Orange}{2x}-\color{LimeGreen}{1} only works with MathJaxSome color names are predeclared according to the following table, you can use them directly for the rendering of formulas (or for declaring the intended color of the page background).
Colors supported Apricot {\displaystyle \color {Apricot}{\text{Apricot}}} Aquamarine {\displaystyle \color {Aquamarine}{\text{Aquamarine}}} Bittersweet {\displaystyle \color {Bittersweet}{\text{Bittersweet}}} Black {\displaystyle \color {Black}{\text{Black}}} Blue {\displaystyle \color {Blue}{\text{Blue}}} BlueGreen {\displaystyle \color {BlueGreen}{\text{BlueGreen}}} BlueViolet {\displaystyle \color {BlueViolet}{\text{BlueViolet}}} BrickRed {\displaystyle \color {BrickRed}{\text{BrickRed}}} Brown {\displaystyle \color {Brown}{\text{Brown}}} BurntOrange {\displaystyle \color {BurntOrange}{\text{BurntOrange}}} CadetBlue {\displaystyle \color {CadetBlue}{\text{CadetBlue}}} CarnationPink {\displaystyle \color {CarnationPink}{\text{CarnationPink}}} Cerulean {\displaystyle \color {Cerulean}{\text{Cerulean}}} CornflowerBlue {\displaystyle \color {CornflowerBlue}{\text{CornflowerBlue}}} Cyan {\displaystyle \color {Cyan}{\text{Cyan}}} Dandelion {\displaystyle \color {Dandelion}{\text{Dandelion}}} DarkOrchid {\displaystyle \color {DarkOrchid}{\text{DarkOrchid}}} Emerald {\displaystyle \color {Emerald}{\text{Emerald}}} ForestGreen {\displaystyle \color {ForestGreen}{\text{ForestGreen}}} Fuchsia {\displaystyle \color {Fuchsia}{\text{Fuchsia}}} Goldenrod {\displaystyle \color {Goldenrod}{\text{Goldenrod}}} Gray {\displaystyle \color {white}{\text{Gray}}} Green {\displaystyle \color {Green}{\text{Green}}} GreenYellow {\displaystyle \color {GreenYellow}{\text{GreenYellow}}} JungleGreen {\displaystyle \color {JungleGreen}{\text{JungleGreen}}} Lender {\displaystyle \color {Lender}{\text{Lender}}} LimeGreen {\displaystyle \color {LimeGreen}{\text{LimeGreen}}} Magenta {\displaystyle \color {Magenta}{\text{Magenta}}} Mahogany {\displaystyle \color {Mahogany}{\text{Mahogany}}} Maroon {\displaystyle \color {Maroon}{\text{Maroon}}} Melon {\displaystyle \color {Melon}{\text{Melon}}} MidnightBlue {\displaystyle \color {MidnightBlue}{\text{MidnightBlue}}} Mulberry {\displaystyle \color {Mulberry}{\text{Mulberry}}} NyBlue {\displaystyle \color {NyBlue}{\text{NyBlue}}} OliveGreen {\displaystyle \color {OliveGreen}{\text{OliveGreen}}} Orange {\displaystyle \color {Orange}{\text{Orange}}} OrangeRed {\displaystyle \color {OrangeRed}{\text{OrangeRed}}} Orchid {\displaystyle \color {Orchid}{\text{Orchid}}} Peach {\displaystyle \color {Peach}{\text{Peach}}} Periwinkle {\displaystyle \color {Periwinkle}{\text{Periwinkle}}} PineGreen {\displaystyle \color {PineGreen}{\text{PineGreen}}} Plum {\displaystyle \color {Plum}{\text{Plum}}} ProcessBlue {\displaystyle \color {ProcessBlue}{\text{ProcessBlue}}} Purple {\displaystyle \color {Purple}{\text{Purple}}} RawSienna {\displaystyle \color {RawSienna}{\text{RawSienna}}} Red {\displaystyle \color {Red}{\text{Red}}} RedOrange {\displaystyle \color {RedOrange}{\text{RedOrange}}} RedViolet {\displaystyle \color {RedViolet}{\text{RedViolet}}} Rhodamine {\displaystyle \color {Rhodamine}{\text{Rhodamine}}} RoyalBlue {\displaystyle \color {RoyalBlue}{\text{RoyalBlue}}} RoyalPurple {\displaystyle \color {RoyalPurple}{\text{RoyalPurple}}} RubineRed {\displaystyle \color {RubineRed}{\text{RubineRed}}} Salmon {\displaystyle \color {Salmon}{\text{Salmon}}} SeaGreen {\displaystyle \color {SeaGreen}{\text{SeaGreen}}} Sepia {\displaystyle \color {Sepia}{\text{Sepia}}} SkyBlue {\displaystyle \color {SkyBlue}{\text{SkyBlue}}} SpringGreen {\displaystyle \color {SpringGreen}{\text{SpringGreen}}} Tan {\displaystyle \color {Tan}{\text{Tan}}} TealBlue {\displaystyle \color {TealBlue}{\text{TealBlue}}} Thistle {\displaystyle \color {Thistle}{\text{Thistle}}} Turquoise {\displaystyle \color {Turquoise}{\text{Turquoise}}} Violet {\displaystyle \color {Violet}{\text{Violet}}} VioletRed {\displaystyle \color {VioletRed}{\text{VioletRed}}} White {\displaystyle {\color {White}{\text{White}}}} WildStrawberry {\displaystyle \color {WildStrawberry}{\text{WildStrawberry}}} Yellow {\displaystyle \color {Yellow}{\text{Yellow}}} YellowGreen {\displaystyle \color {YellowGreen}{\text{YellowGreen}}} YellowOrange {\displaystyle \color {YellowOrange}{\text{YellowOrange}}}Color should not be used as the only way to identify something, because it will become meaningless on black-and-white media or for color-blind people. See WP:Manual of Style (accessibility)#Color.
Latex does not he a command for setting the background color. The most effective way of setting a background color is by setting a CSS styling rule for a table cell:
{| class="wikitable" align="center" | style="background-color: gray;" | x^2 | style="background-color: Goldenrod;" | y^3 |}Rendered as:
x 2 {\displaystyle x^{2}} y 3 {\displaystyle y^{3}}Custom colors can be defined using:
\definecolor{myorange}{rgb}{1,0.65,0.4}\color{myorange}e^{i \pi}\color{Black} + 1 = 0 e i π + 1 = 0 {\displaystyle \definecolor {myorange}{rgb}{1,0.65,0.4}\color {myorange}e^{i\pi }\color {Black}+1=0} Formatting issues[edit] Spacing[edit] See also: Quad (typography)TeX handles most spacing automatically, but you may sometimes want manual control.
Feature Syntax How it looks rendered double quad space a \qquad b a b {\displaystyle a\qquad b} quad space a \quad b a b {\displaystyle a\quad b} text space a\ b a b {\displaystyle a\ b} text space in text mode a \text{ } b a b {\displaystyle a{\text{ }}b} large space a\;b a b {\displaystyle a\;b} medium space a\