Basics
- For inline formulas, enclose the formula in
$...$
. For displayed formulas, use$$...$$
.
These render differently. For example, type$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$
to show $\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$ (which is inline mode) or type$$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$
to show
(which is display mode).
-
For Greek letters, use
\alpha
,\beta
, …,\omega
: $\alpha, \beta, \ldots, \omega$ . For uppercase, use\Gamma
,\Delta
, …,\Omega
: $\Gamma, \Delta, \ldots, \Omega$ . Some Greek letters have variant forms:\epsilon
\varepsilon
$\epsilon, \varepsilon$ ,\phi
\varphi
$\phi, \varphi$ , and others. -
For superscripts and subscripts, use
^
and_
. For example,x_i^2
: $x_i^2$ ,\log_2 x
: $\log_2 x$ . -
Groups. Superscripts, subscripts, and other operations apply only to the next “group”. A “group” is either a single symbol, or any formula surrounded by curly braces
{
…}
. If you do10^10
, you will get a surprise: $10^10$ . But10^{10}
gives what you probably wanted: $10^{10}$ . Use curly braces to delimit a formula to which a superscript or subscript applies:x^5^6
is an error;{x^y}^z
is ${x^y}^z$, andx^{y^z}
is $x^{y^z}$ . Observe the difference betweenx_i^2
$x_i^2$ andx_{i^2}
$x_{i^2}$. -
Parentheses Ordinary symbols
()[]
make parentheses and brackets $(2+3)[4+4]$. Use\{
and\}
for curly braces ${}$.
These do bot scale with the formula in between, so if you write(\frac{\sqrt x}{y^3})
the parentheses will be too small: $(\frac{\sqrt x}{y^3})$ . Using\left(
…\right)
will make the sizes adjust automatically to the formula they enclose:\left(\frac{\sqrt x}{y^3}\right)
is $\left(\frac{\sqrt x}{y^3}\right)$ .
\left
and\right
apply to all the following sorts of parentheses:(
and)
$\left( x \right)$ ,[
and]
$\left[ x \right]$ ,\{
and\}
$\left\lbrace x \right\rbrace$ ,|
$\left| x \right|$ ,\vert
$\left\vert x \right\vert$ ,\Vert
$\left\Vert x \right\Vert$ ,\langle
and\rangle
$\left\langle x \right\rangle$ ,\lceil
and\rceil
$\left\lceil x \right\rceil$ , and\lfloor
and\rfloor
$\left\lfloor x \right\rfloor$ .\middle
can be used to add additional dividers. There are also invisible parentheses, denoted by.
:\left.\frac12\right\rbrace
is $\left.\frac12\right\rbrace$ .
If manual size adjustment are required:\Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr)
gives $\Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr)$ . -
Sums and integrals
\sum
and\int
; the subscript is the lower limit and the superscript is the upper limit, so for example\sum_1^n
$\sum_1^n$ . Don’t forget{
…}
if the limits are more than a single symbol. For example,\sum_{i=0}^\infty i^2
is $\sum_{i=0}^\infty i^2$ . Similarly,\prod
$\prod$ ,\int
$\int$ ,\bigcup
$\bigcup$ ,\bigcap
$\bigcap$,\iint
$\iint$,\iiint
$\iiint$,\idotsint
$\idotsint$. -
Fractions There are three ways to make these.
\frac ab
applies to the next two groups, and produces $\frac ab$ ; for more complicated numerators and denominators use{
…}
:\frac{a+1}{b+1}
is $\frac{a+1}{b+1}$ . If the numerator and denominator are complicated, you may prefer\over
, which splits up the group that it is in:{a+1\over b+1}
is ${a+1\over b+1}$ . Using\cfrac{a}{b}
command is useful for continued fractions $\cfrac{a}{b}$. - Fonts
- Use
mathbb
orBbb
for “blackboard bold”: $\mathbb{ABCDEFGHIJK}$ , $\mathbb{abcdefghijk}$ . - Use
mathbf
for boldface: $\mathbf{ABCDEFGHIJK}$,$\mathbf{abcdefghijk}$- For expression based characters, use
\boldsymbol
instead: $\boldsymbol \alpha$ .
- For expression based characters, use
- Use
\mathit
for italics: $\mathit{ABCDEFGHIJK}$, $\mathit{abcdefghijk}$ . - Use
\pmb
for boldfaces italics: $\pmb{ABCDEFGHIJK}$, $\pmb{abcdefghijk}$ . - Use
\mathtt
for “typewriter” font: $\mathtt{ABCDEFGHIJK}$, $\mathtt{abcdefghijk}$ . - Use
\mathrm
for roman font: $\mathrm{ABCDEFGHIJK}$ , $\mathrm{abcdefghijk}$ . - Use
\mathsf
for sans-serif font: $\mathsf{ABCDEFGHIJK}$ , $\mathsf{abcdefghijk}$ . - Use
\mathcal
for “calligraphic” letters: $\mathcal{ABCDEFGHIJK}$ , $\mathcal{abcdefghijk}$ . - Use
\mathscr
for script letters: $\mathscr{ABCDEFGHIJK}$ , $\mathscr{abcdefghijk}$ . - Use
\mathfrak
for “Fraktur” (old German style) letters: $\mathfrak{ABCDEFGHIJK}$ , $\mathfrak{abcdefghijk}$ .
- Use
-
Radical signs / roots Use
\sqrt
, which adjusts to the size of its argument:\sqrt{x^3}
$\sqrt{x^3}$ ;\sqrt[3]{\frac xy}
$\sqrt[3]{\frac xy}$ . For complicated expressions, consider using{...}^{1/2}
instead. - Some special functions such as “lim”, “sin”, “max”, “ln”, and so on are normally set in roman font instead of italic font. Use
\lim
,\sin
, etc. to make these:\sin x
$\sin x$, notsin x
$sin x$. Use subscripts to attach a notation to\lim
:\lim_{x\to 0}
Nonstandard function names can be set with \operatorname{foo}(x)
$\operatorname{foo}(x)$ .
- There are a very large number of special symbols and notations, too many to list here; see this shorter listing, or this exhaustive listing. Some of the most common include:
\lt \gt \le \leq \leqq \leqslant \ge \geq \geqq \geqslant \neq
$\lt, \gt, \le, \leq, \leqq, \leqslant, \ge, \geq, \geqq, \geqslant, \neq$ . You can use\not
to put a slash through almost anything:\not\lt
$\not\lt$ but it often looks bad.\times \div \pm \mp
$\times, \div, \pm, \mp$ .\cdot
is a centered dot: $x \cdot y$\cup \cap \setminus \subset \subseteq \subsetneq \supset \in \notin \emptyset \varnothing
$\cup, \cap, \setminus, \subset, \subseteq, \subsetneq, \supset, \in, \notin, \emptyset, \varnothing ${n+1 \choose 2k}
or\binom{n+1}{2k}
$\binom{n+1}{2k}$\to \rightarrow \leftarrow \Rightarrow \Leftarrow \mapsto
$\to, \rightarrow, \leftarrow, \Rightarrow, \Leftarrow, \mapsto$\land \lor \lnot \forall \exists \top \bot \vdash \vDash
$\land, \lor, \lnot, \forall, \exists, \top, \bot, \vdash, \vDash$\star \ast \oplus \circ \bullet
$\star, \ast, \oplus, \circ, \bullet$\approx \sim \simeq \cong \equiv \prec \lhd \therefore
$\approx, \sim, \simeq, \cong, \equiv, \prec, \lhd, \therefore$\infty \aleph_0
$\infty \aleph_0$ ,\nabla \partial
$\nabla \partial$ ,\Im \Re
$\Im \Re$- For modular equivalence, use
\pmod
like this:a\equiv b\pmod n
$a\equiv b\pmod n$ . - For the binary mod operator, use
\bmod
like this: `a\bmod 17$. \ldots
in the dots in $a_1, a_2, \ldots, a_n$\cdots
in the dots in $a_1 + a_2 + \cdots + a_n$- Script lowercase l is
\ell
$\ell$ .
Detexify lets you draw a symbol on a web page and then lists the $\TeX$ symbols that seem to resemble it. These are not guaranteed to work in MathJax but are a good place to start. To check that a command is supported, note that MathJax.org maintains a list of currently supported $\LaTeX$ commands, and one can also check Dr. Carol JVF Burns’s page of $\TeX$ Commands Available in MathJax.
-
Spaces MathJax usually decides for itself how to space formulas, using a complex set of rules. Putting extra literal spaces into formulas will not change the amount of space MathJax puts in:
a␣b
anda␣␣␣␣b
are both $ab$. To add more space, use\,
for a thin space $a\,b$;\;
for a wider space $a \; b$.\quad
and\qquad
are large spaces: $a \quad b$ , $a \qquad b$ .To set plain text, use
\text{…}
: $\lbrace x \in s \; | \; x \text{ is extra large}\rbrace$ . You can nest$…$
inside of\text{…}
, for example to access spaces. -
Accents and diacritical marks Use
\hat
for a single symbol $\hat x$ ,\widehat
for a larger formula $\widehat{xy}$ . If you make it too wide, it will look silly. Similarly, there are\bar
$\bar x$ and\overline
$\overline{xyz}$ , and\vec
$\vec x$ and\overrightarrow
$\overrightarrow{xy}$ and\overleftrightarrow
$\overleftrightarrow{xy}$ . For dots, as in $\frac{d}{dx}x\dot x = {\dot x}^2 + x\dot x$ , use\dot
and\ddot
- Special characters used for MathJax interpreting can be escaped using the
\
character:\\\$
$\$$ ,\{
$\lbrace$ ,\\_
$\_$ , etc. If you want\
itself, you should use\backslash
(symbol) or\setminus
(binary operation) for $\backslash$ , because\\
is for a new line.
Tutorial ends here. And for more derail see Contents below.
Contents
Alphabetical list of links to To MathJax Topics, by title:
- Absolute values and norms • Additional symbolic decorations • Aligning Equations
- Alternative Ways of Writing in LaTeX • Annotations of reasoning • Arbitrary operators
- Arrays • Big braces • Colors
- Commutative diagrams • Continued fractions • Crossing things out
- Definitions by cases (piecewise functions) • Degree symbol • Display style
- Equation numbering • Fussy spacing issues • Highlighting expressions
- Left and right arrows • Limits • Linear programming
- Long division • Math Programming • Matrices
- Markov Chains • Mixing code and MathJax formatting on lines • The
\newcommand
function - Numbering Equations • Overlaying Symbols • Packs of cards
- Symbols • System of equations • Tables
- Tags and references • Tensor indices • Units
- Vertical spacing
Matrix
- Use
$$\begin{matrix}…\end{matrix}$$
In between the\begin
and\end
, put the matrix elements. End each matrix row with\\
, and separate matrix elements with&
. For example,1 2 3 4 5 6 7
$$ \begin{matrix} 1 & x & x^2 \\ 1 & y & y^2 \\ 1 & z & z^2 \\ \end{matrix} $$
produces:
MathJax will adjust the sizes of the rows and columns so that everything fits.
- To add brackets, either use
\left…\right
, or replacematrix
withpmatrix
\(\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}\) ,bmatrix
\(\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}\) ,Bmatrix
\(\begin{Bmatrix} 1 & 2 \\ 3 & 4 \end{Bmatrix}\) ,vmatrix
\(\begin{vmatrix} 1 & 2 \\ 3 & 4 \end{vmatrix}\) ,Vmatrix
\(\begin{Vmatrix} 1 & 2 \\ 3 & 4 \end{Vmatrix}\). - Use
\cdots
$\cdots$\ddots
$\ddots$\vdots
$\vdots$ when you want to omit some of the entries:
- For horizontally “augmented” matrices, put parentheses or brackets around a suitably-formatted table; see Arrays below for details. Here is an example:
is produced by:
1
2
3
4
5
6
$$ \left[
\begin{array}{cc|c}
1&2&3\\
4&5&6
\end{array}
\right] $$
The cc|c
is the crucial part here; it says that there are three centered columns with a vertical bar between the second and third.
- For vertically “augmented” matrices, use
\hline
. For example
is produced by:
1
2
3
4
5
6
7
8
9
$$
\begin{pmatrix}
a & b\\
c & d\\
\hline
1 & 0\\
0 & 1
\end{pmatrix}
$$
- For small inline matrices use
\bigl(\begin{smallmatrix} ... \end{smallmatrix}\bigr)
, e.g. \(\bigl( \begin{smallmatrix} a & b \\ c & d \end{smallmatrix} \bigr)\) is produced by:1
$$\bigl( \begin{smallmatrix} a & b \\ c & d \end{smallmatrix} \bigr)$$
Symbols
In general, you have to search in long tables about a specific symbol you’re looking for, things like $\Psi, \delta, \zeta, \geq, \subseteq$ … And it turns out that this operation can be frustrating and time consuming, which can cause the buddy to abandon writing the complete $\LaTeX$ sentence in his answer, or in some cases, the complete answer itself.
That’s why the tool that I will present you in this post was conceived. Basically, it is a $\LaTeX$ handwritten symbol recognition. Example in image:
Here is the website: Detexify No more frustration.
Aligned equations
Often people want a series of equations where the equals signs are aligned. To get this, use \begin{align}…\end{align}
. Each line should end with \\
, and should contain an ampersand at the point to align at, typically immediately before the equals sign.
For example:
\[\begin{align} \sqrt{37} & = \sqrt{\frac{73^2-1}{12^2}} \\ & = \sqrt{\frac{73^2}{12^2}\cdot\frac{73^2-1}{73^2}} \\ & = \sqrt{\frac{73^2}{12^2}}\sqrt{\frac{73^2-1}{73^2}} \\ & = \frac{73}{12}\sqrt{1 - \frac{1}{73^2}} \\ & \approx \frac{73}{12}\left(1 - \frac{1}{2\cdot73^2}\right) \end{align}\]is produced by
1
2
3
4
5
6
7
\begin{align}
\sqrt{37} & = \sqrt{\frac{73^2-1}{12^2}} \\
& = \sqrt{\frac{73^2}{12^2}\cdot\frac{73^2-1}{73^2}} \\
& = \sqrt{\frac{73^2}{12^2}}\sqrt{\frac{73^2-1}{73^2}} \\
& = \frac{73}{12}\sqrt{1 - \frac{1}{73^2}} \\
& \approx \frac{73}{12}\left(1 - \frac{1}{2\cdot73^2}\right)
\end{align}
The usual $$
marks that delimit the display may be omitted here.
Definitions by cases (piecewise functions)
Use \begin{cases}…\end{cases}
. End each case with a \\
, and use &
before parts that should be aligned.
For example, you get this:
\[f(n) = \begin{cases} n/2, & \text{if $n$ is even} \\ 3n+1, & \text{if $n$ is odd} \end{cases}\]by writing this:
1
2
3
4
5
f(n) =
\begin{cases}
n/2, & \text{if $n$ is even} \\
3n+1, & \text{if $n$ is odd}
\end{cases}
The brace can be moved to the right:
\[\left. \begin{array}{l} \text{if $n$ is even:}&n/2\\ \text{if $n$ is odd:}&3n+1 \end{array} \right\} =f(n)\]by writing this:
1
2
3
4
5
6
7
\left.
\begin{array}{l}
\text{if $n$ is even:}&n/2\\
\text{if $n$ is odd:}&3n+1
\end{array}
\right\}
=f(n)
To get a larger vertical space between cases we can use \\[2ex]
instead of \\
. For example, you get this:
by writing this:
1
2
3
4
5
f(n) =
\begin{cases}
\frac{n}{2}, & \text{if $n$ is even} \\[2ex]
3n+1, & \text{if $n$ is odd}
\end{cases}
(An ‘ex’ is a length equal to the height of the letter x
; 2ex
here means the space should be two exes high.)
Arrays
It is often easier to read tables formatted in MathJax rather than plain text or a fixed width font. Arrays and tables are created with the array
environment. Just after \begin{array}
the format of each column should be listed, use c
for a center aligned column, r
for right aligned, l
for left aligned and a |
for a vertical line. Just as with matrices, cells are separated with &
and rows are broken using \\
. A horizontal line spanning the array can be placed before the current line with \hline
.
For example,
\[\begin{array}{c|lcr} n & \text{Left} & \text{Center} & \text{Right} \\ \hline 1 & 0.24 & 1 & 125 \\ 2 & -1 & 189 & -8 \\ 3 & -20 & 2000 & 1+10i \end{array}\]is produced by:
1
2
3
4
5
6
7
\begin{array}{c|lcr}
n & \text{Left} & \text{Center} & \text{Right} \\
\hline
1 & 0.24 & 1 & 125 \\
2 & -1 & 189 & -8 \\
3 & -20 & 2000 & 1+10i
\end{array}
Arrays can be nested to make an array of tables.
For example,
\[\begin{array}{c} \begin{array}{cc} \begin{array}{c|cccc} \text{min} & 0 & 1 & 2 & 3\\ \hline 0 & 0 & 0 & 0 & 0\\ 1 & 0 & 1 & 1 & 1\\ 2 & 0 & 1 & 2 & 2\\ 3 & 0 & 1 & 2 & 3 \end{array} & \begin{array}{c|cccc} \text{max}&0&1&2&3\\ \hline 0 & 0 & 1 & 2 & 3\\ 1 & 1 & 1 & 2 & 3\\ 2 & 2 & 2 & 2 & 3\\ 3 & 3 & 3 & 3 & 3 \end{array} \end{array} \\ \begin{array}{c|cccc} \Delta&0&1&2&3\\ \hline 0 & 0 & 1 & 2 & 3\\ 1 & 1 & 0 & 1 & 2\\ 2 & 2 & 1 & 0 & 1\\ 3 & 3 & 2 & 1 & 0 \end{array} \end{array}\]As the source for the preceding array is long, please right-click on one of the tables and choose $\mathtt{Show \; Math \; As } ▸ \mathtt{Tex \; Commands}$ .
Fussy spacing issues
These are issues that won’t affect the correctness of formulas, but might make them look significantly better or worse. Beginners should feel free to ignore this advice; someone else will correct it for them, or more likely nobody will care.
Don’t use \frac
in exponents or limits of integrals; it looks bad and can be confusing, which is why it is rarely done in professional mathematical typesetting. Write the fraction horizontally, with a slash:
The |
symbol has the wrong spacing when it is used as a divider, for example in set comprehensions. Use \mid
instead:
When using stretchable delimiters (i.e. with \left
and \right
), it may be preferable to use \,\middle|\,
. This produces a stretchable vertical bar with a little bit of space around it. Another alternative is to use a colon instead.
For double and triple integrals, don’t use \int\int
or \int\int\int
. Instead use the special forms \iint
and \iiint
:
Use \,
to insert a thin space before differentials; without this $\TeX$ will mash them together:
Crossing things out
Use \require{cancel}
in the first formula in your post that requires cancelling; you need it only once per page. Then use:
Use \require{enclose}
for the following:
\enclose
can also produce enclosing boxes, circles, and other notations; see MathML menclose
documentation for a complete list.
System of equations
- Use
\begin{array}…\end{array}
and\left\{…\right.
For example, you get this:
by writing this:
1
2
3
4
5
6
7
\left\{
\begin{array}{c}
a_1x+b_1y+c_1z=d_1 \\
a_2x+b_2y+c_2z=d_2 \\
a_3x+b_3y+c_3z=d_3
\end{array}
\right.
- To align the
=
signs use\begin{aligned}...\end{aligned}
and\left\{…\right.
(see asmeurer’s comment)
whose code is
1
2
3
4
5
6
7
\left\{
\begin{aligned}
a_1x+b_1y+c_1z &=d_1+e_1 \\
a_2x+b_2y&=d_2 \\
a_3x+b_3y+c_3z &=d_3
\end{aligned}
\right.
- To align the
=
signs and the terms as in
use array
with l
(for “align left”; there are also c
and r
) parameters
1
2
3
4
5
6
7
\left\{
\begin{array}{ll}
a_1x+b_1y+c_1z &=d_1+e_1 \\
a_2x+b_2y &=d_2 \\
a_3x+b_3y+c_3z &=d_3
\end{array}
\right.
- Vertical space between equations. As explained in Definitions by cases to get a larger vertical space between equations we can use
\\[2ex]
instead of\\
. The system
is generated by the following code
1
2
3
4
5
\begin{cases}
a_1x+b_1y+c_1z=d_1 \\[2ex]
a_2x+b_2y+c_2z=d_2 \\[2ex]
a_3x+b_3y+c_3z=d_3
\end{cases}
in comparison with
\[\begin{cases} a_1x+b_1y+c_1z=\frac{p_1}{q_1} \\ a_2x+b_2y+c_2z=\frac{p_2}{q_2} \\ a_3x+b_3y+c_3z=\frac{p_3}{q_3} \end{cases}\]whose code is:
1
2
3
4
5
\begin{cases}
a_1x+b_1y+c_1z=\frac{p_1}{q_1} \\
a_2x+b_2y+c_2z=\frac{p_2}{q_2} \\
a_3x+b_3y+c_3z=\frac{p_3}{q_3}
\end{cases}
- In response to
elect's comment
. The following code
1
2
3
4
5
6
\left\{
\begin{array}{l}
0 = c_x-a_{x0}-d_{x0}\dfrac{(c_x-a_{x0})\cdot d_{x0}}{\|d_{x0}\|^2} + c_x-a_{x1}-d_{x1}\dfrac{(c_x-a_{x1})\cdot d_{x1}}{\|d_{x1}\|^2} \\[2ex]
0 = c_y-a_{y0}-d_{y0}\dfrac{(c_y-a_{y0})\cdot d_{y0}}{\|d_{y0}\|^2} + c_y-a_{y1}-d_{y1}\dfrac{(c_y-a_{y1})\cdot d_{y1}}{\|d_{y1}\|^2}
\end{array}
\right.
produces
\[\left\{ \begin{array}{l} 0 = c_x-a_{x0}-d_{x0}\dfrac{(c_x-a_{x0})\cdot d_{x0}}{\|d_{x0}\|^2} + c_x-a_{x1}-d_{x1}\dfrac{(c_x-a_{x1})\cdot d_{x1}}{\|d_{x1}\|^2} \\[2ex] 0 = c_y-a_{y0}-d_{y0}\dfrac{(c_y-a_{y0})\cdot d_{y0}}{\|d_{y0}\|^2} + c_y-a_{y1}-d_{y1}\dfrac{(c_y-a_{y1})\cdot d_{y1}}{\|d_{y1}\|^2} \end{array} \right.\]Colors
Named colors are browser-dependent; if a browser doesn’t know a particular color name, it may render the text as black. The following colors are standard in HTML4 and CSS2 and should be interpreted the same by most browsers:
\[\begin{array}{|rc|} \hline \verb+\color{black}{text}+ & \color{black}{text} \\ \verb+\color{gray}{text}+ & \color{gray}{text} \\ \verb+\color{silver}{text}+ & \color{silver}{text} \\ \verb+\color{white}{text}+ & \color{white}{text} \\ \hline \verb+\color{maroon}{text}+ & \color{maroon}{text} \\ \verb+\color{red}{text}+ & \color{red}{text} \\ \verb+\color{yellow}{text}+ & \color{yellow}{text} \\ \verb+\color{lime}{text}+ & \color{lime}{text} \\ \verb+\color{olive}{text}+ & \color{olive}{text} \\ \verb+\color{green}{text}+ & \color{green}{text} \\ \verb+\color{teal}{text}+ & \color{teal}{text} \\ \verb+\color{aqua}{text}+ & \color{aqua}{text} \\ \verb+\color{blue}{text}+ & \color{blue}{text} \\ \verb+\color{navy}{text}+ & \color{navy}{text} \\ \verb+\color{purple}{text}+ & \color{purple}{text} \\ \verb+\color{fuchsia}{text}+ & \color{magenta}{text} \\ \hline \end{array}\]HTML5 and CSS 3 define an additional 124 color names that will be supported on many browsers.
Math Stack Exchange’s default style uses a light-colored page background, so avoid using light colors for text. Stick to darker colors like maroon, green, blue, and purple, and remember also that 7–10% of men are color-blind and have difficulty distinguishing red and green.
The color may also have the form #rgb where 𝑟,𝑔,𝑏 are in the range or 0
–9
, a
–f
and represent the intensity of red, green, and blue on a scale of 0
–15
, with a
=10, b
=11, … f
=15. For example:
You can have a look here for quick reference on colors in HTML.
Additional symbolic decorations
To see Tex Commands right click on the Math
\overline
: $\overline{A} \; \overline{AA} \; \overline{AAA}$
\underline
: $\underline{B} \; \underline{BB} \; \underline{BBB}$
\widetilde
: $\widetilde{C} \; \widetilde{CC} \; \widetilde{CCC}$
\widehat
: $\widehat{D} \; \widehat{DD} \; \widehat{DDD}$
\fbox
: $\fbox{E} \; \fbox{EE} \; \fbox{EEE}$
\underleftarrow
: $\underleftarrow{F} \; \underleftarrow{FF} \; \underleftarrow{FFF} \qquad$ variant: \xleftarrow{}
: $\xleftarrow{abc}$
\underrightarrow
: $\underrightarrow{G} \; \underrightarrow{GG} \; \underrightarrow{GGG} \qquad$ variant: \xleftarrow{}
: $\xrightarrow{abc}$
\underleftrightarrow
: $\underleftrightarrow{H} \; \underleftrightarrow{HH} \; \underleftrightarrow{HHH}$
\overrightarrow
: $\overrightarrow{AB} \; \overrightarrow{ABAB} \; \overrightarrow{ABABAB}$
\overbrace
: $\overbrace{(n - 2) + \overbrace{(n - 1) + n + (n + 1)} + (n + 2)}$
\underbrace
: $(n \underbrace{- 2) + (n \underbrace{- 1) + n + (n +} 1) + (n +} 2)$
\overbrace
and \underbrace
accept a superscript or a subscript, respectively, to annotate the brace. For example, \underbrace{a\cdot a\cdots a}_{b\text{ times}}
is
Note: \varliminf
: $\varliminf$ and \varlimsup
: $\varlimsup$ have special symbol of their own.
Single character accents
\check
: $\check I$
\acute
: $\acute J$
\grave
: $\grave K$
\vec
: $\vec{u} \; \vec{AB}$ (c.f. \overrightarrow
above)
\bar
: $\bar z$
\hat
: $\hat x$
\tilde
: $\tilde x$
\dot \ddot \dddot
: $\dot x , \ddot x, \dddot x$
\mathring
: $\mathring A$
General stacking
If you cannot find your symbol remember that you can stack various symbols using
\overset{above}{level}
: $\overset{@}{ABC}\ \overset{x^2}{\longmapsto}\ \overset{\bullet\circ\circ\bullet}{T}$
\underset{below}{level}
: $\underset{@}{ABC}\ \underset{x^2}{\longmapsto}\ \underset{\bullet\circ\circ\bullet}{T}$
You can use these together too. You can type $X\overset{a}{\underset{b}{\to}}Y$ with X\overset{a}{\underset{b}{\to}}Y
.
Arc over points
\overset{ \huge\frown}{PQ}
: $\overset{ \huge\frown}{PQ}$ denotes the arc over points $P$ and $Q$ .
Commutative diagrams
AMScd diagrams must start with a “require”:
1
2
3
4
5
6
\require{AMScd}
\begin{CD}
A @>a>> B\\
@V b V V= @VV c V\\
C @>>d> D
\end{CD}
get this diagram:
\[\require{AMScd} \begin{CD} A @>a>> B\\ @V b V V= @VV c V\\ C @>>d> D \end{CD}\]@>>>
is used for arrow right
@<<<
is used for arrow left
@VVV
is used for arrow down
@AAA
is used for arrow up
@=
is used for horizontal double line
@|
is used for vertical double line
@.
is used for no arrow
Another example:
1
2
3
4
5
6
\require{AMScd}
\begin{CD}
A @>>> B @>{\text{very long label}}>> C \\
@. @AAA @| \\
D @= E @<<< F
\end{CD}
Long labels increase the length of the arrow and in this version also automatically increase corresponding arrows.
1
2
3
4
\require{AMScd}
\begin{CD}
RCOHR'SO_3Na @>{\text{Hydrolysis,$\Delta, Dil.HCl$}}>> (RCOR')+NaCl+SO_2+ H_2O
\end{CD}
Continued fractions
https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference