User:Cokolwiek123/math

From Wikipedia, the free encyclopedia

[edit] Tex on wikipedia

you type you get
<math>a^{c+2}</math>
now the text is displayed as html
ac + 2
<math>a^{c+2}\,\!</math>
but we can force to use png instead
a^{c+2}\,\!
but when formula is more complicated, it cant be shown as html
<math>f(n) = 
\begin{cases} 
  n/2,  & \mbox{if }n\mbox{ is even} \\
  3n+1, & \mbox{if }n\mbox{ is odd} 
\end{cases}

f(n) = \begin{cases} 
  n/2,  & \mbox{if }n\mbox{ is even} \\
  3n+1, & \mbox{if }n\mbox{ is odd} 
\end{cases}

list of all possible tex commands can be found here


  • for example we can create boolean formulas, like shown below
you type you get
p \lor \bar{q} \to p p \lor \bar{q} \to p
  • we can use different matrixes
you type you get
<math>\begin{matrix}
  x & \cdots & y \\
  \vdots & \ddots & \vdots \\
  z & \cdots & v 
\end{matrix}
</math>
\begin{matrix}
  x & \cdots & y \\
  \vdots & \ddots & \vdots \\
  z & \cdots & v 
\end{matrix}
<math>\begin{vmatrix}
  x & \cdots & y \\
  \vdots & \ddots & \vdots \\
  z & \cdots & v 
\end{vmatrix}</math>
\begin{vmatrix}
  x & \cdots & y \\
  \vdots & \ddots & \vdots \\
  z & \cdots & v 
\end{vmatrix}


  • fractions:
you type you get
<math>\frac{2}{c + \frac{2}{d + \frac{2}{4}}} = a</math> \frac{2}{c + \frac{2}{d + \frac{2}{4}}} = a
<math>\cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a</math> \cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a


  • bracers:
you type you get
<math> ( \frac{1}{2} )</math>  ( \frac{1}{2} )
<math>\left ( \frac{1}{2} \right )</math> \left ( \frac{1}{2} \right )
  • over and underbracers:
you type you get
<math>\overbrace{ 1+2+\cdots+100 }^{5050}</math> \overbrace{ 1+2+\cdots+100 }^{5050}
<math>\underbrace{ a+b+\cdots+z }_{26}</math> \underbrace{ a+b+\cdots+z }_{26}