LaTeX math markup: Difference between revisions

From SklogWiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 10: Line 10:
|Subscript||<code>a_2</code>||<math>a_2</math>||<math>a_2 \,\!</math>
|Subscript||<code>a_2</code>||<math>a_2</math>||<math>a_2 \,\!</math>
|-
|-
|rowspan=2|Grouping||<code>a^{2+2}</code>||<math>a^{2+2}</math>||<math>a^{2+2}\,\!</math>
|rowspan=2|Grouping||<code>a^{2 2}</code>||<math>a^{2 2}</math>||<math>a^{2 2}\,\!</math>
|-
|-
|<code>a_{i,j}</code>||<math>a_{i,j}</math>||<math>a_{i,j}\,\!</math>
|<code>a_{i,j}</code>||<math>a_{i,j}</math>||<math>a_{i,j}\,\!</math>
|-
|-
|Combining sub & super||<code>x_2^3</code>||colspan=2|<math>x_2^3</math>
|Combining sub
|-
|rowspan="2"|Preceding and/or Additional sub & super||<code>\sideset{_1^2}{_3^4}\prod_a^b</code>||colspan=2|<math>\sideset{_1^2}{_3^4}\prod_a^b</math>
|-
|<code>{}_1^2\!\Omega_3^4</code>||colspan=2|<math>{}_1^2\!\Omega_3^4</math>
|-
|rowspan="4"|Stacking
|<code>\overset{\alpha}{\omega}</code>||colspan="2"|<math>\overset{\alpha}{\omega}</math>
|-
|<code>\underset{\alpha}{\omega}</code>||colspan="2"|<math>\underset{\alpha}{\omega}</math>
|-
|<code>\overset{\alpha}{\underset{\gamma}{\omega}}</code>||colspan="2"|<math>\overset{\alpha}{\underset{\gamma}{\omega}}</math>
|-
|<code>\stackrel{\alpha}{\omega}</code>||colspan="2"|<math>\stackrel{\alpha}{\omega}</math>
|-
|Derivative (forced PNG)||<code>x', y'', f', f''\!</code>||&nbsp;||<math>x', y'', f', f''\!</math>
|-
|Derivative (f in italics may overlap primes in HTML)||<code>x', y'', f', f''</code>||<math>x', y'', f', f''</math>||<math>x', y'', f', f''\!</math>
|-
|Derivative (wrong in HTML)||<code>x^\prime, y^{\prime\prime}</code>||<math>x^\prime, y^{\prime\prime}</math>||<math>x^\prime, y^{\prime\prime}\,\!</math>
|-
|Derivative (wrong in PNG)||<code>x\prime, y\prime\prime</code>||<math>x\prime, y\prime\prime</math>||<math>x\prime, y\prime\prime\,\!</math>
|-
|Derivative dots||<code>\dot{x}, \ddot{x}</code>||colspan=2|<math>\dot{x}, \ddot{x}</math>
|-
|rowspan="3"|Underlines, overlines, vectors||<code>\hat a \ \bar b \ \vec c</code>||colspan=2|<math>\hat a \ \bar b \ \vec c</math>
|-
|<code>\overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f}</code>||colspan=2|<math>\overrightarrow{a b} \ \overleftarrow{c d} \ \widehat{d e f}</math>
|-
|<code>\overline{g h i} \ \underline{j k l}</code>||colspan=2|<math>\overline{g h i} \ \underline{j k l}</math>
|-
|Arrows||<code> A \xleftarrow{n+\mu-1} B \xrightarrow[T]{n\pm i-1} C</code>||colspan=2|<math> A \xleftarrow{n+\mu-1} B \xrightarrow[T]{n\pm i-1} C</math>
|-
|Overbraces||<code>\overbrace{ 1+2+\cdots+100 }^{5050}</code>||colspan=2|<math>\overbrace{ 1+2+\cdots+100 }^{5050}</math>
|-
|Underbraces||<code>\underbrace{ a+b+\cdots+z }_{26}</code>||colspan=2|<math>\underbrace{ a+b+\cdots+z }_{26}</math>
|-
|Sum||<code>\sum_{k=1}^N k^2</code>||colspan=2|<math>\sum_{k=1}^N k^2</math>
|-
|Sum (force&nbsp;<code>\textstyle</code>)||<code>\textstyle \sum_{k=1}^N k^2 </code>||colspan=2|<math>\textstyle \sum_{k=1}^N k^2</math>
|-
|Product||<code>\prod_{i=1}^N x_i</code>||colspan=2|<math>\prod_{i=1}^N x_i</math>
|-
|Product (force&nbsp;<code>\textstyle</code>)||<code>\textstyle \prod_{i=1}^N x_i</code>||colspan=2|<math>\textstyle \prod_{i=1}^N x_i</math>
|-
|Coproduct||<code>\coprod_{i=1}^N x_i</code>||colspan=2|<math>\coprod_{i=1}^N x_i</math>
|-
|Coproduct (force&nbsp;<code>\textstyle</code>)||<code>\textstyle \coprod_{i=1}^N x_i</code>||colspan=2|<math>\textstyle \coprod_{i=1}^N x_i</math>
|-
|Limit||<code>\lim_{n \to \infty}x_n</code>||colspan=2|<math>\lim_{n \to \infty}x_n</math>
|-
|Limit (force&nbsp;<code>\textstyle</code>)||<code>\textstyle \lim_{n \to \infty}x_n</code>||colspan=2|<math>\textstyle \lim_{n \to \infty}x_n</math>
|-
|Integral||<code>\int\limits_{-N}^{N} e^x\, dx</code>||colspan=2|<math>\int\limits_{-N}^{N} e^x\, dx</math>
|-
|Integral (force&nbsp;<code>\textstyle</code>)||<code>\textstyle \int\limits_{-N}^{N} e^x\, dx</code>||colspan=2|<math>\textstyle \int\limits_{-N}^{N} e^x\, dx</math>
|-
|Double integral||<code>\iint\limits_{D} \, dx\,dy</code>||colspan=2|<math>\iint\limits_{D} \, dx\,dy</math>
|-
|Triple integral||<code>\iiint\limits_{E} \, dx\,dy\,dz</code>||colspan=2|<math>\iiint\limits_{E} \, dx\,dy\,dz</math>
|-
|Quadruple integral||<code>\iiiint\limits_{F} \, dx\,dy\,dz\,dt</code>||colspan=2|<math>\iiiint\limits_{F} \, dx\,dy\,dz\,dt</math>
|-
|Path integral||<code>\oint\limits_{C} x^3\, dx + 4y^2\, dy</code>||colspan=2|<math>\oint\limits_{C} x^3\, dx + 4y^2\, dy</math>
|-
|Intersections||<code>\bigcap_1^{n} p</code>||colspan=2|<math>\bigcap_1^{n} p</math>
|-
|Unions||<code>\bigcup_1^{k} p</code>||colspan=2|<math>\bigcup_1^{k} p</math>
|}
== Fractions, matrices, multilines ==
<table class="wikitable">
 
