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 a 2 {\displaystyle a^{2}} {\displaystyle a^{2}} a 2 {\displaystyle a^{2},円\!} {\displaystyle a^{2},円\!}
Subscript a_2 a 2 {\displaystyle a_{2}} {\displaystyle a_{2}} a 2 {\displaystyle a_{2},円\!} {\displaystyle a_{2},円\!}
Grouping a^{2+2} a 2 + 2 {\displaystyle a^{2+2}} {\displaystyle a^{2+2}} a 2 + 2 {\displaystyle a^{2+2},円\!} {\displaystyle a^{2+2},円\!}
a_{i,j} a i , j {\displaystyle a_{i,j}} {\displaystyle a_{i,j}} a i , j {\displaystyle a_{i,j},円\!} {\displaystyle a_{i,j},円\!}
Combining sub & super x_2^3 x 2 3 {\displaystyle x_{2}^{3}} {\displaystyle x_{2}^{3}}
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}} {\displaystyle \sideset {_{1}^{2}}{_{3}^{4}}\prod _{a}^{b}}
{}_1^2\!\Omega_3^4 1 2 Ω 3 4 {\displaystyle {}_{1}^{2}\!\Omega _{3}^{4}} {\displaystyle {}_{1}^{2}\!\Omega _{3}^{4}}
Stacking \overset{\alpha}{\omega} ω α {\displaystyle {\overset {\alpha }{\omega }}} {\displaystyle {\overset {\alpha }{\omega }}}
\underset{\alpha}{\omega} ω α {\displaystyle {\underset {\alpha }{\omega }}} {\displaystyle {\underset {\alpha }{\omega }}}
\overset{\alpha}{\underset{\gamma}{\omega}} ω γ α {\displaystyle {\overset {\alpha }{\underset {\gamma }{\omega }}}} {\displaystyle {\overset {\alpha }{\underset {\gamma }{\omega }}}}
\stackrel{\alpha}{\omega} ω α {\displaystyle {\stackrel {\alpha }{\omega }}} {\displaystyle {\stackrel {\alpha }{\omega }}}
Derivative (forced PNG) x', y, f', f\!   x , y , f , f {\displaystyle x',y'',f',f''\!} {\displaystyle x',y'',f',f''\!}
Derivative (f in italics may overlap primes in HTML) x', y, f', f x , y , f , f {\displaystyle x',y'',f',f''} {\displaystyle x',y'',f',f''} x , y , f , f {\displaystyle x',y'',f',f''\!} {\displaystyle x',y'',f',f''\!}
Derivative (wrong in HTML) x^\prime, y^{\prime\prime} x , y {\displaystyle x^{\prime },y^{\prime \prime }} {\displaystyle x^{\prime },y^{\prime \prime }} x , y {\displaystyle x^{\prime },y^{\prime \prime },円\!} {\displaystyle x^{\prime },y^{\prime \prime },円\!}
Derivative (wrong in PNG) x\prime, y\prime\prime x , y {\displaystyle x\prime ,y\prime \prime } {\displaystyle x\prime ,y\prime \prime } x , y {\displaystyle x\prime ,y\prime \prime ,円\!} {\displaystyle x\prime ,y\prime \prime ,円\!}
Derivative dots \dot{x}, \ddot{x} x ˙ , x ¨ {\displaystyle {\dot {x}},{\ddot {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}}} {\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}}} {\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}}} {\displaystyle {\overline {ghi}}\ {\underline {jkl}}}
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} {\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}} {\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}} {\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}} {\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}} {\displaystyle \textstyle \sum _{k=1}^{N}k^{2}}
Product \prod_{i=1}^N x_i i = 1 N x i {\displaystyle \prod _{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}} {\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}} {\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}} {\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}} {\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}} {\displaystyle \textstyle \lim _{n\to \infty }x_{n}}
Integral \int\limits_{-N}^{N} e^x,円 dx N N e x d x {\displaystyle \int \limits _{-N}^{N}e^{x},円dx} {\displaystyle \int \limits _{-N}^{N}e^{x},円dx}
Integral (force \textstyle) \textstyle \int\limits_{-N}^{N} e^x,円 dx N N e x d x {\displaystyle \textstyle \int \limits _{-N}^{N}e^{x},円dx} {\displaystyle \textstyle \int \limits _{-N}^{N}e^{x},円dx}
Double integral \iint\limits_{D} ,円 dx,円dy D d x d y {\displaystyle \iint \limits _{D},円dx,円dy} {\displaystyle \iint \limits _{D},円dx,円dy}
Triple integral \iiint\limits_{E} ,円 dx,円dy,円dz E d x d y d z {\displaystyle \iiint \limits _{E},円dx,円dy,円dz} {\displaystyle \iiint \limits _{E},円dx,円dy,円dz}
Quadruple integral \iiiint\limits_{F} ,円 dx,円dy,円dz,円dt F d x d y d z d t {\displaystyle \iiiint \limits _{F},円dx,円dy,円dz,円dt} {\displaystyle \iiiint \limits _{F},円dx,円dy,円dz,円dt}
Path integral \oint\limits_{C} x^3,円 dx + 4y^2,円 dy C x 3 d x + 4 y 2 d y {\displaystyle \oint \limits _{C}x^{3},円dx+4y^{2},円dy} {\displaystyle \oint \limits _{C}x^{3},円dx+4y^{2},円dy}
Intersections \bigcap_1^{n} p 1 n p {\displaystyle \bigcap _{1}^{n}p} {\displaystyle \bigcap _{1}^{n}p}
Unions \bigcup_1^{k} p 1 k p {\displaystyle \bigcup _{1}^{k}p} {\displaystyle \bigcup _{1}^{k}p}

