LaTeX math markup

From SklogWiki
Jump to navigation Jump to search

Note: this page is a subsection of the Wikipedia page Help:Displaying a formula.

Subscripts, superscripts, integrals[edit]

Feature Syntax How it looks rendered
HTML PNG
Superscript a^2 a2 a2
Subscript a_2 a2 a2
Grouping a^{2+2} a2+2 a2+2
a_{i,j} ai,j ai,j
Combining sub & super x_2^3 x23
Preceding and/or Additional sub & super \sideset{_1^2}{_3^4}\prod_a^b ∏3412ab
{}_1^2\!\Omega_3^4 12Ω34
Stacking \overset{\alpha}{\omega} ωα
\underset{\alpha}{\omega} ωα
\overset{\alpha}{\underset{\gamma}{\omega}} ωγα
\stackrel{\alpha}{\omega} ωα
Derivative (forced PNG) x', y, f', f\!   x′,y″,f′,f″
Derivative (f in italics may overlap primes in HTML) x', y, f', f x′,y″,f′,f″ x′,y″,f′,f″
Derivative (wrong in HTML) x^\prime, y^{\prime\prime} x′,y′′ x′,y′′
Derivative (wrong in PNG) x\prime, y\prime\prime x′,y′′ x′,y′′
Derivative dots \dot{x}, \ddot{x} x˙,x¨
Underlines, overlines, vectors \hat a \ \bar b \ \vec c a^b¯c→
\overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f} ab→cd←def^
\overline{g h i} \ \underline{j k l} ghi¯jkl_
Arrows A \xleftarrow{n+\mu-1} B \xrightarrow[T]{n\pm i-1} C A←n+μ−1B→Tn±i−1C
Overbraces \overbrace{ 1+2+\cdots+100 }^{5050} 1+2+⋯+100⏞5050
Underbraces \underbrace{ a+b+\cdots+z }_{26} a+b+⋯+z⏟26
Sum \sum_{k=1}^N k^2 ∑k=1Nk2
Sum (force \textstyle) \textstyle \sum_{k=1}^N k^2 ∑k=1Nk2
Product \prod_{i=1}^N x_i ∏i=1Nxi
Product (force \textstyle) \textstyle \prod_{i=1}^N x_i ∏i=1Nxi
Coproduct \coprod_{i=1}^N x_i ∐i=1Nxi
Coproduct (force \textstyle) \textstyle \coprod_{i=1}^N x_i ∐i=1Nxi
Limit \lim_{n \to \infty}x_n limn→∞xn
Limit (force \textstyle) \textstyle \lim_{n \to \infty}x_n limn→∞xn
Integral \int\limits_{-N}^{N} e^x\, dx ∫−NNexdx
Integral (force \textstyle) \textstyle \int\limits_{-N}^{N} e^x\, dx ∫−NNexdx
Double integral \iint\limits_{D} \, dx\,dy ∬Ddxdy
Triple integral \iiint\limits_{E} \, dx\,dy\,dz ∭Edxdydz
Quadruple integral \iiiint\limits_{F} \, dx\,dy\,dz\,dt ⨌Fdxdydzdt
Path integral \oint\limits_{C} x^3\, dx + 4y^2\, dy ∮Cx3dx+4y2dy
Intersections \bigcap_1^{n} p ⋂1np
Unions \bigcup_1^{k} p ⋃1kp

Fractions, matrices, multilines[edit]

Feature Syntax How it looks rendered
Fractions \frac{2}{4}=0.5 24=0.5
Small Fractions \tfrac{2}{4} = 0.5 24=0.5
Large (normal) Fractions \dfrac{2}{4} = 0.5 24=0.5
Large (nested) Fractions \cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a 2c+2d+24=a
Binomial coefficients \binom{n}{k} (nk)
Small Binomial coefficients \tbinom{n}{k} (nk)
Large (normal) Binomial coefficients \dbinom{n}{k} (nk)
Matrices
\begin{matrix}
  x & y \\
  z & v 
\end{matrix}
xyzv
\begin{vmatrix}
  x & y \\
  z & v 
\end{vmatrix}
|xyzv|
\begin{Vmatrix}
  x & y \\
  z & v
\end{Vmatrix}
‖xyzv‖
\begin{bmatrix}
  0      & \cdots & 0      \\
  \vdots & \ddots & \vdots \\ 
  0      & \cdots & 0
\end{bmatrix}
[0⋯0⋮⋱⋮0⋯0]
\begin{Bmatrix}
  x & y \\
  z & v
\end{Bmatrix}
{xyzv}
\begin{pmatrix}
  x & y \\
  z & v 
\end{pmatrix}
(xyzv)
\bigl( \begin{smallmatrix}
  a&b\\ c&d
\end{smallmatrix} \bigr)
(abcd)
Case distinctions
f(n) = 
\begin{cases} 
  n/2,  & \mbox{if }n\mbox{ is even} \\
  3n+1, & \mbox{if }n\mbox{ is odd} 
\end{cases}
f(n)={n/2,n is even3n+1,n is odd
Multiline equations
\begin{align}
 f(x) & = (a+b)^2 \\
      & = a^2+2ab+b^2 \\
\end{align}
f(x)=(a+b)2=a2+2ab+b2
\begin{alignat}{2}
 f(x) & = (a-b)^2 \\
      & = a^2-2ab+b^2 \\
\end{alignat}
f(x)=(a−b)2=a2−2ab+b2
Multiline equations (must define number of colums used ({lcr}) (should not be used unless needed)
\begin{array}{lcl}
  z        & = & a \\
  f(x,y,z) & = & x + y + z  
\end{array}
z=af(x,y,z)=x+y+z
Multiline equations (more)
\begin{array}{lcr}
  z        & = & a \\
  f(x,y,z) & = & x + y + z     
\end{array}
z=af(x,y,z)=x+y+z
Breaking up a long expression so that it wraps when necessary

<math>f(x) \,\!</math>
<math>= \sum_{n=0}^\infty a_n x^n </math>
<math>= a_0+a_1x+a_2x^2+\cdots</math>

f(x)=∑n=0∞anxn=a0+a1x+a2x2+⋯

Simultaneous equations
\begin{cases}
    3x + 5y +  z \\
    7x - 2y + 4z \\
   -6x + 3y + 2z 
\end{cases}
{3x+5y+z7x−2y+4z−6x+3y+2z