<tr>
<th>Feature</th>
<th>Syntax</th>
<th>How it looks rendered</th>
</tr>
 
<tr>
<td>Fractions</td>
<td><code>\frac{2}{4}=0.5</code></td>
<td><math>\frac{2}{4}=0.5</math></td>
</tr>
 
<tr>
<td>Small Fractions</td>
<td><code>\tfrac{2}{4} = 0.5</code></td>
<td><math>\tfrac{2}{4} = 0.5</math></td>
</tr>
 
<tr>
<td>Large (normal) Fractions</td>
<td><code>\dfrac{2}{4} = 0.5</code></td>
<td><math>\dfrac{2}{4} = 0.5</math></td>
</tr>
 
<tr>
<td>Large (nested) Fractions</td>
<td><code>\cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a</code></td>
<td><math>\cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} = a</math></td>
</tr>
 
<tr>
<td>Binomial coefficients</td>
<td><code>\binom{n}{k}</code></td>
<td><math>\binom{n}{k}</math></td>
</tr>
 
 
<tr>
<td>Small Binomial coefficients</td>
<td><code>\tbinom{n}{k}</code></td>
<td><math>\tbinom{n}{k}</math></td>
</tr>
 
 
<tr>
<td>Large (normal) Binomial coefficients</td>
<td><code>\dbinom{n}{k}</code></td>
<td><math>\dbinom{n}{k}</math></td>
</tr>
 
<tr>
<td rowspan="7">Matrices</td>
<td><pre>\begin{matrix}
  x & y \\
  z & v
\end{matrix}</pre></td>
<td><math>\begin{matrix} x & y \\ z & v
\end{matrix}</math></td>
</tr>
 
<tr>
<td><pre>\begin{vmatrix}
  x & y \\
  z & v
\end{vmatrix}</pre></td>
<td><math>\begin{vmatrix} x & y \\ z & v
\end{vmatrix}</math></td>
</tr>
 
<tr>
<td><pre>\begin{Vmatrix}
  x & y \\
  z & v