Fractions, matrices, multilines[edit ]

Feature Syntax How it looks rendered
Fractions \frac{2}{4}=0.5 2 4 = 0.5 {\displaystyle {\frac {2}{4}}=0.5} {\displaystyle {\frac {2}{4}}=0.5}
Small Fractions \tfrac{2}{4} = 0.5 2 4 = 0.5 {\displaystyle {\tfrac {2}{4}}=0.5} {\displaystyle {\tfrac {2}{4}}=0.5}
Large (normal) Fractions \dfrac{2}{4} = 0.5 2 4 = 0.5 {\displaystyle {\dfrac {2}{4}}=0.5} {\displaystyle {\dfrac {2}{4}}=0.5}
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} {\displaystyle {\cfrac {2}{c+{\cfrac {2}{d+{\cfrac {2}{4}}}}}}=a}
Binomial coefficients \binom{n}{k} ( n k ) {\displaystyle {\binom {n}{k}}} {\displaystyle {\binom {n}{k}}}
Small Binomial coefficients \tbinom{n}{k} ( n k ) {\displaystyle {\tbinom {n}{k}}} {\displaystyle {\tbinom {n}{k}}}
Large (normal) Binomial coefficients \dbinom{n}{k} ( n k ) {\displaystyle {\dbinom {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}}} {\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}}} {\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}}} {\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}}} {\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}}} {\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}}} {\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 )}} {\displaystyle {\bigl (}{\begin{smallmatrix}a&b\\c&d\end{smallmatrix}}{\bigr )}}
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 , if  n  is even 3 n + 1 , if  n  is odd {\displaystyle f(n)={\begin{cases}n/2,&{\mbox{if }}n{\mbox{ is even}}\3円n+1,&{\mbox{if }}n{\mbox{ is odd}}\end{cases}}} {\displaystyle f(n)={\begin{cases}n/2,&{\mbox{if }}n{\mbox{ is even}}\3円n+1,&{\mbox{if }}n{\mbox{ is odd}}\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}}} {\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}}} {\displaystyle {\begin{alignedat}{2}f(x)&=(a-b)^{2}\\&=a^{2}-2ab+b^{2}\\\end{alignedat}}}
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 = a f ( x , y , z ) = x + y + z {\displaystyle {\begin{array}{lcl}z&=&a\\f(x,y,z)&=&x+y+z\end{array}}} {\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}}} {\displaystyle {\begin{array}{lcr}z&=&a\\f(x,y,z)&=&x+y+z\end{array}}}
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 ) {\displaystyle f(x),円\!} {\displaystyle f(x),円\!} = n = 0 a n x n {\displaystyle =\sum _{n=0}^{\infty }a_{n}x^{n}} {\displaystyle =\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 } {\displaystyle =a_{0}+a_{1}x+a_{2}x^{2}+\cdots }

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\7円x-2y+4z\\-6x+3y+2z\end{cases}}} {\displaystyle {\begin{cases}3x+5y+z\7円x-2y+4z\\-6x+3y+2z\end{cases}}}
Retrieved from "http://www.sklogwiki.org/SklogWiki/index.php?title=LaTeX_math_markup&oldid=12059"