\end{Vmatrix}</pre></td>
<td><math>\begin{Vmatrix} x & y \\ z & v
\end{Vmatrix}</math></td>
</tr>
 
<tr>
<td><pre>\begin{bmatrix}
  0      & \cdots & 0      \\
  \vdots & \ddots & \vdots \\
  0      & \cdots & 0
\end{bmatrix}</pre></td>
<td><math>\begin{bmatrix} 0 & \cdots & 0 \\ \vdots
& \ddots & \vdots \\ 0 & \cdots &
0\end{bmatrix} </math></td>
</tr>
 
<tr>
<td><pre>\begin{Bmatrix}
  x & y \\
  z & v
\end{Bmatrix}</pre></td>
<td><math>\begin{Bmatrix} x & y \\ z & v
\end{Bmatrix}</math></td>
</tr>
 
<tr>
<td><pre>\begin{pmatrix}
  x & y \\
  z & v
\end{pmatrix}</pre></td>
<td><math>\begin{pmatrix} x & y \\ z & v
\end{pmatrix}</math></td>
</tr>
 
<tr>
<td><pre>
\bigl( \begin{smallmatrix}
  a&b\\ c&d
\end{smallmatrix} \bigr)
</pre></td>
<td><math>
\bigl( \begin{smallmatrix}
  a&b\\ c&d
\end{smallmatrix} \bigr)
</math></td>
</tr>
 
 
 
<tr>
<td>Case distinctions</td>
<td><pre>
f(n) =
\begin{cases}
  n/2,  & \mbox{if }n\mbox{ is even} \\
  3n+1, & \mbox{if }n\mbox{ is odd}
\end{cases}</pre></td>
<td><math>f(n) =
\begin{cases}
  n/2,  & \mbox{if }n\mbox{ is even} \\
  3n+1, & \mbox{if }n\mbox{ is odd}
\end{cases} </math></td>
</tr>
 
<tr>
<td rowspan="2">Multiline equations</td>
<td><pre>
\begin{align}
f(x) & = (a+b)^2 \\
      & = a^2+2ab+b^2 \\
\end{align}
</pre></td>
<td><math>
\begin{align}
f(x) & = (a+b)^2 \\
      & = a^2+2ab+b^2 \\
\end{align}
</math></td>
</tr>
 
<tr>
<td><pre>
\begin{alignat}{2}
f(x) & = (a-b)^2 \\
      & = a^2-2ab+b^2 \\
\end{alignat}
</pre></td>
<td><math>
\begin{alignat}{2}
f(x) & = (a-b)^2 \\
      & = a^2-2ab+b^2 \\
\end{alignat}
</math></td>
</tr>
<tr>
<td>Multiline equations <small>(must define number of colums used ({lcr}) <small>(should not be used unless needed)</small></small></td>
<td><pre>
\begin{array}{lcl}
  z        & = & a \\
  f(x,y,z) & = & x + y + z 
\end{array}</pre></td>
<td><math>\begin{array}{lcl}
  z        & = & a \\
  f(x,y,z) & = & x + y + z 
\end{array}</math></td>
</tr>
 
<tr>
<td>Multiline equations (more)</td>
<td><pre>
\begin{array}{lcr}
  z        & = & a \\
  f(x,y,z) & = & x + y + z   
\end{array}</pre></td>
<td><math>\begin{array}{lcr}
  z        & = & a \\
  f(x,y,z) & = & x + y + z   
\end{array}</math></td>
</tr>
 
<tr>
<td>Breaking up a long expression so that it wraps when necessary</td>
<td><pre>
<nowiki>
<math>f(x) \,\!</math>
<math>= \sum_{n=0}^\infty a_n x^n </math>
<math>= a_0+a_1x+a_2x^2+\cdots</math>
</nowiki>
</pre>
</td>
<td>
<math>f(x) \,\!</math><math>= \sum_{n=0}^\infty a_n x^n </math><math>= a_0 +a_1x+a_2x^2+\cdots</math>
</td>
</tr>
 
<tr>
<td>Simultaneous equations</td>
<td><pre>\begin{cases}
    3x + 5y +  z \\
    7x - 2y + 4z \\
  -6x + 3y + 2z
\end{cases}</pre></td>
<td><math>\begin{cases} 3x + 5y + z \\ 7x - 2y + 4z \\ -6x + 3y + 2z \end{cases}</math></td>
</tr>
 
</table>
[[category: help]]

Revision as of 12:45, 4 July 2007

Subscripts, superscripts, integrals

Feature Syntax How it looks rendered
HTML PNG
Superscript a^2
Subscript a_2
Grouping a^{2 2}
a_{i,j}
Combining sub