Sample MathJax Equations
#1: brackets...
\[ \left( x \right) \]
Aside: A long line of PRE formatted code should never cause the page width to overflow, hence PRE must be adorned with a text-wrap style! Otherwise this line will walk right off the page....
#1
\[ \left( x^2 \right) % comment \]
using <script type="math/tex">
Where you can observe the \[ \]
TeX math markers are superfluous
when you wrap the math in a <script type="math/tex">
section:
versus:
Let's try a few more math examples now, wrapped in <script
type="math/tex">
sections:
and here is a little bit of inline math: $C = \alpha + \beta Y^{\gamma} + \epsilon$ -- or the same thing written using the script tag: a little bit of inline math: . It is embedded in the text.
and
and
and
and Typesetting an n×n matrix requires vertical, horizontal, and downward-sloped ellipses, as in the example at the beginning of this section.
The distinction between \ldots and \cdots is subtle: \ldots aligns the ellipsis with the bottom of the text while \cdots centers the ellipsis. Typographical style considerations dictate which of the two commands to use. For matrix entries and binary operations, use \cdots. For lists, use \ldots. $x_1 + x_2 + \cdots + x_n$ $x_1,x_2,\ldots,x_n$
Here’s an example of a case-by-case definition.
Some formulas require accents or special font styles. For example, mathematicians often indicate that the variable $v$ stands for a vector by bolding it – like $\mathbf{v}$ – or by putting an arrow over it – like $\vec{v}$. The table below gives common accents and styles.
Unfortunately, mathbf does not work with Greek characters. To make bold Greek characters, load the bm (bold math) package and use the newly provided command \bm{...}.
Spacing
LATEX allows fine control over spacing in math mode.
The command \! adds negative space. Use it if LATEX adds too much space to your formula and you want to tighten it.
The command \phantom{ } adds as much white space as its argument takes up. We already encountered it in the section on the cases environment. Most of the spacing changes you’ll make are subtle, yet mark the difference between nice math and ugly math. The more time you spend typing and reading math, the better an eye you’ll develop for these sorts of spacing issues. In the meantime, we recommend placing \, before dx in integrals. Compare an integral with \, to one without it.

To make the sizes come out right, use \left before the left parenthesis and \right before the right parenthesis.
The \left and \right commands also work for other delimiters, including the invisible delimiter . (a period).
Making Math Operators
LATEX comes with predefined commands for the most commonly used math operators, such as log and sin. The reason we need special commands for these functions is that LATEX italicizes text in math mode: sin(x) is incorrect. But sometimes you may need to use an operator that has not already been defined. The proper way to do this is with the \operatorname command.
The subspace
Custom Commands with Arguments
The commands we defined in the last section did not take any arguments. In this section, we’ll see how to define commands that have multiple arguments, like regular LATEX commands.
Suppose we were typing up a math problem which involved taking many partial derivatives, such as
\[ \frac{\partial f}{\partial x} - i \frac{\partial f}{\partial y} \]
It would be useful to have a command that automatically makes partial derivatives, instead of typing out \frac{\partial ...}{\partial ...} many times. To make commands taking arguments, \newcommand has an optional argument specifying the number of arguments taken by the new command.
\[ \pd{f}{x} \] \[ \pd{\Lambda}{\nu} + \pd{\Omega}{\mu} \]
Every time LATEX sees a #1, it replaces it with the first argument; every time LATEX sees a #2, it replaces it with the second argument. For instance, the following command repeats its argument three times.
eqnarray environment
This is by default an array with three columns and as many rows as you like. It is nearly the same as an array with a rcl column definition.
\begin{eqnarray} ... \end{eqnarray}
It is not possible to change the internal behaviour of the eqnarray environment without rewriting the environment. It is always an implicit array with three columns and the horizontal alignment right-center-left (rcl) and small symbol sizes for the middle column. All this can not be changed by the user without rewriting the whole environment in latex.ltx.
\begin{eqnarray*} \mathrm{left} & \mathrm{middle} & \mathrm{right}\\ \frac{1}{\sqrt{n}}= & \frac{\sqrt{n}}{n}= & \frac{n}{n\sqrt{n}} \end{eqnarray*}
The eqnarray environment should not be used as an array. As seen in the above example the typesetting is wrong for the middle column. The numbering of eqnarray environments is always for every row, means, that four lines get four different equation numbers (for the labels see section 3.4 on page 18):
\begin{eqnarray} y & = & d\label{eq:2}\\ y & = & cx+d\\ y & = & bx^{2}+cx+d\\ y & = & ax^{3}+bx^{2}+cx+d\label{eq:5} \end{eqnarray}
Toggling numbering off/on for all rows is possible with the starred version of eqnarray.
\begin{eqnarray*} y & = & d\label{eq:3}\\ y & = & cx+d\\ y & = & bx^{2}+cx+d\\ y & = & ax^{3}+bx^{2}+cx+d\label{eq:4} \end{eqnarray*}
Toggling off/on for single rows is possible with the above mentioned \nonumber tag at the end of a row (before the newline command). For example:
\begin{eqnarray} y & = & d\nonumber \\ y & = & cx+d\nonumber \\ y & = & bx^{2}+cx+d\nonumber \\ y & = & ax^{3}+bx^{2}+cx+d \end{eqnarray}
and some more examples taken from "Math mode - v.2.22" (Herbert Voß - January 31, 2007):
\begin{align} f(x) &= \int\sin x\,\mathrm{d}x\label{eq:arab 1}\\ g(x) &= \int\frac{1}{x}\,\mathrm{d}x \end{align} \begin{align} F(x) &= -\cos x\\ G(x) &=\ln x\label{eq:rom 1} \end{align} \begin{align} f^{\prime}(x) &= \sin x\\ g^{\prime} (x) &= \frac{1}{x}\label{eq:arab 2} \end{align}
\[ \begin{equation}\label{eq:frame 0} f(x) =\int_1^{\infty}\dfrac{1}{x^2}\,\mathrm{d}x=1 \end{equation}% \]
\begin{equation} \left.% \begin{array}{@{}r@{\quad}ccrr@{}} \textrm{a}) & y & = & c & (constant) \\ \textrm{b}) & y & = & cx+d & (linear) \\ \textrm{c}) & y & = & bx^{2}+cx+d & (square) \\ \textrm{d}) & y & = & ax^{3}+bx^{2}+cx+d & (cubic) \end{array}% \right\} \textrm{Polynomes} \end{equation}
\begin{equation} x=\left\{ \begin{array}{cl} 0 & \textrm{if A=...}\\ 1 & \textrm{if B=...}\\ x & \textrm{this runs with as much text as you like, but without an raggedright text.}\end{array}\right. \end{equation}
\begin{equation} x = \left\{% \begin{array}{l>{\raggedright}p{.5\textwidth}}% 0 & if A=...\tabularnewline 1 & if B=...\tabularnewline x & \parbox{0.5\columnwidth}{this runs with as much text as you like, % because an automatic linebreak is given with % a raggedright text. Without this % \raggedright command, you’ll get a formatted % text like the following one ... but with a parbox ... it works} \end{array}% \right. % \end{equation}
instead of:
\begin{equation} x = \left\{% \begin{array}{l>{\raggedright}p{.5\textwidth}}% 0 & if A=...\\ 1 & if B=...\\ x & \textrm{this runs with as much text as you like, % because an automatic linebreak is given with % a raggedright text. Without this % \raggedright command, you’ll get a formatted % text like the following one ... but with a parbox ... it works} \end{array}% \right. % \end{equation}
$\begin{matrix} A & B & C \\ d & e & f \\ 1 & 2 & 3 \\ \end{matrix}$
$\bordermatrix{% & 0 & 1 & 2 \cr 0 & A & B & C \cr 1 & d & e & f \cr 2 & 1 & 2 & 3 \cr }$
$\bordermatrix{% & 1 & 2 \cr 1 & x1 & x2 \cr 2 & x3 & x4 \cr 3 & x5 & x6 }$
$\bordermatrix[{[]}]{% & 1 & 2 \cr 1 & x1 & x2 \cr 2 & x3 & x4 \cr 3 & x5 & x6 }$
$\bordermatrix[\{\}]{% & 1 & 2 \cr 1 & x1 & x2 \cr 2 & x3 & x4 \cr 3 & x5 & x6 }$
$\bordermatrix*{% x1 & x2 & 1 \cr x3 & x4 & 2 \cr x5 & x6 & 3 \cr 1 & 2 }$
$\bordermatrix*[{[]}]{% x1 & x2 & 1 \cr x3 & x4 & 2 \cr x5 & x6 & 3 \cr 1 & 2 }$
$\bordermatrix*[\{\}]{% x1 & x2 & 1 \cr x3 & x4 & 2 \cr x5 & x6 & 3 \cr 1 & 2 }$
\begin{equation}\label{eq:atop} \sum_{{1\le j\le p\atop {% {1\le j\le q\atop 1\le k\le r}}}% }a_{ij}b_{jk}c_{ki} \end{equation}
$\sqrt{x}$
$\sqrt[3]{x}$
\begin{equation} \sqrt{a}\,% \sqrt{T}\,% \sqrt{2\alpha k_{B_1}T^i}\label{eq:root1} \end{equation}
\begin{equation}\label{eq:root2} \sqrt{a\vphantom{k_{B_1}T^i}}\,% \sqrt{T\vphantom{k_{B_1}T^i}}\,% \sqrt{2\alpha k_{B_1}T^i} \end{equation}
\begin{align} \biggl)\times \frac{a}{b} \times\biggr( \end{align}
\begin{align} \bigg)\times \frac{a}{b} \times\bigg( \end{align}
$\bigg(\displaystyle\frac{1}{3}\bigg|\frac{3}{4}\bigg)$
$\bigg(\displaystyle\frac{1}{3}\biggm|\frac{3}{4}\bigg)$
\begin{equation} 3\Big( a^2+b^{c^2}\Big) \end{equation}
\begin{equation} 3\Big[ a^2+b^{c^2}\Big] \end{equation}
\begin{equation} 3\Big/ a^2+b^{c^2}\Big\backslash \end{equation}
\begin{equation} 3\Big\{ a^2+b^{c^2}\Big\} \end{equation}
\begin{equation} 3\Big|a^2+b^{c^2}\Big\Vert \end{equation}
\begin{equation} 3\Big\lfloor a^2+b^{c^2} \Big\rfloor \end{equation}
\begin{equation} 3\Big\lceil a^2+b^{c^2} \Big\rceil \end{equation}
\begin{equation} 3\Big\langle a^2+b^{c^2}\Big\rangle \end{equation}
\begin{equation} 3\Big\uparrow a^2+b^{c^2}\Big\Uparrow \end{equation}
\begin{equation} 3\Big\downarrow a^2+b^{c^2} \Big\Downarrow \end{equation}
\begin{equation} 3\Big\updownarrow a^2+b^{c^2} \Big\Updownarrow \end{equation}
Table 3: Use of the different parentheses for the “big” commands
That's all about the SCRIPT tag. The rest of this samples file will use the
classic \[ ... \]
text delimiters/markers approach most of the
time...
#1: Goniometrie: hoeken
\[ \sphericalangle ABC \] \[ \angle ABC \] \[ \measuredangle ABC \]
#1: xxx
The binomial coefficient is defined by the next expression: \[ \binom{n}{k} = \frac{n!}{k!(n-k)!} \]
When displaying fractions in-line, for example \(\frac{3x}{2}\) you can set a different display style: \( \displaystyle \frac{3x}{2} \). This is also true the other way around \[ f(x)=\frac{P(x)}{Q(x)} \ \ \textrm{and} \ \ f(x)=\textstyle\frac{P(x)}{Q(x)} \]
The fractions can be nested \[ \frac{1+\frac{a}{b}}{1+\frac{1}{1+\frac{1}{a}}} \] Now a wild example \[ a_0+\cfrac{1}{a_1+\cfrac{1}{a_2+\cfrac{1}{a_3+\cdots}}} \]
The binomial coefficient is defined by the next expression: \[ \binom{n}{k} = \frac{n!}{k!(n-k)!} \] And of course this command can be included in the normal text flow \(\binom{n}{k}\).
A slightly different and more complex example of continued fractions
Final example \[ \newcommand{\contfrac}[2]{% { \rlap{\dfrac{1}{\phantom{#1}}}% \genfrac{}{}{0pt}{0}{}{#1+#2}% } } a_0 + \contfrac{a_1}{ \contfrac{a_2}{ \contfrac{a_3}{ \genfrac{}{}{0pt}{0}{}{\ddots} }}} \]
The size of the brackets can be manually set, or they can be resized dynamically in your document, as shown in the next example: \[ \left \{ \begin{tabular}{ccc} 1 & 5 & 8 \\ 0 & 2 & 4 \\ 3 & 3 & -8 \end{tabular} \right \} \] \[ \left \{ \begin{matrix} 1 & 5 & 8 \\ 0 & 2 & 4 \\ 3 & 3 & -8 \end{matrix} \right \} \]
The standard LaTeX tools for equations may lack some flexibility, causing overlapping or even trimming part of the equation when it's too long. We can surpass this difficulties with amsmath. Let's check an example: \begin{equation} \label{eq1} \begin{split} A & = \frac{\pi r^2}{2} \\ & = \frac{1}{2} \pi r^2 \end{split} \end{equation}
\begin{equation} \label{eu_eqn} e^{\pi i} + 1 = 0 \end{equation} The beautiful equation \ref{eu_eqn} is known as the Euler equation
Alignment, etc.
For equations longer than a line use the multline environment. Insert a double backslash to set a point for the equation to be broken. The first part will be aligned to the left and the second part will be displayed in the next line and aligned to the right.
Again, the use of an asterisk * in the environment name determines whether the equation is numbered or not. \begin{multline*} p(x) = 3x^6 + 14x^5y + 590x^4y^2 + 19x^3y^3\\ - 12x^2y^4 - 12xy^5 + 2y^6 - a^3b^3 \end{multline*}
And aligned (with a extra little whitespace help after the equal sign) \begin{align*} p(x) =\ &3x^6 + 14x^5y + 590x^4y^2 + 19x^3y^3\\ - &12x^2y^4 - 12xy^5 + 2y^6 - a^3b^3 \end{align*}
If there are several equations that you need to align vertically, the align environment will do it: \begin{align*} 2x - 5y &= 8 \\ 3x + 9y &= -12 \end{align*}
As mentioned before, the ampersand character & determines where the equations align. Let's check a more complex example: \begin{align*} x&=y & w &=z & a&=b+c\\ 2x&=-y & 3w&=\frac{1}{2}z & a&=b\\ -4 + 5x&=2+y & w+2&=-1+w & ab&=cb \end{align*}
Grouping and centering equations
If you just need to display a set of consecutive equations, centered and with no alignment whatsoever, use the gather environment. The asterisk trick to set/unset the numbering of equations also works here. \begin{gather*} 2x - 5y = 8 \\ 3x^2 + 9y = 3a + c \end{gather*}
Spacing
Spacing in maths mode is useful in several situations, let's see an example: Assume we have the next sets \[ S = \{ z \in \mathbb{C}\, \big|\, |z| < 1 \} \quad \textrm{and} \quad S_2=\partial{S} \]
The spacing depends on the command you insert, the example below contains a complete list of spaces and how they look like. Spaces in mathematical mode. \begin{align*} f(x) =& x^2\! +3x\! +2 \\ f(x) =& x^2+3x+2 \\ f(x) =& x^2\, +3x\, +2 \\ f(x) =& x^2\: +3x\: +2 \\ f(x) =& x^2\; +3x\; +2 \\ f(x) =& x^2\ +3x\ +2 \\ f(x) =& x^2\quad +3x\quad +2 \\ f(x) =& x^2\qquad +3x\qquad +2 \end{align*}
Spacing around operators and relations in math mode are governed by specific skip lengths: \thinmuskip (by default it is equal to 3 mu) \medmuskip (by default it is equal to 4 mu) \thickmuskip (by default it is equal to 5 mu) \begin{align*} 3ax+4by=5cz\\ 3ax<4by+5cz \end{align*}
User-defined binary and relational operators
You can force the spacing used in binary or relational operators, so you can define your own. \begin{align*} 34x^2a \mathbin{\#} 13bc \\ 34x^2a \mathrel{\#} 13bc \end{align*}
Fractions
When you divide (fractionate) something into parts, two or more, you have what is known as a '''common fraction'''. A common fraction is usually written as two numbers; a top number and a bottom number. Common fractions can also be expressed in words. The number that is on top is called the numerator, and the number on the bottom is called the denominator (the prefix 'de-' is Latin for reverse) or divisor. \[ \frac{\text{numerator}}{\text{denominator}} \]
These two numbers are always separated by a line, which is known as a fraction bar. This way of representing fractions is called display representation. Common fractions are, more often than not, simply known as fractions in everyday speech.
The numerator in any given fraction tells you how many parts of something you have on hand. For example, if you were to slice a pizza for a party into six equal pieces, and you took two slices of pizza for yourself, you would have $\tfrac{2}{6}$ (pronounced two-sixths) of that pizza. Another way to look at it is by thinking in terms of equal parts; when that pizza was cut into six equal parts, each part was exactly $\tfrac{1}{6}$ (one-sixth) of the whole pizza.
The denominator tells you how many parts are in a whole, in this case your pizza. Your pizza was cut into six equal parts, and therefore the entire pizza consists of six equal slices. So when you took two slices for yourself, only four slices of pizza remain, or $\tfrac{4}{6}$ (four-sixths).
Also keep in mind that numerator can never be zero. It makes no sense to have zero divided into parts. For instance, the fraction $\tfrac{0}{6}$ is equal to zero, because you can not have six slices of nothing. If the denominator is zero, then the fraction has no meaning or is considered undefined since it may depend upon the mathematical setting one is working on, for the purpose of this chapter, we will consider that it has no meaning.
Another way of representing fractions is by using a diagonal line between the numerator and the denominator. \[ 1/2\ \] \[ {5 \frac{3}{7}} / {1 \frac{1}{3}} \ \] MathJax: \[ {\raise0.7ex\hbox{${2a + \frac{{7b}}{{5c}}}$} \!\mathord{\left/ {\vphantom {{2a + \frac{{7b}}{{5c}}} {35 \times \frac{{12}}{{17}}}}}\right.\kern-\nulldelimiterspace} \!\lower0.7ex\hbox{${35 \times \frac{{12}}{{17}}}$}} \] TeXCV: \[ {}^{2a+\frac{7b}{5c}}\diagup{}_{35\times \frac{12}{17}}\; \] Plain TeX: $${\raise0.7ex\hbox{${2a + {{7b} \over {5c}}}$} \!\mathord{\left/ {\vphantom {{2a + {{7b} \over {5c}}} {35 \times {{12} \over {17}}}}}\right.\kern-\nulldelimiterspace} \!\lower0.7ex\hbox{${35 \times {{12} \over {17}}}$}}$$ MathML:
In this case, the separator between the numerator and the denominator is called a ''slash'', a ''solidus'' or a ''virgule''. This method of representing fractions is called ''in-line representation'', meaning that the fraction is lined up with the rest of the text. You will often see in-line representations in texts where the author does not have any way to use display representation.
Proper Fractions
The fraction in the pizza analogy we just used is known as a '''proper fraction'''. In a proper fraction, the numerator (top number) is always smaller than the denominator (bottom number). Thus, the value of a proper fraction is always less than one. Proper fractions are generally the kind you will encounter most often in mathematics.
Improper Fractions
When the numerator of a fraction is greater than, or equal to the denominator, you have an '''improper fraction'''. For example, the fractions $\tfrac{5}{3}, \tfrac{2}{1}$ and $\tfrac{6}{6}$ are all considered improper fractions. Improper fractions always have a value of one whole or more. So with $\tfrac{6}{6}$, the numerator says you have 6 pieces, but 6 is also the number of the whole, so the value of this fraction is one whole. It is as if no one took a slice of pizza after you cut it.
In the case of $\tfrac{5}{3}$, one whole of something is divided into three equal pieces, but on hand you have five pieces (you had two pizzas, each divided into three slices, and you ate one slice). This means you have two pieces extra, or two pieces greater than one whole. This concept may seem rather confusing and strange at first, but as you become better in math you will eventually put two and two together to the get the whole picture (okay, bad pun).
Mixed Fractions
When a whole number is written next to a fraction, such as $2\tfrac{1}{3}$ (two and one-third) you are seeing what is called a '''mixed fraction'''. A mixed fraction is understood as being the sum, or total, of both the whole number and fraction. The number two in $2\tfrac{1}{3}$ stands for two wholes - you also have a third more of something, which is the $\tfrac{1}{3}$.
Simplifying Fractions
Sometimes in mathematics you will need to rewrite a fraction in smaller numbers, while also keeping the value of the fraction the same. This is known as simplifying, or ''reducing to lowest terms''. It should be mentioned that a fraction which is not reduced is not intrinsically incorrect, but it may be confusing for others reviewing your work. There are two ways to simplify fractions, and both will be useful anytime you work with fractions, so it is recommended you learn both methods.
To reiterate, reducing fractions is essentially replacing your original fraction with another one of equal value, called an ''equivalent fraction''. Below are a few examples of equivalent fractions. \[ \frac{4}{8} = \frac{1}{2}, \frac{8}{12} = \frac{2}{3}, \frac{6}{10} = \frac{3}{5} \]
When the fraction $\frac{4}{8}$ is reduced to lowest terms, it then becomes $\frac{1}{2}$, because four pieces out of a total of eight is exactly one-half of all available pieces. A fraction is also in its lowest terms when both the numerator and denominator cannot be divided evenly by any number other than one.
Division Method
To reduce a fraction to lowest terms, you must divide the numerator and denominator by the largest whole number that divides evenly into both. For example, to reduce the fraction $\tfrac{3}{9}$ to lowest terms, divide the numerator ('''3''') and denominator ('''9''') by three. \[ \frac{3 \div 3}{9 \div 3} = \frac{1}{3} \]
If the largest whole number is not obvious, and many times it is not, divide the numerator and denominator by any number (except one) that divides evenly into each, and then repeat the process until the fraction is in lowest terms. Know that if both numbers are even, then you divide each number by 2.
For clarity, below are a few examples of reducing fractions using this method.
Example
Reduce $\tfrac{12}{20}$ to lowest terms.
Solution
In this problem, the largest whole number is difficult to see, so we first divide the numerator and denominator by two, as shown: \[ \frac{12 \div 2}{20 \div 2} = \frac{6}{10} \]
Next divide by two again: \[ \frac{6 \div 2}{10 \div 2} = \frac{3}{5} \]
There are no whole numbers left which can divide evenly into $\tfrac{3}{5}$, so the problem is finished.
Answer
$\tfrac{12}{20}$ reduced to lowest terms is $\tfrac{3}{5}$
Example
Reduce $\tfrac{18}{24}$ to lowest terms.
Solution
Divide the numerator and denominator by six, as shown: \[ \frac{18 \div 6}{24 \div 6} = \frac{3}{4} \]
Answer
$\tfrac{18}{24}$ reduced to lowest terms is $\tfrac{3}{4}$.
Example
Reduce $\tfrac{112}{126}$ to lowest terms.
Solution
In this problem, the largest whole number is not immediately apparent, so we first divide the numerator and denominator by two, as shown: \[ \frac{112 \div 2}{126 \div 2} = \frac{56}{63} \]
Next divide by seven: \[ \frac{56 \div 7}{63 \div 7} = \frac{8}{9} \]
Answer
$\tfrac{112}{126}$ reduced to lowest terms is $\tfrac{8}{9}$.
Greatest Common Factor Method
The second method of simplifying fractions involves finding the ''greatest common factor'' between the numerator and the denominator. We do this by breaking up both the numerator and the denominator into their prime factors (greatest common factor = 2x2 = 4): \[ \frac{12}{16}=\frac{2 \times 2 \times 3}{2 \times 2 \times 2 \times 2} = \frac{2\!\!\!/ \times 2\!\!\!/ \times 3}{2\!\!\!/ \times 2\!\!\!/ \times 2 \times 2} = \frac {3}{4} \]
It is implied that any part is multiplied by one. If we divide 2s out of the factorized fraction, we are left with one 2 in the denominator. \[ \frac{4}{8} = \frac{1 \times 2\!\!\!/ \times 2\!\!\!/}{2 \times 2\!\!\!/ \times 2\!\!\!/} = \frac{1}{2} \]
It is best to practice these skills of reducing fractions until you feel confident enough to do them on your own. Remember, practice makes perfect.
Raising Fractions to Higher Terms
To raise a fraction to ''higher terms'' is to rewrite it in larger numbers while keeping the fraction equivalent to the original in value. This is, for all intents and purposes, the exact opposite of simplifying a fraction.
Example
Convert $\frac{2}{5}$ to a fraction with denominator of 15. \[ \frac{2}{5} = \frac{?}{15} \]
Step 1
Ask yourself “what number multiplied by 5 equals 15?” To find the answer simply divide 5 into 15. \[ {15} \div {5} = 3 \]
Step 2
After dividing the two denominators, you must take the answer and multiply it by the numerator you already have. So in this case, we multiply 2 by 3 to find the missing numerator. \[ {2} \times {3} = {6} \]
Answer
\[ \frac{2}{5} = \frac{6}{15} \]
Changing Improper Fractions to Mixed Numbers
Oftentimes you will encounter fractions in their improper form. While this may be useful in some instances, it is usually best to convert the fraction into simplest form, or mixed fraction.
To convert an improper fraction into a mixed fraction, divide the denominator into the numerator.
Example
Change $\frac{13}{2}$ into a mixed fraction.
Solution
Divide 13 by 2, use long division to obtain quotient and a remainder. ${13} \div {2} = {6\ \mbox{r}\ 1}$
Answer
To form the proper fraction part of the answer, we use the divisor ('''2''') as the denominator, and the remainder ('''r1''') as the numerator. Finally, we take the answer to the division problem, in this case 6, and use that as the whole number.
Hence $\frac{13}{2}$ in mixed fraction form is $6\,\!\frac{1}{2}$
Adding Fractions
Adding Fractions With The Same Denominator
In order to add fractions with the same denominator, you only need to add the numerators while keeping the original denominator for the sum. \[ \frac{1}{5} + \frac{3}{5} = \frac{1+3}{5} = \frac{4}{5} \]
Adding fractions with the same denominator is the rule but it begs the question why? Why can’t (or shouldn't) I add both numerators and denominators? \[ \frac{1}{4} + \frac{1}{4} = \frac{1+1}{4+4} = \frac{2}{8} \]
To make sense of this try taking a 12 inch ruler and drawing a 3 inch horizontal line (1/4 of a foot) and then on the end add another 3 inch line (1/4 of a foot). What is the total length of the line? It should be 6 inches (1/2 a foot) and not 2/8 of a foot (3 inches). In essence it seems we can only add like items and like items are terms that have the same denominator and we add them up by adding up numerators.
Adding Fractions With Different Denominators
When adding fractions that do not have the same denominator, you must make the denominators of all the terms the same. We do this by finding the ''least common multiple'' of the two denominators.
:Least common multiple of 4 and 5 is 20; therefore, make the denominators 20: \] \frac{1}{4} + \frac{2}{5} = \frac{1 \times 5}{4 \times 5} + \frac{2 \times 4}{5 \times 4} = \frac{5}{20} + \frac{8}{20} \]
:Now that the common denominators are the same, perform the usual addition: \[ \frac{5+8}{20} = \frac{13}{20} \]
Subtracting Fractions
Subtracting Fractions With The Same Denominator
To subtract fractions sharing a denominator, take their numerators and subtract them in order of appearance. If the numerator's difference is zero, the whole difference will be zero, regardless of the denominator. \[ \frac{6}{13} - \frac{2}{13} = \frac{6-2}{13} = \frac{4}{13} \]
Subtracting Fractions With Different Denominators
To subtract one fraction from another, you must again find the least common multiple of the two denominators.
:Least common multiple of 4 and 6 is 12; therefore, make the denominator 12: \[ \frac{3}{4} - \frac{1}{6} = \frac{3 \times 3}{4 \times 3} - \frac{1 \times 2}{6 \times 2} = \frac{9}{12} - \frac{2}{12} \]
:Now that the denominator is same, perform the usual subtraction. \[ \frac{9-2}{12} = \frac{7}{12} \]
Multiplying Fractions
Multiplying fractions is very easy. Simply multiply the numerators of the fractions to find the numerator of the answer. Then multiply the denominators of the fractions to find the denominator of the answer. In other words, it can be said “top times top equals top”, and “bottom times bottom equals bottom.” This rule is used to multiply both proper and improper fractions, and can be used to find the answer to more than two fractions in any given problem.
Example
Multiply $\frac{1}{2} \times \frac{3}{4}$
Step 1
Multiply the numerators to find the numerator of the answer. $1 \times 3 = 3$
Step 2
Multiply the denominators to find the denominator of the answer. $2 \times 4 = 8$
Answer
\[ \frac{1}{2} \times \frac{3}{4} = \frac{3}{8} \]Make sure to reduce your answer if possible.
Whole and Mixed Numbers
When you need to multiply a fraction by a whole number, you must first convert the whole number into a fraction. This, fortunately, is not as difficult as it may sound; just put the whole number over the number one. Then proceed to multiply as you would with any two fractions. An example is given below. \[ \frac{3}{4} \times {5} = \frac{3}{4} \times \frac{5}{1} = \frac{15}{4} = 3\,\!\frac{3}{4} \]
If a problem contains one or more mixed numbers, you must first convert all mixed numbers into improper fractions, and multiply as before. Finally, convert any improper fraction back to a mixed number. \[ 1\,\!\frac{1}{2} \times 2\,\!\frac{1}{4} = \frac{3}{2} \times \frac{9}{4} = \frac{27}{8} = 3\,\!\frac{3}{8} \]
Dividing Fractions
To divide fractions, simply exchange the numerator and the denominator of the second term in the problem, then multiply the two fractions. \[ \frac{1}{2} \div \frac{3}{4} \]
Invert the second fraction: \[ \frac{1}{2} \times \frac{4}{3} \]
Multiply: \[ \frac{1 \times 4}{2 \times 3} = \frac{4}{6} \]
Always check to see if simplifying the resulting fraction can be done: \[ \frac{4}{6} = \frac{2}{3} \]
#1
\[ \left( \frac{a}{b} \right) \]
#1
\[ \left( \frac{a^2}{b} \right) \]
#1
\[ \left( \dfrac{a}{b} \right) \]
#1
\[ \left( \dfrac{a^2}{b} \right) \]
matrix
\[ \begin{matrix} 1 \\ 2 \\ 3 \end{matrix}\begin{matrix} a \\ b \\ c \\ d \end{matrix} \] \[ \begin{matrix} 1 \\ 2 \\ 3 \end{matrix}\begin{matrix} \cfrac{a}{\cfrac{b}{\cfrac{c}{d}}} \end{matrix} \] \[ \begin{matrix} 1 \\ 2 \\ 3 \end{matrix}\begin{matrix} a \\ \hline b \\ \hline c \\ \hline d \end{matrix} \] \[ \begin{matrix} 1 \\ 2 \\ 3 \end{matrix}\] \[ \begin{matrix} a \\ \rule{.3em}{.1em} b \\ \rule{.3em}{.1em} c \\ \rule{.3em}{.1em} d \end{matrix}\] \[ \eqalign{ a \\ b \\ c \\ d }\] \[ \displaylines{ a \\ b \\ c \\ d }\] \[ \eqalignno{ a \\ b \\ c \\ d }\] \[ \leqalignno{ a \\ b \\ c \\ d } \] \[ \left\{ \eqalign{ a &= 1\\ b &= 2\\ c &= 3 }\right\} \qquad \eqalign{ ax + by &= c \\ x + 2y &= 3 } \] \[ \rule{.3em}{.1em}% \rule[-.1em]{5em}{1em}% \rule{.3em}{.1em}% \rule[.1em]{1em}{5em}% \rule{.3em}{.1em} \] \[ x = {a \mod b} \pod c \]
\begin{equation} \cos (2\theta) = \cos^2 \theta - \sin^2 \theta \end{equation} \begin{equation} {\displaystyle \cos(2\theta )=\cos ^{2}\theta -\sin ^{2}\theta \,} \end{equation}
\begin{equation} \underbracket[0pt]{\frac{5}{9}}_{(7)} \end{equation}
\[ f(x) = \underset{\strut(7)}{\frac{5}{9}} + \overset{\strut(8)}{\frac{4}{9}} \]
Some space can be added in the outer nominator/denominator, e.g.: \[ \frac{\,\frac{a}{b}\,}{\frac{c}{d}} \] or \[ \genfrac{left-delim}{right-delim}{thickness}{mathstyle}{numerator}{denominator} \]
\[ \newcommand\zfrac[2]{{\tabcolsep=2pt\begin{array}{c}% #1\\ \noalign{\vskip-7pt} \multicolumn{1}{<EMAIL_ADDRESS>\noalign{\vskip-2pt} #2\end{array}}} \[ \frac{1}{2} + \zfrac{1}{2} + \zfrac{111}{222} \]
$\int\frac{1}{2}dx - \mathlarger{ \int\frac{1}{2}dx}$
\begin{equation*} \Rightarrow \alpha \mathlarger{\mathlarger{\sum}}_{c}A_c a_k\left( \frac{ \scalemath{0.85}{ \begin{aligned} \underbrace{\left[\left(\sum_{k=1}^{\nu-1}\frac{a_k}{12}(y_k^2+y_k y_{k+1} +y_{k+1}^2)\right) - \lambda_1\right]^2}_{\mathlarger{\mu_1}} + \underbrace{\left[\left(\sum_{k=1}^{\nu-1}\frac{a_k}{24}(x_k y_{k+1}+2x_ky_k+2x_{k+1}y_{k+1} +x_{k+1}y_k)\right) - \lambda_2 \right]^2}_{\mathlarger{\mu_2}} + \\[1em] \underbrace{\left[\left(\sum_{k=1}^{\nu-1}\frac{a_k}{24}(x_k y_{k+1}+2x_ky_k+2x_{k+1}y_{k+1} +x_{k+1}y_k)\right) - \lambda_3 \right]^2}_{\mathlarger{\mu_3}}+ \underbrace{\left[\left(\sum_{k=1}^{\nu-1}\frac{a_k}{12}(x_k^2+x_k x_{k+1} +x_{k+1}^2)\right) - \lambda_4 \right]^2}_{\mathlarger{\mu_4}} \end{aligned} } } {\Lambda^2} \right) \end{equation*}
And cleaned up for MathJax' limited support of LaTeX commands: \begin{equation*} \Rightarrow \alpha {{\sum}}_{c}A_c a_k\left( \frac{ B } {\Lambda^2} \right) \end{equation*} where \begin{equation*} \begin{aligned} B = &\underbrace{\left[\left(\sum_{k=1}^{\nu-1} \frac{a_k}{12}(y_k^2+y_k y_{k+1} +y_{k+1}^2)\right) - \lambda_1\right]^2}_{{\mu_1}} +\\[1ex]& \underbrace{\left[\left(\sum_{k=1}^{\nu-1}\frac{a_k}{24}(x_k y_{k+1}+ 2x_ky_k+2x_{k+1}y_{k+1} +x_{k+1}y_k)\right) - \lambda_2 \right]^2} _{{\mu_2}} + \\[1ex]& \underbrace{\left[\left(\sum_{k=1}^{\nu-1}\frac{a_k}{24}(x_k y_{k+1}+ 2x_ky_k+2x_{k+1}y_{k+1} +x_{k+1}y_k)\right) - \lambda_3 \right]^2} _{{\mu_3}}+\\[1ex]& \underbrace{\left[\left(\sum_{k=1}^{\nu-1}\frac{a_k}{12}(x_k^2+x_k x_{k+1} +x_{k+1}^2)\right) - \lambda_4 \right]^2}_{{\mu_4}} \end{aligned} \end{equation*}
\begin{equation*} \begin{aligned} \Rightarrow \alpha {{\sum}}_{c}A_c a_k = \frac{1}{\Lambda^2}\Biggl\{ &\underbrace{\left[\left(\sum_{k=1}^{\nu-1} \frac{a_k}{12}(y_k^2+y_k y_{k+1} +y_{k+1}^2)\right) - \lambda_1\right]^2}_{{\mu_1}} +\\[1ex]& \underbrace{\left[\left(\sum_{k=1}^{\nu-1}\frac{a_k}{24}(x_k y_{k+1}+ 2x_ky_k+2x_{k+1}y_{k+1} +x_{k+1}y_k)\right) - \lambda_2 \right]^2} _{{\mu_2}} + \\[1ex]& \underbrace{\left[\left(\sum_{k=1}^{\nu-1}\frac{a_k}{24}(x_k y_{k+1}+ 2x_ky_k+2x_{k+1}y_{k+1} +x_{k+1}y_k)\right) - \lambda_3 \right]^2} _{{\mu_3}}+\\[1ex]& \underbrace{\left[\left(\sum_{k=1}^{\nu-1}\frac{a_k}{12}(x_k^2+x_k x_{k+1} +x_{k+1}^2)\right) - \lambda_4 \right]^2}_{{\mu_4}}\Bigg\} \end{aligned} \end{equation*}
\begin{equation} ... \end{equation} should be used for display math that consists of a single formula, i.e., has only one equation "number". split can be used within equation, and is recommended (read the documentation, please). so \begin{equation}\label{eq1} \begin{split} H=\langle x_1,x_2,\cdots, x_n \colon & [x_i,x_j,x_k]=1,\\ & [x_i,x_j]^p=1 \rangle. \end{split} \tag{*} \end{equation}
\[ -x^3-x+1=0 \Leftrightarrow x=\sqrt[3]{\frac 12+\sqrt{\frac{31}{108}}}+\sqrt[3]{\frac 12-\sqrt{\frac{31}{108}}}=q\Leftrightarrow -x^3-x+1=(x-q)(-x^2-qx-(q^2+1)) \]
Sommen
Los algebraïsch op (rond indien nodig af op 2 decimalen): a. $x^3 - 3x^2 = 0$ 0 of 3 f. $6x^2 = 4x^9$ 0 of 1,06 b. $4x^5 + 2x^6 = 0$ 0 of -2 g. $x^7 = 5x^7 - x^5$ 0 of 1/2 of -1/2 c. $x^7 = 4x^5$ 0 of 2 of -2 h. $17x^8 - x^6 = x^8$ 0 of 1/4 of -1/4 d. $x^7 - 243x^2 = 0$ 0 of 3 i. $3x^4 + x^7 = x^4 + 5x^7$ 0 of 0,79 e. $x^8 = 125x^5$ 0 of 5 j. $x^2(x^2 + x^5) = 5x^7$ 0 of 0,63 2. Los algebraïsch op: a. $x^4 + 7x^3 + 10x^2 = 0$ 0 of -5 of -2 e. $x^8 = x^7 + 6x^6$ 0 of 3 of -2 b. $x^3 = 2x^2 + 15x$ 0 of 5 of -3 f. $x - √x = 5√x$ 0 of 36 c. $4x^5 - 12x^3 = 8x^4$ 0 of 3 of -1 g. $x2√x - 2x√x = 24√x$ 0 of 6 d. $x - 5√x = 0$ 0 of 25 h. $x^6 + 3x^5 = 10x^4$ 0 of -5 of 2 3. Examenvraagstuk HAVO Wiskunde B, 2005. Gegeven is de functie $f(x) = -x^3 + 27x + 44$ Q is het snijpunt van de grafiek van f met de y-as. De lijn k door Q evenwijdig aan de x-as snijdt de grafiek ook nog in de punten P en R. a. Bereken de lengte van PR. Rond je antwoord af op twee decimalen. 10,39 Een familie van functies is gegeven door $h(x) = (x + 4)(p + 4x - x^2 )$, waarbij p elk reëel getal kan voorstellen. b. Toon aan met behulp van algebra dat er een waarde van p is waarbij de bijbehorende functie h gelijk is aan de functie f. p = 11
Samples
\begin{align} r^{2} &= s^{2} + t^{2} \label{E:eqn1}\\ 2u + 1 &= v + w^{\alpha} \label{E:eqn2}\\ x &= \frac{y + z}{\sqrt{s + 2u}} \label{E:eqn3} \end{align}
\begin{align} \label{E:longInt} h(x) &= \int \left( \frac{ f(x) + g(x) } { 1+ f^{2}(x) } + \frac{ 1+ f(x)g(x) } { \sqrt{1 - \sin x} } \right) \, dx\\ &= \int \frac{ 1 + f(x) } { 1 + g(x) } \, dx - 2 \tan^{-1}(x-2) \notag \end{align}
\begin{align} \label{E:DoAlign} x &= x \wedge (y \vee z) & &\text{(by distributivity)}\\ &= (x \wedge y) \vee (x \wedge z) & &\text{(by condition (M))} \notag\\ &= y \vee z. \notag \end{align}
\[ f(x)= \begin{cases} -x^{2}, &\text{if $x < 0$;}\\ \alpha + x, &\text{if $0 \leq x \leq 1$;}\\ x^{2}, &\text{otherwise.} \end{cases} \]
\emph{Proof.} Since \begin{equation} \label{E:cong2} \langle \dots, 0, \dots, \overset{i}{d}, \dots, 0, \dots \rangle \equiv \langle \dots, 0, \dots, \overset{i}{c}, \dots, 0, \dots \rangle \pmod{\Theta}, \end{equation} and $\Theta$ is a complete congruence relation, it follows from condition~(C) that \begin{align} \label{E:cong} & \langle \dots, \overset{i}{d}, \dots, 0, \dots \rangle \equiv\\ &\qquad \qquad \quad \bigvee ( \langle \dots, 0, \dots, \overset{i}{c}, \dots, 0, \dots \rangle \mid d \leq c<1) \equiv 1 \pmod{\Theta}. \notag \end{align} Let $j \in I$, $j \neq i$, and let $a \in D_{j}^{-}$. Meeting both sides of the congruence \eqref{E:cong2} with $\langle \dots, 0, \dots, \overset{j}{a}, \dots, 0, \dots \rangle$, we obtain \begin{align} \label{E:comp} 0 = & \langle \dots, 0, \dots, \overset{i}{d}, \dots, 0, \dots \rangle \wedge \langle \dots, 0, \dots, \overset{j}{a}, \dots, 0, \dots \rangle \equiv\\ &\langle \dots, 0, \dots, \overset{j}{a}, \dots, 0, \dots \rangle \pmod{\Theta}, \notag \end{align} Using the completeness of $\Theta$ and \eqref{E:comp}, we get: \[ 0 \equiv \bigvee ( \langle \dots, 0, \dots, \overset{j}{a}, \dots, 0,\dots\rangle \mid a \in D_{j}^{-})=1 \pmod{\Theta}, \] hence $\Theta = \iota$.
\begin{equation} \langle \dots, 0, \dots, \overset{i}{d}, \dots, 0, \dots \rangle \equiv \langle \dots, 0, \dots, \overset{i}{c}, \dots, 0, \dots \rangle \pmod{\Theta}, \end{equation}
\begin{equation} \con \vct{i}{d}=\vct{i}{c}(\gQ), \end{equation}
Symbols, etc.
Hebrew letters Type: Print: Type: Print: \[ \aleph ℵ \beth i \daleth k \gimel ג \]
All symbols but \aleph need the amssymb package.
A.2 Greek characters
Type: Print: Type: Print: Type: Print: \[ \alpha α \beta β \gamma γ \digamma z \delta δ \epsilon ² \varepsilon ε \zeta ζ \eta η \theta θ \vartheta ϑ \iota ι \kappa κ \varkappa κ \lambda λ \mu µ \nu ν \xi ξ \pi π \varpi $ \rho ρ \varrho % \sigma σ \varsigma ς \tau τ \upsilon υ \phi φ \varphi ϕ \chi χ \psi ψ \omega ω \]
\digamma and \varkappa require the amssymb package.
 The top part contains the symbols provided by LATEX; the last command, \leadsto, requires the latexsym package. The middle table contains the AMS arrows; they all require the amssymb package. The bottom table lists the negated arrow symbols; they also require amssymb.
#1: Miscellaneous symbols
Type: Print: Type: Print: \[ \hbar ~ \ell ` \] \[ \imath ı \jmath \] \[ \wp ℘ \Re < \] \[ \Im = \partial ∂ \] \[ \infty ∞ \prime 0 \] \[ \emptyset ∅ \backslash \ \] \[ \forall ∀ \exists ∃ \] \[ \smallint ∫ \triangle 4 \] \[ \surd √ \Vert k \] \[ \top > \bot ⊥ \] \[ \P ¶ \S § \] \[ \dag † \ddag ‡ \] \[ \flat [ \natural \ \] \[ \sharp ] \angle ∠ \] \[ \clubsuit ♣ \diamondsuit ♦ \] \[ \heartsuit ♥ \spadesuit ♠ \] \[ \neg ¬ \] \[ \Box ✷ \Diamond ✸ \] \[ \mho ✵ \] \[ \hslash } \complement { \] \[ \backprime 8 \vartriangle M \] \[ \Bbbk k \varnothing ∅ \] \[ \diagup Á \diagdown Â \] \[ \blacktriangle N \blacktriangledown H \] \[ \triangledown O \Game a \] \[ \square ¤ \blacksquare ¥ \] \[ \lozenge ♦ \blacklozenge ¨ \] \[ \measuredangle ] \sphericalangle ^ \] \[ \circledS s \bigstar F \] \[ \Finv ` \eth ð \] \[ \nexists @ \]This table is divided into two parts. The top part contains the symbols provided by LATEX; the last three commands require the latexsym package. The bottom table lists symbols from the AMS; they all require the amssymb package.
#1: Math spacing commands
Short form: Full form: Size: Short form: Full form: \[ \, \thinspace \! \negthinspace \: \medspace \negmedspace \; \thickspace \negthickspace \quad \qquad \]
The \medspace, \thickspace, \negmedspace, and \negthickspace commands require the amsmath package.
#1: Delimiters
Name: Type: Print: Name: Type: Print: \[ Left paren ( ( Right paren ) ) \] \[ Left bracket [ [ Right bracket ] ] \] \[ Left brace \{ { Right brace \} } \] \[ Reverse slash \backslash \ Forward slash / / \] \[ Left angle \langle h Right angle \rangle i \] \[ Vertical line | | Double vert. line \| k \] \[ Left floor \lfloor b Right floor \rfloor c \] \[ Left ceiling \lceil d Right ceiling \rceil e \] \[ Upper left corner \ulcorner p Upper right corner \urcorner q \] \[ Lower left corner \llcorner x Lower right corner \lrcorner y \]The corners require the amsmath package.
Name: Type: Print: \[ Upward arrow \uparrow ↑ \] \[ Double upward arrow \Uparrow ⇑ \] \[ Downward arrow \downarrow ↓ \] \[ Double downward arrow \Downarrow ⇓ \] \[ Up-and-down arrow \updownarrow l \] \[ Double up-and-down arrow \Updownarrow m \]
#1: Operators
\[ \arccos \arcsin \arctan \arg \] \[ \cos \cosh \cot \coth \] \[ \csc \dim \exp \hom \] \[ \ker \lg \ln \log \] \[ \sec \sin \sinh \] \[ \tan \tanh \] \[ \varliminf \varlimsup \varinjlim \varprojlim \]The \var commands require the amsmath package. \[ \det \gcd \inf \injlim \lim \liminf \limsup \max \min \projlim \Pr \sup \]
The \injlim and \projlim commands require the amsmath package.

The \boldsymbol command requires the amsbsy package.
Text symbol tables
#1: Special text characters
Type: Print: Type: Print: Type: Print: \[ \# # \] \[ \$ $ \] \[ \% % \] \[ \& & \] \[ \~{} ˜ \] \[ \_ \] \[ \^{} ˆ \] \[ \{ { \] \[ \} } \] \[ $|$ | \] \[ @ @ \] \[ $*$ ∗ \] \[ $\backslash$ \ \]
#1: Text accents
Type: Print: Type: Print: Type: Print: \[ \‘{o} `o \] \[ \’{o} ´o \] \[ \"{o} ¨o \] \[ \H{o} ˝o \] \[ \^{o} ˆo \] \[ \~{o} ˜o \] \[ \v{o} ˇo \] \[ \u{o} ˘o \] \[ \={o} ¯o \] \[ \b{o} o¯ \] \[ \.{o} o˙ \] \[ \d{o} o. \] \[ \c{o} o¸ \] \[ \r{o} ˚o \] \[ \t{oo} ooÄ \] \[ \i ı \] \[ \j \]
#1: Some European characters
Type: Print: Type: Print: Type: Print: \[ \aa ˚a \] \[ \AA ˚A \] \[ \ae æ \] \[ \AE Æ \] \[ \o ø \] \[ \O Ø \] \[ \oe œ \] \[ \OE Œ \] \[ \l Ãl \] \[ \L LÃ \] \[ \ss ß \] \[ \SS SS \] \[ ?‘ ¿ \] \[ !‘ ¡ \]
#1: Extra text symbols
Type: Print: \[ \dag † \] \[ \ddag ‡ \] \[ \S § \] \[ \P ¶ \] \[ \copyright °c \] \[ \pounds £ \] \[ \textbullet • \] \[ \textvisiblespace \] \[ \textcircled{a} °a \] \[ \textperiodcentered · \]
#1: Text spacing commands
Short form: Full form: Size: Short form: Full form: \[ \, \thinspace \! \negthinspace \: \medspace \negmedspace \; \thickspace \negthickspace \quad \qquad \]
The \medspace, \thickspace, \negmedspace, and \negthickspace commands require the amsmath package.
#1: Text font commands
command with argument command declaration switch to \[ \textnormal{...} {\normalfont ...} document font family \] \[ \textrm{...} {\rmfamily ...} roman font family \] \[ \textsf{...} {\sffamily ...} sans serif font family \] \[ \texttt{...} {\ttfamily ...} typewriter style font family \] \[ \textup{...} {\upshape ...} upright shape \] \[ \textit{...} {\itshape ...} italic shape \] \[ \textsl{...} {\slshape ...} slanted shape \] \[ \textnormal{...} {\normalfont ...} default font \] \[ \textsc{...} {\scshape ...} small capitals \] \[ \emph{...} {\em ...} emphasis \] \[ \textbf{...} {\bfseries ...} bold (extended) \] \[ \textmd{...} {\mdseries ...} normal weight and width \]
#1: Text font size changes
\[ \tiny sample text \scriptsize sample text \footnotesize sample text \small sample text \normalsize sample text \large sample text \Large sample text \LARGE sample text \huge sample text \Huge sample text \]#1: AMS text font size changes
\[ \Tiny \large \tiny \Large \SMALL \normalsize \LARGE \Small \huge \small \Huge \]Samples...
\newcommand {\Rule{0pt}{1em}{.3em}} \begin{array}{|c|c|} \hline X & P(X = i) \\\hline 1 & 1/6 \\\hline 2 & 1/6 \\\hline 3 & 1/6 \\\hline 4 & 1/6 \\\hline 5 & 1/6 \\\hline 6 & 1/6 \\\hline \end{array}
If you want to place an accent on top of an i or a j, however, you need to print them without their dots. You can print a dotless i or j by typing \i and \j. For example, ˘ı is formed by typing \u{\i}. \[ `o \‘{o} ´o \’{o} ˆo \^{o} ˜o \~{o} ¯o \={o} ˙o \.{o} ¨o \"{o} ˚o \r{o} ˘o \u{o} ˇo \v{o} ˝o \H{o} ¸o \c{o} o. \d{o} o¯ \b{o} oo \t{oo} \]
Note that the accent commands that are control symbols (i.e., they consist of just one non-letter) can also be used without braces. For example \^o and \^{o} both produce ˆo.
The special letters that are part of European languages can be generated with the following commands: \[ œ {\oe} Œ {\OE} æ {\ae} Æ {\AE} ˚a {\aa} ˚A {\AA} ø {\o} Ø {\O} ß {\ss} SS {\SS} l {\l} L {\L} ¡ !‘ ¿ ?‘ \]
For example: \[ na\"{\i}ve, r\’esum\’e, {\AA}ngstr{\o}m, se\~norita, stra{\ss}e \]
produces:
na¨ıve, r´esum´e, ˚Angstrøm, se˜norita, straße
Math Accents aˆ \hat{a} aˇ \check{a} a˘ \breve{a} a´ \acute{a} a` \grave{a} a˜ \tilde{a} a¯ \bar{a} ~a \vec{a} a˙ \dot{a} a¨ \ddot{a} xd− y \widehat{x-y} xyz g \widetilde{xyz}
Arrows \[ ← \leftarrow \] \[ ←− \longleftarrow \] \[ ↑ \uparrow \] \[ ⇐ \Leftarrow \] \[ ⇐= \Longleftarrow \] \[ ⇑ \Uparrow \] \[ → \rightarrow \] \[ −→ \longrightarrow \] \[ ↓ \downarrow \] \[ ⇒ \Rightarrow \] \[ =⇒ \Longrightarrow \] \[ ⇓ \Downarrow \] \[ ↔ \leftrightarrow \] \[ ←→\longleftrightarrow \] \[ l \updownarrow \] \[ ⇔ \Leftrightarrow \] \[ ⇐⇒\Longleftrightarrow \] \[ m \Updownarrow \] \[ 7→ \mapsto \] \[ 7−→ \longmapsto \] \[ % \nearrow \] \[ ←- \hookleftarrow \] \[ ,→ \hookrightarrow \] \[ & \searrow \] \[ ( \leftharpoonup \] \[ * \rightharpoonup \] \[ . \swarrow \] \[ ) \leftharpoondown \] \[ + \rightharpoondown \] \[ - \nwarrow \] \[ *) \rightleftharpoons \] \[ ❀ \leadsto \]
The symbols whose names are underlined require the latexsym package.
#1: Samples...
\begin{equation} \label{eq1} \begin{split} A & = \frac{\pi r^2}{2} \\ & = \frac{1}{2} \pi r^2 \end{split} \end{equation}
\begin{equation} \label{eu_eqn} e^{\pi i} + 1 = 0 \end{equation} The beautiful equation \ref{eu_eqn} is known as the Euler equation
\begin{multline*} p(x) = 3x^6 + 14x^5y + 590x^4y^2 + 19x^3y^3\\ - 12x^2y^4 - 12xy^5 + 2y^6 - a^3b^3 \end{multline*}
\begin{multline} p(x) = 3x^6 + 14x^5y + 590x^4y^2 + 19x^3y^3\\ - 12x^2y^4 - 12xy^5 + 2y^6 - a^3b^3 \end{multline}
\begin{align*} 2x - 5y &= 8 \\ 3x + 9y &= -12 \end{align*}
\begin{align*} x&=y & w &=z & a&=b+c\\ 2x&=-y & 3w&=\frac{1}{2}z & a&=b\\ -4 + 5x&=2+y & w+2&=-1+w & ab&=cb \end{align*}
\begin{gather*} 2x - 5y = 8 \\ 3x^2 + 9y = 3a + c \end{gather*}
\[ \left \{ \begin{tabular}{ccc} 1 & 5 & 8 \\ 0 & 2 & 4 \\ 3 & 3 & -8 \end{tabular} \right \} \]
Manually sized brackets \[ \Bigg \langle 3x+7 \bigg \rangle \]
#1: Reference guide
LATEX markup Renders as \[ \big( \Big( \bigg( \Bigg( \big( \Big( \bigg( \Bigg( \big. \] \[ \big] \Big] \bigg] \Bigg] \big] \Big] \bigg] \Bigg] \] \[ \big\{ \Big\{ \bigg\{ \Bigg\{ \big\{ \Big\{ \bigg\{ \Bigg\{ \] \[ \big \langle \Big \langle \bigg \langle \Bigg \langle \big \langle \Big \langle \bigg \langle \Bigg \langle \] \[ \big \rangle \Big \rangle \bigg \rangle \Bigg \rangle \big \rangle \Big \rangle \bigg \rangle \Bigg \rangle \]\[ \int\limits_0^1 x^2 + y^2 \ dx \]
\[ a_1^2 + a_2^2 = a_3^2 \]
\[ x^{2 \alpha} - 1 = y_{ij} + y_{ij} \]
\[ (a^n)^{r+s} = a^{nr+ns} \]
\[ \sum_{i=1}^{\infty} \frac{1}{n^s} = \prod_p \frac{1}{1 - p^{-s}} \]
#1: Reference guide
Additional examples and operators LATEX markup Renders as \[ a_{n_i} a_{n_i} \] \[ \int_{i=1}^n \int_{i=1}^{n} \] \[ \sum_{i=1}^{\infty} \sum_{i=1}^{\infty} \] \[ \prod_{i=1}^n \prod_{i=1}^n \] \[ \cup_{i=1}^n \cup_{i=1}^n \] \[ \cap_{i=1}^n \cap_{i=1}^n \] \[ \oint_{i=1}^n \oint_{i=1}^n \] \[ \coprod_{i=1}^n \coprod_{i=1}^n \]$\int\frac{1}{2}dx - \mathlarger{ \int\frac{1}{2}dx}$
Integral $\int_{a}^{b} x^2 dx$ inside text
Improved integral $\int\limits_{a}^{b} x^2 dx$ inside text
Sum $\sum_{n=1}^{\infty} 2^{-n} = 1$ inside text
Improved sum $\sum\limits_{n=1}^{\infty} 2^{-n} = 1$ inside text
Limit $\lim_{x\to\infty} f(x)$ inside text
$$\lim_{x\to\infty} f(x)$$
$\iint_V \mu(u,v) \,du\,dv$$ $$\iiint_V \mu(u,v,w) \,du\,dv\,dw$$ $$\iiiint_V \mu(t,u,v,w) \,dt\,du\,dv\,dw$$ $$\idotsint_V \mu(u_1,\dots,u_k) \,du_1 \dots du_k$$ $$\oint_V f(s) \,ds$$ $$\oiint_V f(s,t) \,ds\,dt$$
Fractions and related...
\[ \binom{n}{k} = \frac{n!}{k!(n-k)!} \]
Fractions can be used alongside the text, for example \( \frac{1}{2} \), and in a mathematical display style like the one below: \[\frac{1}{2}\]
When displaying fractions in-line, for example \(\frac{3x}{2}\) you can set a different display style: \( \displaystyle \frac{3x}{2} \).
This is also true the other way around \[ f(x)=\frac{P(x)}{Q(x)} \ \ \textrm{and} \ \ f(x)=\textstyle\frac{P(x)}{Q(x)} \]
Continued fractions
The usage of fractions is quite flexible, they can be nested to obtain more complex expressions.
The fractions can be nested \[ \frac{1+\frac{a}{b}}{1+\frac{1}{1+\frac{1}{a}}} \]
Now a wild example \[ a_0+\cfrac{1}{a_1+\cfrac{1}{a_2+\cfrac{1}{a_3+\cdots}}} \]
Final example \[ \newcommand*{\contfrac}[2]{% { \rlap{$\dfrac{1}{\phantom{#1}}$}% \genfrac{}{}{0pt}{0}{}{#1+#2}% } } \[ a_0 + \contfrac{a_1}{ \contfrac{a_2}{ \contfrac{a_3}{ \genfrac{}{}{0pt}{0}{}{\ddots} }}} \] \]
#1: Samples
Let \( \mathcal{T} \) be a topological space, a basis is defined as \[ \mathcal{B} = \{B_{\alpha} \in \mathcal{T}\, |\, U = \bigcup B_{\alpha} \forall U \in \mathcal{T} \} \]
\begin{align*} RQSZ \\ \mathcal{RQSZ} \\ \mathfrak{RQSZ} \\ \mathbb{RQSZ} \end{align*}
\begin{align*} 3x^2 \in R \subset Q \\ \mathnormal{3x^2 \in R \subset Q} \\ \mathrm{3x^2 \in R \subset Q} \\ \mathit{3x^2 \in R \subset Q} \\ \mathbf{3x^2 \in R \subset Q} \\ \mathsf{3x^2 \in R \subset Q} \\ \mathtt{3x^2 \in R \subset Q} \end{align*}
\[ \text{ Some of the \textbf{greatest} discoveries in \underline{science} were made by \textbf{\textit{accident}}. } \]
\[ \text{ Some of the greatest \emph{discoveries} in science were made by accident. } \] \[ \textit{Some of the greatest \emph{discoveries} in science were made by accident.} \] \[ \textbf{Some of the greatest \emph{discoveries} in science were made by accident.} \]
#1: Examples of mathematical operators
\[ \sin(a + b ) = \sin(a)\cos(b) + \cos(a)\sin(a) \]Testing notation for limits \[ \lim_{h \rightarrow 0 } \frac{f(x+h)-f(x)}{h} \] This operator changes when used alongside text \( \lim_{x \rightarrow h} (x-h) \).
User-defined operator for matrices with Real entries \[ x \in \Mr \]
Assume we have the next sets \[ S = \{ z \in \mathbb{C}\, |\, |z| < 1 \} \quad \textrm{and} \quad S_2=\partial{S} \]
#1: Spaces in mathematical mode.
\begin{align*} f(x) =& x^2\! +3x\! +2 \\ f(x) =& x^2+3x+2 \\ f(x) =& x^2\, +3x\, +2 \\ f(x) =& x^2\: +3x\: +2 \\ f(x) =& x^2\; +3x\; +2 \\ f(x) =& x^2\ +3x\ +2 \\ f(x) =& x^2\quad +3x\quad +2 \\ f(x) =& x^2\qquad +3x\qquad +2 \end{align*}\begin{align*} 3ax+4by=5cz\\ 3ax<4by+5cz \end{align*}
\begin{align*} 34x^2a \mathbin{\#} 13bc \\ 34x^2a \mathrel{\#} 13bc \end{align*}
Description of spacing commands LATEX code Description \[ \quad \text{space equal to the current font size (= 18 mu)} \] \[ \, \text{3/18 of \quad (= 3 mu)} \] \[ \: \text{4/18 of \quad (= 4 mu)} \] \[ \; \text{5/18 of \quad (= 5 mu)} \] \[ \! \text{-3/18 of \quad (= -3 mu)} \] \[ \ \text{(space after backslash!) equivalent of space in normal text} \] \[ \qquad \text{twice of \quad (= 36 mu)} \]
#1: Samples
Depending on the value of $x$ the equation \( f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \) may diverge or converge. \[ f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \]
In-line maths elements can be set with a different style: \(f(x) = \displaystyle \frac{1}{1+x}\). The same is true the other way around: \[ \begin{eqnarray*} f(x) = \sum_{i=0}^{n} \frac{a_i}{1+x} \\ \textstyle f(x) = \textstyle \sum_{i=0}^{n} \frac{a_i}{1+x} \\ \scriptstyle f(x) = \scriptstyle \sum_{i=0}^{n} \frac{a_i}{1+x} \\ \scriptscriptstyle f(x) = \scriptscriptstyle \sum_{i=0}^{n} \frac{a_i}{1+x} \end{eqnarray*} \]
For certain operators such as limits, the subscript is placed underneath the operator: \begin{equation} \lim_{x \to \infty} \exp(-x) = 0 \end{equation} \begin{equation} {\displaystyle \lim _{x\to \infty }\exp(-x)=0} \end{equation}
For the modular operator there are two commands: \bmod and \pmod: \begin{equation} a \bmod b \end{equation} \begin{equation} {\displaystyle a\,{\bmod {\,}}b\,} \end{equation} \begin{equation} x \equiv a \pmod{b} \end{equation} \begin{equation} {\displaystyle x\equiv a{\pmod {b}}\,} \end{equation}
\begin{equation} k_{n+1} = n^2 + k_n^2 - k_{n-1} \end{equation} \begin{equation} {\displaystyle k_{n+1}=n^{2}+k_{n}^{2}-k_{n-1}\,} \end{equation}
For powers with more than one digit, surround the power with {}. \begin{equation} n^{22} \end{equation} \begin{equation} {\displaystyle n^{22}\,} \end{equation}
An underscore (_) can be used with a vertical bar (|) to denote evaluation using subscript notation in mathematics: \begin{equation} f(n) = n^5 + 4n^2 + 2 |_{n=17} \end{equation} \begin{equation} {\displaystyle f(n)=n^{5}+4n^{2}+2|_{n=17}\,} \end{equation}
\begin{equation} \frac{n!}{k!(n-k)!} = \binom{n}{k} \end{equation} \begin{equation} {\displaystyle {\frac {n!}{k!(n-k)!}}={\binom {n}{k}}} \end{equation}
You can embed fractions within fractions: \begin{equation} \frac{\frac{1}{x}+\frac{1}{y}}{y-z} \end{equation} \begin{equation} {\displaystyle {\frac {{\frac {1}{x}}+{\frac {1}{y}}}{y-z}}} \end{equation}
Note that when appearing inside another fraction, or in inline text ${\displaystyle {\tfrac {a}{b}}}$, a fraction is noticeably smaller than in displayed mathematics. The \tfrac and \dfrac commands force the use of the respective styles, \textstyle and \displaystyle. Similarly, the \tbinom and \dbinom commands typeset the binomial coefficient.
For relatively simple fractions, especially within the text, it may be more aesthetically pleasing to use powers and indices: \begin{equation} ^3/_7 \end{equation} \begin{equation} {\displaystyle ^{3}/_{7}\,} \end{equation}
If this looks a little "loose" (overspaced), a tightened version can be defined by inserting some negative space \begin{equation} % running fraction with slash - requires math mode. \newcommand{\rfrac}[2]{{}^{#1}\!/_{#2}} \rfrac{3}{7} \end{equation} or \begin{equation} {\displaystyle {{}^{3}\!/_{7}}} \end{equation}
If you use them throughout the document, usage of xfrac package is recommended. This package provides \sfrac command to create slanted fractions. Usage:
\begin{equation} % running fraction with slash - requires math mode. \newcommand{\sfrac}[2]{{}^{#1}\!/_{#2}} \sfrac{3}{7} \end{equation}
Take $\sfrac{1}{2}$ cup of sugar, $\dots$ \[ 3\times\sfrac{1}{2}=1\sfrac{1}{2} \] alt without \sfrac: \[ Take ${}^1/_2$ cup of sugar, \dots \] \[ 3\times{}^1/_2=1{}^1/_2 \]
If fractions are used as an exponent curly braces have to be used around the \sfrac command: \begin{equation} x^\frac{1}{2} % no error \end{equation} \begin{equation} x^\sfrac{1}{2} % error \end{equation} \begin{equation} x^{\sfrac{1}{2}} % no error \end{equation} \begin{equation} x^\frac{1}{2} % no error \end{equation} \begin{equation} {\displaystyle x^{\frac {1}{2}}} \end{equation}
In some cases, using the package alone will result in errors about certain font shapes not being available. In that case, the lmodern and fix-cm packages need to be added as well.
Alternatively, the nicefrac package provides the \nicefrac command, whose usage is similar to \sfrac.
Continued fractions
Continued fractions should be written using \cfrac command: \begin{equation} x = a_0 + \cfrac{12356616316}{a_3 + \cfrac{16565}{a_3 + \cfrac{165465465}{a_9 + \cfrac{1131321}{a_7} } } } \end{equation} \begin{equation} {\displaystyle x=a_{0}+{\cfrac {1}{a_{1}+{\cfrac {1}{a_{2}+{\cfrac {1}{a_{3}+{\cfrac {1}{a_{4}}}}}}}}}} \end{equation}
Multiplication of two numbers
To make multiplication visually similar to a fraction, a nested array can be used, for example multiplication of numbers written one below the other. \begin{equation} \frac{ \begin{array}[b]{r} \left( x_1 x_2 \right)\\ \times \left( x'_1 x'_2 \right) \end{array} }{ \left( y_1y_2y_3y_4 \right) } \end{equation} \begin{equation} {\displaystyle {\frac {\begin{array}{r}\left(x_{1}x_{2}\right)\\\times \left(x'_{1}x'_{2}\right)\end{array}}{\left(y_{1}y_{2}y_{3}y_{4}\right)}}} \end{equation}
Roots
The \sqrt command creates a square root surrounding an expression. It accepts an optional argument specified in square brackets ([ and ]) to change magnitude: \begin{equation} \sqrt{\frac{a}{b}} \end{equation} \begin{equation} {\displaystyle {\sqrt {\frac {a}{b}}}} \end{equation} \begin{equation} \sqrt[n]{1+x+x^2+x^3+\dots+x^n} \end{equation} \begin{equation} {\displaystyle {\sqrt[{n}]{1+x+x^{2}+x^{3}+\dots +x^{n}}}} \end{equation}
#1: Sums and integrals
The \sum and \int commands insert the sum and integral symbols respectively, with limits specified using the caret (^) and underscore (_). The typical notation for sums is: \begin{equation} \sum_{i=1}^{10} t_i \end{equation} \begin{equation} {\displaystyle \textstyle \sum _{i=1}^{10}t_{i}\,} \end{equation} or \begin{equation} \displaystyle\sum_{i=1}^{10} t_i \end{equation} \begin{equation} {\displaystyle \displaystyle \sum _{i=1}^{10}t_{i}\,} \end{equation}
The limits for the integrals follow the same notation. It's also important to represent the integration variables with an upright d, which in math mode is obtained through the \mathrm{} command, and with a small space separating it from the integrand, which is attained with the \, command. \begin{equation} \int_0^\infty \mathrm{e}^{-x}\,\mathrm{d}x \end{equation} \begin{equation} {\displaystyle \int _{0}^{\infty }\mathrm {e} ^{-x}\,\mathrm {d} x\,} \end{equation}
There are many other "big" commands which operate in a similar manner: \begin{equation} \sum \end{equation} \begin{equation} {\displaystyle \sum \,} \end{equation} \begin{equation} \prod \end{equation} \begin{equation} {\displaystyle \prod } \end{equation} \begin{equation} \coprod \end{equation} \begin{equation} {\displaystyle \coprod } \end{equation} \begin{equation} \bigoplus \end{equation} \begin{equation} {\displaystyle \bigoplus } \end{equation} \begin{equation} \bigotimes \end{equation} \begin{equation} {\displaystyle \bigotimes } \end{equation} \begin{equation} \bigodot \end{equation} \begin{equation} {\displaystyle \bigodot } \end{equation} \begin{equation} \bigcup \end{equation} \begin{equation} {\displaystyle \bigcup } \end{equation} \begin{equation} \bigcap \end{equation} \begin{equation} {\displaystyle \bigcap } \end{equation} \begin{equation} \biguplus \end{equation} \begin{equation} {\displaystyle \biguplus } \end{equation} \begin{equation} \bigsqcup \end{equation} \begin{equation} {\displaystyle \bigsqcup } \end{equation} \begin{equation} \bigvee \end{equation} \begin{equation} {\displaystyle \bigvee } \end{equation} \begin{equation} \bigwedge \end{equation} \begin{equation} {\displaystyle \bigwedge } \end{equation} \begin{equation} \int \end{equation} \begin{equation} {\displaystyle \int } \end{equation} \begin{equation} \oint \end{equation} \begin{equation} {\displaystyle \oint } \end{equation} \begin{equation} \iint \end{equation} \begin{equation} {\displaystyle \iint } \end{equation} \begin{equation} \iiint \end{equation} \begin{equation} {\displaystyle \iiint } \end{equation} \begin{equation} \iiiint \end{equation} \begin{equation} {\displaystyle \iiiint } \end{equation} \begin{equation} \idotsint \end{equation} \begin{equation} {\displaystyle \int \!\cdots \!\int } \end{equation}
For more integral symbols, including those not included by default in the Computer Modern font, try the esint package.
#1: Samples
The \substack command allows the use of \\ to write the limits over multiple lines: \begin{equation} { \sum_{\substack{ 0<i<m \\ 0<j<n }} P(i,j) } \end{equation} \begin{equation} {\displaystyle \sum _{\overset {\scriptstyle 0<i<m}{\scriptstyle 0<j<n}}P(i,j)\,} \end{equation}
If you want the limits of an integral to be specified above and below the symbol (like the sum), use the \limits command: \begin{equation} \int\limits_a^b \end{equation} \begin{equation} {\displaystyle \int \limits _{a}^{b}\,} \end{equation}
Brackets, braces and delimiters
How to use braces in multi line equations is described in the Advanced Mathematics chapter.
The use of delimiters such as brackets soon becomes important when dealing with anything but the most trivial equations. Without them, formulas can become ambiguous. Also, special types of mathematical structures, such as matrices, typically rely on delimiters to enclose them.
There are a variety of delimiters available for use in LaTeX: \begin{equation} ( a ), [ b ], \{ c \}, | d |, \| e \|, \langle f \rangle, \lfloor g \rfloor, \lceil h \rceil, \ulcorner i \urcorner \end{equation} \begin{equation} {\displaystyle (a),[b],\{c\},|d|,\|e\|,\langle f\rangle ,\lfloor g\rfloor ,\lceil h\rceil ,\ulcorner i\urcorner } \end{equation} where \lbrack and \rbrack may be used in place of [ and ].
Automatic sizing
Very often mathematical features will differ in size, in which case the delimiters surrounding the expression should vary accordingly. This can be done automatically using the \left, \right, and \middle commands. Any of the previous delimiters may be used in combination with these: \begin{equation} \left(\frac{x^2}{y^3}\right) \end{equation} \begin{equation} {\displaystyle \left({\frac {x^{2}}{y^{3}}}\right)\,} \end{equation} \begin{equation} P\left(A=2\middle|\frac{A^2}{B}>4\right) \end{equation}
Curly braces are defined differently by using \left\{ and \right\}, \begin{equation} \left\{\frac{x^2}{y^3}\right\} \end{equation} \begin{equation} {\displaystyle \left\{{\frac {x^{2}}{y^{3}}}\right\}\,} \end{equation}
If a delimiter on only one side of an expression is required, then an invisible delimiter on the other side may be denoted using a period (.). \begin{equation} \left.\frac{x^3}{3}\right|_0^1 \end{equation} \begin{equation} {\displaystyle \left.{\frac {x^{3}}{3}}\right|_{0}^{1}\,} \end{equation}
#1: Manual sizing
In certain cases, the sizing produced by the \left and \right commands may not be desirable, or you may simply want finer control over the delimiter sizes. In this case, the \big, \Big, \bigg and \Bigg modifier commands may be used: \begin{equation} ( \big( \Big( \bigg( \Bigg( \end{equation} \begin{equation} {\displaystyle ({\big (}{\Big (}{\bigg (}{\Bigg (}\,} \end{equation}
These commands are primarily useful when dealing with nested delimiters. For example, when typesetting \begin{equation} \frac{\mathrm d}{\mathrm d x} \left( k g(x) \right) \end{equation} \begin{equation} {\displaystyle {\frac {\mathrm {d} }{\mathrm {d} x}}\left(kg(x)\right)} \end{equation} we notice that the \left and \right commands produce the same size delimiters as those nested within it. This can be difficult to read. To fix this, we write \begin{equation} \frac{\mathrm d}{\mathrm d x} \big( k g(x) \big) \end{equation} \begin{equation} {\displaystyle {\frac {\mathrm {d} }{\mathrm {d} x}}{\big (}kg(x){\big )}} \end{equation}
#1: Typesetting intervals
To denote open and half-open intervals, the notations ]a,b[, (a,b), ]a,b], (a,b], [a,b[ and [a,b) are used. If the square bracket notation is used, then the interval must be put between curly braces ({ and }) in order to have correct spacing. Similarly, if a (half-)open interval starts with a negative number, then the number including its minus-symbol must also be put between curly brackets, so that LaTeX understands that the minus-symbol is the unary operation. Compare: \begin{equation} x \in [-1,1] \end{equation} \begin{equation} {\displaystyle x\in [-1,1]} \end{equation} \begin{equation} x \in {[-1,1]} \end{equation} \begin{equation} {\displaystyle x\in {[-1,1]}} \end{equation} \begin{equation} x \in {[{-1},1]} \end{equation} \begin{equation} {\displaystyle x\in {[{-1},1]}} \end{equation}
Matrices and arrays
A basic matrix may be created using the matrix environment: in common with other table-like structures, entries are specified by row, with columns separated using an ampersand (&) and a new rows separated with a double backslash (\\) \begin{equation} { \begin{matrix} a & b & c \\ d & e & f \\ g & h & i \end{matrix} } \end{equation} \begin{equation} {\displaystyle {\begin{matrix}a&b&c\\d&e&f\\g&h&i\end{matrix}}} \end{equation}
To specify alignment of columns in the table, use starred version: \begin{equation} { \begin{matrix} -1 & 3 \\ 2 & -4 \end{matrix} = \begin{matrix*}[r] -1 & 3 \\ 2 & -4 \end{matrix*} } \end{equation} \begin{equation} {\displaystyle {\begin{matrix}-1&3\\2&-4\end{matrix}}={\begin{matrix}-1&\,\;\;3\\\,\;\;2&-4\end{matrix}}} \end{equation}
The alignment by default is c but it can be any column type valid in array environment.
However matrices are usually enclosed in delimiters of some kind, and while it is possible to use the \left and \right commands, there are various other predefined environments which automatically include delimiters:
Environment name | Surrounding delimiter | Notes ----------------- (\,) centers columns by default \begin{equation} pmatrix {\displaystyle (\,)} \end{equation} (\,) allows to specify alignment of columns in optional parameter \begin{equation} pmatrix* {\displaystyle (\,)} \end{equation} [\,] centers columns by default \begin{equation} bmatrix {\displaystyle [\,]} \end{equation} [\,] allows to specify alignment of columns in optional parameter \begin{equation} bmatrix* {\displaystyle [\,]} \end{equation} \{\,\} centers columns by default \begin{equation} Bmatrix {\displaystyle \{\,\}} \end{equation} \{\,\} allows to specify alignment of columns in optional parameter \begin{equation} Bmatrix* {\displaystyle \{\,\}} \end{equation} |\,| centers columns by default \begin{equation} vmatrix {\displaystyle |\,|} \end{equation} |\,| allows to specify alignment of columns in optional parameter \begin{equation} vmatrix* {\displaystyle |\,|} \end{equation} \|\,\| centers columns by default \begin{equation} Vmatrix {\displaystyle \|\,\|} \end{equation} \|\,\| allows to specify alignment of colums in optional parameter \begin{equation} Vmatrix* {\displaystyle \|\,\|} \end{equation}
When writing down arbitrary sized matrices, it is common to use horizontal, vertical and diagonal triplets of dots (known as ellipses) to fill in certain columns and rows. These can be specified using the \cdots, \vdots and \ddots respectively: \begin{equation} A_{m,n} = \begin{pmatrix} a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\ a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m,1} & a_{m,2} & \cdots & a_{m,n} \end{pmatrix} \end{equation} \begin{equation} {\displaystyle A_{m,n}={\begin{pmatrix}a_{1,1}&a_{1,2}&\cdots &a_{1,n}\\a_{2,1}&a_{2,2}&\cdots &a_{2,n}\\\vdots &\vdots &\ddots &\vdots \\a_{m,1}&a_{m,2}&\cdots &a_{m,n}\end{pmatrix}}} \end{equation}
In some cases you may want to have finer control of the alignment within each column, or want to insert lines between columns or rows. This can be achieved using the array environment, which is essentially a math-mode version of the tabular environment, which requires that the columns be pre-specified: \begin{equation} \begin{array}{c|c} 1 & 2 \\ \hline 3 & 4 \end{array} \end{equation} \begin{equation} {\displaystyle {\begin{array}{c|c}1&2\\\hline 3&4\end{array}}} \end{equation}
You may see that the AMS matrix class of environments doesn't leave enough space when used together with fractions resulting in output similar to this: \begin{equation} {\displaystyle M={\begin{bmatrix}{\frac {5}{6}}&{\frac {1}{6}}&0\\{\frac {5}{6}}&0&{\frac {1}{6}}\\0&{\frac {5}{6}}&{\frac {1}{6}}\end{bmatrix}}} \end{equation} \begin{equation} M={\begin{bmatrix}{\frac {5}{6}}&{\frac {1}{6}}&0\\{\frac {5}{6}}&0&{\frac {1}{6}}\\0&{\frac {5}{6}}&{\frac {1}{6}}\end{bmatrix}} \end{equation}
To counteract this problem, add additional leading space with the optional parameter to the \\ command: \begin{equation} M = \begin{bmatrix} \frac{5}{6} & \frac{1}{6} & 0 \\[0.3em] \frac{5}{6} & 0 & \frac{1}{6} \\[0.3em] 0 & \frac{5}{6} & \frac{1}{6} \end{bmatrix} \end{equation} \begin{equation} {\displaystyle M={\begin{bmatrix}{\frac {5}{6}}&{\frac {1}{6}}&0\\[0.3em]{\frac {5}{6}}&0&{\frac {1}{6}}\\[0.3em]0&{\frac {5}{6}}&{\frac {1}{6}}\end{bmatrix}}} \end{equation}
If you need "border" or "indexes" on your matrix, plain TeX provides the macro \bordermatrix \begin{equation} M = \bordermatrix{~ & x & y \cr A & 1 & 0 \cr B & 0 & 1 \cr} \end{equation}
Matrices in running text
To insert a small matrix, and not increase leading in the line containing it, use smallmatrix environment:
A matrix in text must be set smaller: $\bigl(\begin{smallmatrix} a&b \\ c&d \end{smallmatrix} \bigr)$ to not increase leading in a portion of text.
#1: Adding text to equations
The math environment differs from the text environment in the representation of text. Here is an example of trying to represent text within the math environment: \begin{equation} 50 apples \times 100 apples = lots of apples^2 \end{equation} \begin{equation} {\displaystyle 50apples\times 100apples=lotsofapples^{2}\,} \end{equation}
There are two noticeable problems: there are no spaces between words or numbers, and the letters are italicized and more spaced out than normal. Both issues are simply artifacts of the maths mode, in that it treats it as a mathematical expression: spaces are ignored (LaTeX spaces mathematics according to its own rules), and each character is a separate element (so are not positioned as closely as normal text).
There are a number of ways that text can be added properly. The typical way is to wrap the text with the \text{...} command (a similar command is \mbox{...}, though this causes problems with subscripts, and has a less descriptive name). Let's see what happens when the above equation code is adapted: \begin{equation} 50 \text{apples} \times 100 \text{apples} = \text{lots of apples}^2 \end{equation} \begin{equation} {\displaystyle 50{\text{apples}}\times 100{\text{apples}}={\text{lots of apples}}^{2}\,} \end{equation}
The text looks better. However, there are no gaps between the numbers and the words. Unfortunately, you are required to explicitly add these. There are many ways to add spaces between maths elements, but for the sake of simplicity we may simply insert space characters into the \text commands. \begin{equation} 50 \text{ apples} \times 100 \text{ apples} = \text{lots of apples}^2 \end{equation} \begin{equation} {\displaystyle 50{\text{ apples}}\times 100{\text{ apples}}={\text{lots of apples}}^{2}\,} \end{equation}
Formatted text
Using the \text is fine and gets the basic result. Yet, there is an alternative that offers a little more flexibility. You may recall the introduction of font formatting commands, such as \textrm, \textit, \textbf, etc. These commands format the argument accordingly, e.g., \textbf{bold text} gives bold text. These commands are equally valid within a maths environment to include text. The added benefit here is that you can have better control over the font formatting, rather than the standard text achieved with \text. \begin{equation} 50 \textrm{ apples} \times 100 \textbf{ apples} = \textit{lots of apples}^2 \end{equation} \begin{equation} {\displaystyle 50\;{\textrm {apples}}\times 100\;{\textbf {apples}}={\textit {lotsofapples}}^{2}\,} \end{equation}
#1: Formatting mathematics symbols
See also: w:Mathematical Alphanumeric Symbols, w:Help:Displaying a formula#Alphabets and typefaces and w:Wikipedia:LaTeX symbols#Fonts
We can now format text; what about formatting mathematical expressions? There are a set of formatting commands very similar to the font formatting ones just used, except that they are specifically aimed at text in math mode (requires amsfonts) LaTeX command | Sample | Description | Common use ----------------- ABCDEF~abcdef~123456\, The default math font Most mathematical notation \begin{equation} \mathnormal{…} \text{(or simply omit any command)} {\displaystyle ABCDEF~abcdef~123456\,} \end{equation} \mathnormal{ABCDEF~abcdef~123456\,} The default math font Most mathematical notation \begin{equation} \mathnormal{…} \mathnormal{\displaystyle ABCDEF~abcdef~123456\,} \end{equation} \mathrm {ABCDEF~abcdef~123456} \, This is the default or normal font, unitalicised Units of measurement, one word functions \begin{equation} \mathrm{…} {\displaystyle \mathrm {ABCDEF~abcdef~123456} \,} \end{equation} {\mathit {ABCDEF~abcdef~123456}}\, Italicised font Multi-letter function or variable names. Compared to \mathnormal, words are spaced more naturally and numbers are italicized as well. \begin{equation} \mathit{…} {\displaystyle {\mathit {ABCDEF~abcdef~123456}}\,} \end{equation} \mathbf {ABCDEF~abcdef~123456} \, Bold font Vectors \begin{equation} \mathbf{…} {\displaystyle \mathbf {ABCDEF~abcdef~123456} \,} \end{equation} {\mathsf {ABCDEF~abcdef~123456}}\, Sans-serif \begin{equation} \mathsf{…} {\displaystyle {\mathsf {ABCDEF~abcdef~123456}}\,} \end{equation} {\mathtt {ABCDEF~abcdef~123456}}\, Monospace (fixed-width) font \begin{equation} \mathtt{…} {\displaystyle {\mathtt {ABCDEF~abcdef~123456}}\,} \end{equation} {\mathfrak {ABCDEF~abcdef~123456}}\, Fraktur Almost canonical font for Lie algebras, ideals in ring theory \begin{equation} \mathfrak{…} {\displaystyle {\mathfrak {ABCDEF~abcdef~123456}}\,} \end{equation} {\mathcal {ABCDEF}}\, Calligraphy (uppercase only) Often used for sheaves/schemes and categories, used to denote cryptological concepts like an alphabet of definition ( ${\displaystyle {\mathcal {A}}}$ {\mathcal {A}}), message space ( ${\displaystyle {\mathcal {M}}}$ {\mathcal {M}}), ciphertext space ( ${\displaystyle {\mathcal {C}}}$ {\mathcal {C}}) and key space ( ${\displaystyle {\mathcal {K}}}$ {\mathcal {K}}); Kleene's ${\displaystyle {\mathcal {O}}}$ {\mathcal {O}}; naming convention in description logic; Laplace transform ( ${\displaystyle {\mathcal {L}}}$ {\mathcal {L}}) and Fourier transform ( ${\displaystyle {\mathcal {F}}}$ {\mathcal {F}}) \begin{equation} \mathcal{…} {\displaystyle {\mathcal {ABCDEF}}\,} \end{equation} \mathbb {ABCDEF} \, Blackboard bold (uppercase only) Used to denote special sets (e.g. real numbers) (requires the amsfonts or amssymb package) \begin{equation} \mathbb{…} {\displaystyle \mathbb {ABCDEF} \,} \end{equation} \begin{equation} \mathscr{…} \end{equation} \mathscr{…} (requires the mathrsfs package) Script (uppercase only) An alternative font for categories and sheaves. These formatting commands can be wrapped around the entire equation, and not just on the textual elements: they only format letters, numbers, and uppercase Greek, and other math commands are unaffected.
To bold lowercase Greek or other symbols use the \boldsymbol command; this will only work if there exists a bold version of the symbol in the current font. As a last resort there is the \pmb command (poor mans bold): this prints multiple versions of the character slightly offset against each other. \begin{equation} \boldsymbol{\beta} = (\beta_1,\beta_2,\dotsc,\beta_n) \end{equation} \begin{equation} {\displaystyle {\boldsymbol {\beta }}=(\beta _{1},\beta _{2},\dotsc ,\beta _{n})\,} {\boldsymbol {\beta }}=(\beta _{1},\beta _{2},\dotsc ,\beta _{n})\, \end{equation}
To change the size of the fonts in math mode, see Changing font size.
#1: Accents
So what to do when you run out of symbols and fonts?  For example, \begin{equation} k = {\color{red}x} \mathbin{\color{blue}-} 2 \end{equation} \begin{equation} {\displaystyle k={\color {green}x}{\mathbin {\color {blue}-}}2} \end{equation}
The only problem is that this disrupts the default LATEX formatting around the - operator. To fix this, we enclose it in a \mathbin environment, since - is a binary operator. This process is described here.
Plus and minus signs
LaTeX deals with the + and − signs in two possible ways. The most common is as a binary operator. When two maths elements appear on either side of the sign, it is assumed to be a binary operator, and as such, allocates some space to either side of the sign. The alternative way is a sign designation. This is when you state whether a mathematical quantity is either positive or negative. This is common for the latter, as in math, such elements are assumed to be positive unless a − is prefixed to it. In this instance, you want the sign to appear close to the appropriate element to show their association. If you put a + or a − with nothing before it but you want it to be handled like a binary operator you can add an invisible character before the operator using {}. This can be useful if you are writing multiple-line formulas, and a new line could start with a = or a +, for example, then you can fix some strange alignments adding the invisible character where necessary.
A plus-minus sign is written as: \begin{equation} \pm \end{equation} \begin{equation} {\displaystyle \pm } \end{equation}
Similarly, there exists also a minus-plus sign: \begin{equation} \mp \end{equation} \begin{equation} {\displaystyle \mp } \end{equation}
Controlling horizontal spacing
LaTeX is obviously pretty good at typesetting maths—it was one of the chief aims of the core TeX system that LaTeX extends. However, it can't always be relied upon to accurately interpret formulas in the way you did. It has to make certain assumptions when there are ambiguous expressions. The result tends to be slightly incorrect horizontal spacing. In these events, the output is still satisfactory, yet any perfectionists will no doubt wish to fine-tune their formulas to ensure spacing is correct. These are generally very subtle adjustments.
There are other occasions where LaTeX has done its job correctly, but you just want to add some space, maybe to add a comment of some kind. For example, in the following equation, it is preferable to ensure there is a decent amount of space between the maths and the text. \begin{equation} { f(n) = \begin{cases} n/2 & \quad \text{if } n \text{ is even}\\ -(n+1)/2 & \quad \text{if } n \text{ is odd} \end{cases} } \end{equation} \begin{equation} {\displaystyle f(n)={\begin{cases}n/2&\quad {\text{if }}n{\text{ is even}}\\-(n+1)/2&\quad {\text{if }}n{\text{ is odd}}\end{cases}}} \end{equation}
This code produces errors with Miktex 2.9 and does not yield the results seen on the right. Use \mathrm instead of just \text.
(Note that this particular example can be expressed in more elegant code by the cases construct provided by the amsmath package described in Advanced Mathematics chapter.)
LaTeX has defined two commands that can be used anywhere in documents (not just maths) to insert some horizontal space. They are \quad and \qquad
A \quad is a space equal to the current font size. So, if you are using an 11pt font, then the space provided by \quad will also be 11pt (horizontally, of course.) The \qquad gives twice that amount. As you can see from the code from the above example, \quads were used to add some separation between the maths and the text.
OK, so back to the fine tuning as mentioned at the beginning of the document. A good example would be displaying the simple equation for the indefinite integral of y with respect to x: \begin{equation} {\displaystyle \int y\,\mathrm {d} x} \end{equation} \begin{equation} \int y\,\mathrm {d} x \end{equation}
If you were to try this, you may write: \begin{equation} \int y \mathrm{d}x \end{equation} \begin{equation} {\displaystyle \int y\mathrm {d} x} \end{equation}
However, this doesn't give the correct result. LaTeX doesn't respect the white-space left in the code to signify that the y and the dx are independent entities. Instead, it lumps them altogether. A \quad would clearly be overkill in this situation—what is needed are some small spaces to be utilized in this type of instance, and that's what LaTeX provides:
Command | Description | Size ------------- small space 3/18 of a quad \begin{equation} ☐\,☐ \end{equation} medium space 4/18 of a quad \begin{equation} ☐\:☐ \end{equation} large space 5/18 of a quad \begin{equation} ☐\;☐ \end{equation} negative space -3/18 of a quad \begin{equation} ☐\!☐ \end{equation}
NB you can use more than one command in a sequence to achieve a greater space if necessary.
So, to rectify the current problem: \begin{equation} \int y\, \mathrm{d}x \end{equation} \begin{equation} {\displaystyle \int y\,\mathrm {d} x} \end{equation} \begin{equation} \int y\: \mathrm{d}x \end{equation} \begin{equation} {\displaystyle \int y\;\;\!\!\mathrm {d} x} \end{equation} \begin{equation} \int y\; \mathrm{d}x \end{equation} \begin{equation} {\displaystyle \int y\;\mathrm {d} x} \end{equation}
The negative space may seem like an odd thing to use, however, it wouldn't be there if it didn't have some use! Take the following example: \begin{equation} \left( \begin{array}{c} n \\ r \end{array} \right) = \frac{n!}{r!(n-r)!} \end{equation} \begin{equation} {\displaystyle \left({\begin{matrix}n\\r\end{matrix}}\right)={\frac {n!}{r!(n-r)!}}} \end{equation}
The matrix-like expression for representing binomial coefficients is too padded. There is too much space between the brackets and the actual contents within. This can easily be corrected by adding a few negative spaces after the left bracket and before the right bracket. \begin{equation} \left(\! \begin{array}{c} n \\ r \end{array} \!\right) = \frac{n!}{r!(n-r)!} \end{equation} \begin{equation} {\displaystyle \left(\!{\begin{matrix}n\\r\end{matrix}}\!\right)={\frac {n!}{r!(n-r)!}}} \end{equation}
In any case, adding some spaces manually should be avoided whenever possible: it makes the source code more complex and it's against the basic principles of a What You See is What You Mean approach. The best thing to do is to define some commands using all the spaces you want and then, when you use your command, you don't have to add any other space. Later, if you change your mind about the length of the horizontal space, you can easily change it modifying only the command you defined before. Let us use an example: you want the d of a dx in an integral to be in roman font and a small space away from the rest. If you want to type an integral like \int x \, \mathrm{d} x, you can define a command like this: \begin{equation} \newcommand{\dd}{\mathop{}\,\mathrm{d}} \int 2x^2 \dd x \end{equation} in the preamble of your document. We have chosen \dd just because it reminds the "d" it replaces and it is fast to type. Doing so, the code for your integral becomes \int x \dd x: $\int x \dd x$. Now, whenever you write an integral, you just have to use the \dd instead of the "d", and all your integrals will have the same style. If you change your mind, you just have to change the definition in the preamble, and all your integrals will be changed accordingly.
Manually Specifying Formula Style
To manually display a fragment of a formula using text style, surround the fragment with curly braces and prefix the fragment with \textstyle. The braces are required because the \textstyle macro changes the state of the renderer, rendering all subsequent mathematics in text style. The braces limit this change of state to just the fragment enclosed within. For example, to use text style for just the summation symbol in a sum, one would enter \begin{equation} C^i_j = {\textstyle \sum_k} A^i_k B^k_j \end{equation}
The same thing as a command would look like this: \begin{equation} \newcommand{\tsum}[1]{{\textstyle \sum_{#1}}} \end{equation}
Note the extra braces. Just one set around the expression won't be enough. That would cause all math after \tsum k to be displayed using text style.
To display part of a formula using display style, do the same thing, but use \displaystyle instead.
#1: Advanced Mathematics: AMS Math package
The AMS (American Mathematical Society) mathematics package is a powerful package that creates a higher layer of abstraction over mathematical LaTeX language; if you use it it will make your life easier. Some commands amsmath introduces will make other plain LaTeX commands obsolete: in order to keep consistency in the final output you'd better use amsmath commands whenever possible. If you do so, you will get an elegant output without worrying about alignment and other details, keeping your source code readable. If you want to use it, you have to add this in the preamble: \begin{equation} \usepackage{amsmath} \end{equation}
Introducing dots in formulas
amsmath defines also the \dots command, that is a generalization of the existing \ldots. You can use \dots in both text and math mode and LaTeX will replace it with three dots "…" but it will decide according to the context whether to put it on the bottom (like \ldots) or centered (like \cdots).
 This can be particularly useful if you have to type big matrices omitting elements. First of all, here are the main dots-related commands LaTeX provides:
Code | Output | Comment --------------
- \dots ${\displaystyle \dots }$ generic dots (ellipsis), to be used in text (outside formulae as well). It automatically manages whitespaces before and after itself according to the context, it's a higher level command.
- \ldots ${\displaystyle \ldots }$ the output is similar to the previous one, but there is no automatic whitespace management; it works at a lower level.
- \cdots ${\displaystyle \cdots }$ These dots are centered relative to the height of a letter. There is also the binary multiplication operator, \cdot, mentioned below.
- \vdots ${\displaystyle \vdots }$ vertical dots
- \ddots ${\displaystyle \ddots }$ diagonal dots
- \iddots $\iddots{}$ inverse diagonal dots (requires the mathdots package)
- \hdotsfor{n} ${\displaystyle \hdotsfor{n} } to be used in matrices, it creates a row of dots spanning n columns.
Instead of using \ldots and \cdots, you should use the semantically oriented commands. It makes it possible to adapt your document to different conventions on the fly, in case (for example) you have to submit it to a publisher who insists on following house tradition in this respect. The default treatment for the various kinds follows American Mathematical Society conventions.
Code | Output | Comment ---------------- \begin{equation} A_1,A_2,\dotsc, \text{LaTeX Dotsc.png for "dots with commas"} \end{equation} \begin{equation} A_1+\dotsb+A_N \text{LaTeX Dotsb.png for "dots with binary operators/relations"} \end{equation} \begin{equation} A_1 \dotsm A_N \text{LaTeX Dotsm.png for "multiplication dots"} \end{equation} \begin{equation} \int_a^b \dotsi \text{LaTeX Dotsi.png for "dots with integrals"} \end{equation} \begin{equation} A_1\dotso A_N \text{LaTeX Dotso.png for "other dots" (none of the above)} \end{equation}
Write an equation with the align environment
How to write an equation with the align environment with the amsmath package is described in Advanced Mathematics.
List of Mathematical Symbols
All the pre-defined mathematical symbols from the \TeX\ package are listed below. More symbols are available from extra packages.
 A instead of Alpha, B instead of Beta, etc.
Greek Letters
Symbol Script Symbol Script \begin{equation} {\displaystyle \mathrm {A} \,} \mathrm {A} \, and {\displaystyle \alpha \,} \alpha \, A and \alpha \end{equation} \begin{equation} {\displaystyle \mathrm {N} \,} \mathrm {N} \, and {\displaystyle \nu \,} \nu \, N and \nu \end{equation} \begin{equation} {\displaystyle \mathrm {B} \,} \mathrm {B} \, and {\displaystyle \beta \,} \beta \, B and \beta \end{equation} \begin{equation} {\displaystyle \Xi \,} \Xi \, and {\displaystyle \xi \,} \xi \, \Xi and \xi \end{equation} \begin{equation} {\displaystyle \Gamma \,} \Gamma \, and {\displaystyle \gamma \,} \gamma \, \Gamma and \gamma \end{equation} \begin{equation} {\displaystyle \mathrm {O} \,} \mathrm {O} \, and {\displaystyle \mathrm {o} \,} \mathrm {o} \, O and o \end{equation} \begin{equation} {\displaystyle \Delta \,} \Delta \, and {\displaystyle \delta \,} \delta \, \Delta and \delta \end{equation} \begin{equation} {\displaystyle \Pi \,} \Pi \,, {\displaystyle \pi \,} \pi \, and {\displaystyle \varpi } \varpi \Pi, \pi and \varpi \end{equation} \begin{equation} {\displaystyle \mathrm {E} \,} \mathrm {E} \,, {\displaystyle \epsilon \,} \epsilon \, and {\displaystyle \varepsilon \,} \varepsilon \, E, \epsilon and \varepsilon \end{equation} \begin{equation} {\displaystyle \mathrm {P} \,} \mathrm {P} \,, {\displaystyle \rho \,} \rho \, and {\displaystyle \varrho \,} \varrho \, P, \rho and \varrho \end{equation} \begin{equation} {\displaystyle \mathrm {Z} \,} \mathrm {Z} \, and {\displaystyle \zeta \,} \zeta \, Z and \zeta \end{equation} \begin{equation} {\displaystyle \Sigma \,} \Sigma \,, {\displaystyle \sigma \,} \sigma \, and {\displaystyle \varsigma \,} \varsigma \, \Sigma, \sigma and \varsigma \end{equation} \begin{equation} {\displaystyle \mathrm {H} \,} \mathrm {H} \, and {\displaystyle \eta \,} \eta \, H and \eta \end{equation} \begin{equation} {\displaystyle \mathrm {T} \,} \mathrm {T} \, and {\displaystyle \tau \,} \tau \, T and \tau \end{equation} \begin{equation} {\displaystyle \Theta \,} \Theta \,, {\displaystyle \theta \,} \theta \, and {\displaystyle \vartheta \,} \vartheta \, \Theta, \theta and \vartheta \end{equation} \begin{equation} {\displaystyle \Upsilon \,} \Upsilon \, and {\displaystyle \upsilon \,} \upsilon \, \Upsilon and \upsilon \end{equation} \begin{equation} {\displaystyle \mathrm {I} \,} \mathrm {I} \, and {\displaystyle \iota \,} \iota \, I and \iota \end{equation} \begin{equation} {\displaystyle \Phi \,} \Phi \,, {\displaystyle \phi \,} \phi \,, and {\displaystyle \varphi \,} \varphi \, \Phi, \phi and \varphi \end{equation} \begin{equation} {\displaystyle \mathrm {K} \,} \mathrm {K} \,, {\displaystyle \kappa \,} \kappa \, and {\displaystyle \varkappa \,} \varkappa \, K, \kappa and \varkappa \end{equation} \begin{equation} {\displaystyle \mathrm {X} \,} \mathrm {X} \, and {\displaystyle \chi \,} \chi \, X and \chi \end{equation} \begin{equation} {\displaystyle \Lambda \,} \Lambda \, and {\displaystyle \lambda \,} \lambda \, \Lambda and \lambda \end{equation} \begin{equation} {\displaystyle \Psi \,} \Psi \, and {\displaystyle \psi \,} \psi \, \Psi and \psi \end{equation} \begin{equation} {\displaystyle \mathrm {M} \,} \mathrm {M} \, and {\displaystyle \mu \,} \mu \, M and \mu \end{equation} \begin{equation} {\displaystyle \Omega \,} \Omega \, and {\displaystyle \omega \,} \omega \, \Omega and \omega \end{equation}
Other symbols
Symbol Script Symbol Script Symbol Script Symbol Script Symbol Script \begin{equation} {\displaystyle \partial \,} \partial \, \partial \end{equation} \begin{equation} {\displaystyle \imath \,} \imath \, \imath \end{equation} \begin{equation} {\displaystyle \Re \,} \Re \, \Re \end{equation} \begin{equation} {\displaystyle \nabla \,} \nabla \, \nabla \end{equation} \begin{equation} {\displaystyle \aleph \,} \aleph \, \aleph \end{equation} \begin{equation} {\displaystyle \eth \,} \eth \, \eth \end{equation} \begin{equation} {\displaystyle \jmath \,} \jmath \, \jmath \end{equation} \begin{equation} {\displaystyle \Im \,} \Im \, \Im \end{equation} \begin{equation} {\displaystyle \Box \,} \Box \, \Box \end{equation} \begin{equation} {\displaystyle \beth \,} \beth \, \beth \end{equation} \begin{equation} {\displaystyle \hbar \,} \hbar \, \hbar \end{equation} \begin{equation} {\displaystyle \ell \,} \ell \, \ell \end{equation} \begin{equation} {\displaystyle \wp \,} \wp \, \wp \end{equation} \begin{equation} {\displaystyle \infty \,} \infty \, \infty \end{equation} \begin{equation} {\displaystyle \gimel \,} \gimel \, \gimel \end{equation}
*Not predefined in LATEX 2. Use one of the packages latexsym, amsfonts, amssymb, txfonts, pxfonts, or wasysym
Trigonometric Functions
Symbol Script Symbol Script Symbol Script Symbol Script \begin{equation} {\displaystyle \sin \,} \sin \, \sin \end{equation} \begin{equation} {\displaystyle \arcsin \,} \arcsin \, \arcsin \end{equation} \begin{equation} {\displaystyle \sinh \,} \sinh \, \sinh \end{equation} \begin{equation} {\displaystyle \sec \,} \sec \, \sec \end{equation} \begin{equation} {\displaystyle \cos \,} \cos \, \cos \end{equation} \begin{equation} {\displaystyle \arccos \,} \arccos \, \arccos \end{equation} \begin{equation} {\displaystyle \cosh \,} \cosh \, \cosh \end{equation} \begin{equation} {\displaystyle \csc \,} \csc \, \csc \end{equation} \begin{equation} {\displaystyle \tan \,} \tan \, \tan \end{equation} \begin{equation} {\displaystyle \arctan \,} \arctan \, \arctan \end{equation} \begin{equation} {\displaystyle \tanh \,} \tanh \, \tanh \end{equation} \begin{equation} {\displaystyle \cot \,} \cot \, \cot \end{equation} \begin{equation} {\displaystyle \operatorname {arccot} \,} \operatorname {arccot} \, \arccot \end{equation} \begin{equation} {\displaystyle \coth \,} \coth \, \coth \end{equation}
If LaTeX does not include a command for the mathematical operator you want to use, for example \cis (cosine plus i times sine), add to your preamble: \begin{equation} \DeclareMathOperator\cis{cis} \end{equation} You can then use \cis in the document just like \cos or any other mathematical operator.
#1
Maxwell's equations: \begin{align} B'&=-\nabla \times E,\\ E'&=\nabla \times B - 4\pi j, \end{align}
#1
\begin{equation} f(x)=(x+a)(x+b) \end{equation}
#1
\begin{equation} \label{eq:someequation} 6^2 - 5 = 36-5 = 31 \end{equation} this references equation \ref{eq:someequation}.
#1
\[ A \overset{!}{=} B; A \stackrel{!}{=} B \]
#1
\[ \lim_{x\to 0}{\frac{e^x-1}{2x}} \overset{\left[\frac{0}{0}\right]}{\underset{\mathrm{H}}{=}} \lim_{x\to 0}{\frac{e^x}{2}}={\frac{1}{2}} \]
#1
\[ z = \overbrace{ \underbrace{x}_\text{real} + i \underbrace{y}_\text{imaginary} }^\text{complex number} \]
#1
\[ T=\sum_{ {\substack{i_1,\ldots,i_n=1 \\ j_1,\ldots,j_m=1}}}^d T_{j_1,\ldots,j_m}^{i_1,\ldots,i_n} E_{i_1,\ldots,i_n}^{j_1,\ldots,j_m} \]
#1
\[ T=\sum_{ \mathclap{\substack{i_1,\ldots,i_n=1 \ j_1,\ldots,j_m=1}}}^d T_{j_1,\ldots,j_m}^{i_1,\ldots,i_n} E_{i_1,\ldots,i_n}^{j_1,\ldots,j_m} \]
#1
\[ y = a + f(\underbrace{b x}_{ \ge 0 \text{ by assumption}}) = a + f(\underbrace{b x}_{ {\ge 0 \text{ by assumption}}}) \]
#1
\begin{gather} $\dfrac{arg1}{arg2}$ $\frac{\displaystyle arg1}{\displaystyle arg2}$ $\frac{arg1}{arg2}$ \end{gather}
#1
\[ y = a + f(\underbrace{b x}_{ \ge 0 \text{ by assumption}}) = a + f(\underbrace{b x}_{ \mathclap{\ge 0 \text{ by assumption}}}) \]
#1
\[ z = \overbracket[3pt]{ \underbracket{x}_{\text{real}} + \underbracket[0.5pt][7pt]{iy}_{\text{imaginary}} }^{\text{complex number}} \]
#1
\[ A \leftarrow{\text{this way}} B \rightarrow[\text{or that way}]{ } C \]
#1
\begin{gather} a \leftrightarrow[under]{over} b\\ % A \Leftarrow[under]{over} B\\ % B \Rightarrow[under]{over} C\\ % C \Leftrightarrow[under]{over} D\\ % D \hookleftarrow[under]{over} E\\ % E \hookrightarrow[under]{over} F\\ % F \xmapsto[under]{over} G\\ \end{gather}
#1
\begin{gather} H \rightharpoondown[under]{over} I\\ % I \rightharpoonup[under]{over} J\\ % J \leftharpoondown[under]{over} K\\ % K \leftharpoonup[under]{over} L\\ % L \rightleftharpoons[under]{over} M\\ % M \leftrightharpoons[under]{over} N \end{gather}
#1
\begin{align*} f(x) &= (x+a)(x+b) \\ &= x^2 + (a+b)x + ab \end{align*}
#1
\begin{align} f(x) &= x^4 + 7x^3 + 2x^2 \nonumber \\ &\qquad {} + 10x + 12 \end{align}
#1
\begin{align*} f(x) &= a x^2+b x +c & g(x) &= d x^3 \\ f'(x) &= 2 a x +b & g'(x) &= 3 d x^2 \end{align*}
#1
\begin{align} f(x) &= \pi \left\{ x^4 + 7x^3 + 2x^2 \right.\nonumber\\ &\qquad \left. {} + 10x + 12 \right\} \end{align}
#1
\begin{align} A &= \left(\int_t XXX \right.\nonumber\\ &\qquad \left.\vphantom{\int_t} YYY \dots \right) \end{align}
#1
\[ f(x) = \left\{ \begin{array}{lr} x^2 & : x < 0\\ x^3 & : x \ge 0 \end{array} \right. \]
#1
\[ u(x) = \begin{cases} \exp{x} & \text{if } x \geq 0 \\ 1 & \text{if } x < 0 \end{cases} \]
#1
\[ a = \begin{dcases} \int x\, \mathrm{d} x\\ b^2 \end{dcases} \]
#1
\[ f(x) = \begin{dcases*} x & when $x$ is even\\ -x & when $x$ is odd \end{dcases*} \]
#1
\begin{equation} \left.\begin{aligned} B'&=-\partial \times E,\\ E'&=\partial \times B - 4\pi j, \end{aligned} \right\} \qquad \text{Maxwell's equations} \end{equation}
#1
\begin{alignat}{2} \sigma_1 &= x + y &\quad \sigma_2 &= \frac{x}{y} \\ \sigma_1' &= \frac{\partial x + y}{\partial x} & \sigma_2' &= \frac{\partial \frac{x}{y}}{\partial x} \end{alignat}
#1
\begin{gather*} a_0=\frac{1}{\pi}\int\limits_{-\pi}^{\pi}f(x)\,\mathrm{d}x\\[6pt] \begin{split} a_n=\frac{1}{\pi}\int\limits_{-\pi}^{\pi}f(x)\cos nx\,\mathrm{d}x=\\ =\frac{1}{\pi}\int\limits_{-\pi}^{\pi}x^2\cos nx\,\mathrm{d}x \end{split}\\[6pt] \begin{split} b_n=\frac{1}{\pi}\int\limits_{-\pi}^{\pi}f(x)\sin nx\,\mathrm{d}x=\\ =\frac{1}{\pi}\int\limits_{-\pi}^{\pi}x^2\sin nx\,\mathrm{d}x \end{split}\\[6pt] \end{gather*}
#1
\begin{equation} \boxed{x^2+y^2 = z^2} \end{equation}
#1
\begin{equation} x^2+y^2=z^2 \end{equation}
#1
\begin{equation} \lim_{a\to \infty} \tfrac{1}{a} \end{equation}
#1
\begin{equation} \lim\nolimits_{a\to \infty} \tfrac{1}{a} \end{equation}
#1
\begin{equation} \int_a^b x^2 \mathrm{d} x \end{equation}
#1
\begin{equation} \int\limits_a^b x^2 \mathrm{d} x \end{equation}
#1
\begin{equation} \lim_{a \underset{>}{\to} 0} \frac{1}{a} \end{equation}
#1
\begin{equation} \sum\nolimits' C_n \end{equation}
#1
\begin{equation} \sum_{n=1}\nolimits' C_n \end{equation}
#1
\begin{equation} \sideset{}{'}\sum_{n=1}C_n \end{equation}
#1
\begin{equation} \sideset{_a^b}{_c^d}\sum \end{equation}
#1
\begin{equation} {\sum\limits_{n=1} }'C_n \end{equation}
#1
\begin{equation} \prod_{\substack{ 1\le i \le n\\ 1\le j \le m}} M_{i,j} \end{equation}
#1
\begin{align*} \intertext{If} A &= \sigma_1+\sigma_2\\ B &= \rho_1+\rho_2\\ \intertext{then} C(x) &= e^{Ax^2+\pi}+B \end{align*}
#1
\begin{equation} x = a_0 + \frac{1}{a_1 + \frac{1}{a_2 + \frac{1}{a_3 + a_4}}} \end{equation}
#1
\begin{equation} x = a_0 + \frac{1}{\displaystyle a_1 + \frac{1}{\displaystyle a_2 + \frac{1}{\displaystyle a_3 + a_4}}} \end{equation}
#1
\begin{equation} \longdiv{dividend}{divisor} \end{equation}
#1
\begin{equation} \longdiv{642348238}{37} \end{equation}
#1
Quadratic Formula
When \(a\ne0\), there are two solutions to \(ax^2+bx+c=0\) and they are $$x = {-b\pm\sqrt{b^2-4ac}\over2a}.$$
A matrix
\[\left(\begin{array}{cccc}2&3&4&5\\0&-1&2&1\\0&0&2&4\\0&3&-6&0\end{array}\right)\]
Cross Product
\[\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \end{vmatrix} \]
Integral
\[\int_0^{2\pi}\sin{x}\ dx=0\]
Summation
$$f(x)=\sum_{n=0}^\infty\frac{f^{(n)}(a)}{n!}(x-a)^n$$
In-line Math
Displacement: \(s=ut+\frac{1}{2}at^2\)
Trigonometry: \(\tan^2x+1=\sec^2x\)
Summation: \(\pi=4\sum_{i=1}^{n}\large{\frac{(-1)^{k+1}}{2k-1}}\)
That last one again, in its own centered block. Note the position of the sum limits, which are now above and below the summation symbol.
$$\pi=4\sum_{i=1}^{n}\frac{(-1)^{k+1}}{2k-1}$$
Fractions on fractions
$\frac{\frac{6}{x+2}}{\frac{3}{2x+4}}$ $=\frac{6}{x+2}\div\frac{3}{2x+4}$ $=\frac{6}{x+2}\times\frac{2(x+2)}{3}$ $=4$
My "challenge" matrix from earlier articles (this matrix was an issue in WPMathPub)
\[\left\{\begin{array}{ccc}5&3&\cos\ 2\\6&7&0\\1&-2&\sin\ 5\end{array}\right\}\]
The "Ask Dr Math" integral example
\(3\int{x^2}dx+5\int{x}\ {dx}+9\int{dx}\)
Instructions for entering ASCIIMath
Use the backtick character before and after math, like this: `x = y + z`.
Enter fractions with a forward slash, /, as in `y/z`.
Products and powers of variables: `ab^2`.
Integrals: `int_(0)^(2 pi) sin\ x\ dx = 0`.
Square root is like this: `sqrt(169) = 13`.
Summation notation: `sum_(i=1)^ni^3`
`3xx3` matrix: `[(1,2,3),(4,8,3),(-5,4,9)]`
Greek, too: `A = pi r^2`
Special note:
When using "less than" or "greater than" signs, put a SPACE before and after them, like this:
If `x < 3`, then `y > 0`.
For Phones and Tablets
You can use "double q" to surround your math, like this:
qq a^2 + b^2 = c^2 qq
Further Tests
${ \displaystyle \forall A \, \exists P \, \forall B \, [B \in P \iff \forall C \, (C \in B \Rightarrow C \in A)] }$
Logic: ${ \displaystyle \neg(p\wedge q)\iff(\neg p)\vee(\neg q) }$
Boolean algebra: ${ \displaystyle \overline{\bigcup_{i=1}^{n} A_{i}}=\bigcap_{i=1}^{n} \overline{A_{i}} }$
${ \displaystyle \mathbf{C}(n,k) = \mathbf{C}_k^n = {}_n\mathbf{C}_k = \dbinom{n}{k} = \dfrac{n!}{k!\,(n -k)!} }$
${ \displaystyle \int_0^1 x^x\,\mathrm{d}x = \sum_{n = 1}^\infty{(-1)^{n + 1}\,n^{-n}} }$
${ \displaystyle \nabla \cdot \vec v = {\partial v_x \over \partial x} + {\partial v_y \over \partial y} + {\partial v_z \over \partial z} }$
Apparently MathJax doesn't support \thickspace, but does support \quad and \qqaud:
${ \displaystyle c = \overbrace { \underbrace{\quad\quad\quad\quad\quad a \quad\quad\quad\quad}_\text{real} + \underbrace{\quad\quad\quad\quad\quad b\mathrm{i} \quad\quad\quad\quad}_\text{imaginary} }^\text{complex number} }$
${ \displaystyle M = \begin{bmatrix} \alpha_1 & \alpha_1^q & \cdots & \alpha_1^{q^{n - 1}} \\ \alpha_2 & \alpha_2^q & \cdots & \alpha_2^{q^{n - 1}} \\ \vdots & \vdots & \ddots & \vdots \\ \alpha_m & \alpha_m^q & \cdots & \alpha_m^{q^{n - 1}} \end{bmatrix} }$
Spherical coordinates derivation of the volume of a sphere $\left(\tfrac43 \pi R^3 \right) $.\\ The formula $S$ for a sphere of radius $R$ in spherical coordinates is: \\ $S = \{0 \leq \phi \leq 2\pi, \ 0 \leq \theta \leq \pi, \ 0 \leq \rho \leq R\}$ \begin{align*} \mathrm{Volume} &=\iiint\limits_S\! \rho^2 \sin\theta \,\mathrm{d}\rho \,\mathrm{d}\theta \,\mathrm{d}\phi \\ &=\int_0^{2 \pi }\! \mathrm{d}\phi \,\int_0^{ \pi }\! \sin\theta \,\mathrm{d}\theta \,\int_0^R\! \rho^2 \mathrm{d}\rho \\ &=\phi \Bigr|_0^{2\pi}\ (-\cos\theta) \Bigr|_0^{ \pi }\ \tfrac13 \rho^3 \Bigr|_0^R \\ &=2\pi \times 2 \times \tfrac13 R^3 \\ &=\tfrac43 \pi R^3 \end{align*}
${ \displaystyle \left\langle\psi\left|\mathcal{T}\left\{\frac{\delta}{\delta\phi}F[\phi]\right\}\right|\psi\right\rangle = -\mathrm{i}\left\langle\psi\left|\mathcal{T}\left\{F[\phi]\frac{\delta}{\delta\phi}S[\phi]\right\}\right|\psi\right\rangle }$
${ \displaystyle \gamma_1\equiv \gamma_2 \iff \left\{ \begin{array}{l} \gamma_1(0)=\gamma_2(0)=p, \text{ and }\\ [1.0ex] \left.\frac{\mathrm{d}}{\mathrm{d}t}\phi\circ\gamma_1(t)\right|_{t=0} = \left.\frac{\mathrm{d}}{\mathrm{d}t}\phi\circ\gamma_2(t)\right|_{t=0} \end{array} \right. }$
${ \displaystyle \begin{array}{ccccccccccc} & & {\rm cov}({\mathcal L}) & \longrightarrow & {\rm non}({\mathcal K}) & \longrightarrow & {\rm cof}({\mathcal K}) & \longrightarrow & {\rm cof}({\mathcal L}) & \longrightarrow & 2^{\aleph_0} \\ & & {*}{\Bigg\uparrow} & & \uparrow & & \uparrow & & {*}{\Bigg\uparrow} & & \\ & & & & {\mathfrak b} & \longrightarrow & {\mathfrak d} & & & & \\ & & & & \uparrow & & \uparrow & & & & \\ \aleph_1 & \longrightarrow & {\rm add}({\mathcal L}) & \longrightarrow & {\rm add}({\mathcal K}) & \longrightarrow & {\rm cov}({\mathcal K}) & \longrightarrow & {\rm non}({\mathcal L}) & & \end{array} }$
Without specifying width for last column: \begin{center} \begin{tabular}{| l | l | l | l |} \hline Day & Min Temp & Max Temp & Summary \\ \hline Monday & 11C & 22C & A clear day with lots of sunshine. However, the strong breeze will bring down the temperatures. \\ \hline Tuesday & 9C & 19C & Cloudy with rain, across many northern regions. Clear spells across most of Scotland and Northern Ireland, but rain reaching the far northwest. \\ \hline Wednesday & 10C & 21C & Rain will still linger for the morning. Conditions will improve by early afternoon and continue throughout the evening. \\ \hline \end{tabular} \end{center}
With width specified: \begin{center} \begin{tabular}{ | l | l | l | p{5cm} |} \hline Day & Min Temp & Max Temp & Summary \\ \hline Monday & 11C & 22C & A clear day with lots of sunshine. However, the strong breeze will bring down the temperatures. \\ \hline Tuesday & 9C & 19C & Cloudy with rain, across many northern regions. Clear spells across most of Scotland and Northern Ireland, but rain reaching the far northwest. \\ \hline Wednesday & 10C & 21C & Rain will still linger for the morning. Conditions will improve by early afternoon and continue throughout the evening. \\ \hline \end{tabular} \end{center}
\begin{tabular}{ | l | l | r | } \hline\noalign{\smallskip} \multicolumn{2}{c}{Item} \\ \cline{1-2}\noalign{\smallskip} Animal & Description & Price (\$) \\ \noalign{\smallskip}\hline\noalign{\smallskip} Gnat & per gram & 13.65 \\ & each & 0.01 \\ Gnu & stuffed & 92.50 \\ Emu & stuffed & 33.33 \\ Armadillo & frozen & 8.99 \\ \noalign{\smallskip}\hline \end{tabular}
\begin{tabular}{l*{6}{c}r} Team & P & W & D & L & F & A & Pts \\ \hline Manchester United & 6 & 4 & 0 & 2 & 10 & 5 & 12 \\ Celtic & 6 & 3 & 0 & 3 & 8 & 9 & 9 \\ Benfica & 6 & 2 & 1 & 3 & 7 & 8 & 7 \\ FC Copenhagen & 6 & 2 & 1 & 3 & 5 & 8 & 7 \\ \end{tabular}
\begin{tabular}{>{\centering}p{3.5cm}>{\centering}p{3.5cm} } Geometry & Algebra \tabularnewline \hline Points & Addition \tabularnewline Spheres & Multiplication \end{tabular}
${ \displaystyle \sideset{_{{}_\alpha^\beta\mathfrak{A}_\delta^\gamma}^{{}_\epsilon^\zeta\mathfrak{B}_\theta^\eta}}{_{{}_\rho^\sigma\mathfrak{E}_\upsilon^\tau}^{{}_\nu^\xi\mathfrak{D}_\pi^o}}\prod_{{}_\phi^\chi\mathfrak{F}_\omega^\psi}^{{}_\iota^\kappa\mathfrak{C}_\mu^\lambda} }$
${ \displaystyle \frac{\sqrt{1 + \sqrt[3]{2 + \sqrt[5]{3 + \sqrt[7]{4 + \sqrt[11]{5 + \sqrt[13]{6 + \sqrt[17]{7 + \sqrt[19]{A}}}}}}}}}{\mathrm{e}^\pi} = x^{'''} }$ Well, bugger it millenium hand & shrimp:
${ \displaystyle \left( \begin{array}{@{}r@{}l@{}} \left( \begin{array}{llrr} a_1 & a_2 \thickspace & a_3 & a_4 \\ a_5 & a_6 \thickspace & a_7 & a_8 \\ \end{array} \right) & \multirow{2}{*}[1.4ex] {$ \left( \begin{array}{c} b_1 \\ b_2 \\ [0.3ex] b_3 \\ b_4 \\ \end{array} \right) $} \\ [1.7ex] \begin{array}{lr@{}} $\raisebox{-0.5ex}{\Large 0}$\thinspace & \left( \begin{array}{rr} c_1 \thinspace & c_2 \\ c_3 \thinspace & c_4 \\ \end{array} \right) \end{array} & \end{array} \right) }$
\begin{gather} \Huge{Huge}, \Large{Large}, \normalsize{normalsize}, \small{small} \end{gather}
KaTeX tests
Repeating fractions
The LaTeX code: $$ \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\cdots} } } } $$
Summation notation
The LaTeX code: $$ \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) $$
Sum of a Series
I broke up the next two examples into separate lines so it behaves better on a mobile phone. That's why they include \displaystyle.
The LaTeX code: $$ \displaystyle\sum_{i=1}^{k+1}i $$
The LaTeX code: $$ \displaystyle= \left(\sum_{i=1}^{k}i\right) +(k+1) $$
The LaTeX code: $$ \displaystyle= \frac{k(k+1)}{2}+k+1 $$
The LaTeX code: $$ \displaystyle= \frac{k(k+1)+2(k+1)}{2} $$
The LaTeX code: $$ \displaystyle= \frac{(k+1)(k+2)}{2} $$
The LaTeX code: $$ \displaystyle= \frac{(k+1)((k+1)+1)}{2} $$
Product notation
The LaTeX code: $$ \displaystyle\text{ for }\lvert q\rvert < 1. = \displaystyle \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \displaystyle 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots $$
Inline math
And here is some in-line math:
The LaTeX code: And here is some in-line math: $k_{n+1} = n^2 + k_n^2 - k_{n-1}$, followed by some more text.
Inline math uses span rather than a div.
Greek Letters
Γ Δ Θ Λ Ξ Π Σ Υ Φ Ψ Ω
The LaTeX code: $$ \Gamma\ \Delta\ \Theta\ \Lambda\ \Xi\ \Pi\ \Sigma\ \Upsilon\ \Phi\ \Psi\ \Omega $$
α β γ δ ϵ ζ η θ ι κ λ μ ν ξ ο π ρ σ τ υ ϕ χ ψ ω ε ϑ ϖ ϱ ς φ
The LaTeX code: $$ \alpha\ \beta\ \gamma\ \delta\ \epsilon\ \zeta\ \eta\ \theta\ \iota\ \kappa\ \lambda\ \mu\ \nu\ \xi \ \omicron\ \pi\ \rho\ \sigma\ \tau\ \upsilon\ \phi\ \chi\ \psi\ \omega\ \varepsilon\ \vartheta\ \varpi\ \varrho\ \varsigma\ \varphi $$
Arrows
← → ← → ↑ ⇑ ↓ ⇓ ↕ ⇕
The LaTeX code: $$ \gets\ \to\ \leftarrow\ \rightarrow\ \uparrow\ \Uparrow\ \downarrow\ \Downarrow\ \updownarrow\ \Updownarrow $$
⇐ ⇒ ↔ ⇔ ↦ ↩
The LaTeX code: $$ \Leftarrow\ \Rightarrow\ \leftrightarrow\ \Leftrightarrow\ \mapsto\ \hookleftarrow $$
↼ ↽ ⇌ ⟵ ⟸ ⟶
The LaTeX code: $$ \leftharpoonup\ \leftharpoondown\ \rightleftharpoons\ \longleftarrow\ \Longleftarrow\ \longrightarrow $$
⟹ ⟷ ⟺ ⟼ ↪ ⇀
The LaTeX code: $$ \Longrightarrow\ \longleftrightarrow\ \Longleftrightarrow\ \longmapsto\ \hookrightarrow\ \rightharpoonup $$
⇁ ⇝ ↗ ↘ ↙ ↖
The LaTeX code: $$ \rightharpoondown\ \leadsto\ \nearrow\ \searrow\ \swarrow\ \nwarrow $$
Symbols
√ ⊼ ⊻ ⊙ ⊕ ⊗ ⊘ ⊚ ⊡ △
The LaTeX code: $$ \surd\ \barwedge\ \veebar\ \odot\ \oplus\ \otimes\ \oslash\ \circledcirc\ \boxdot\ \bigtriangleup $$
▽ † ⋄ ⋆ ◃ ▹ ∠ ∞ ′ △
The LaTeX code: $$ \bigtriangledown\ \dagger\ \diamond\ \star\ \triangleleft\ \triangleright\ \angle\ \infty\ \prime\ \triangle $$
Calculus
The LaTeX code: $$ \int u \frac{dv}{dx}\,dx=uv-\int \frac{du}{dx}v\,dx $$
The LaTeX code: $$ f(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x} $$
The LaTeX code: $$ \oint \vec{F} \cdot d\vec{s}=0 $$
Lorenz Equations
The LaTeX code: $$ \begin{aligned} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z + xy \end{aligned} $$
Cross Product
This works in KaTeX, but the separation of fractions in this environment is not so good.
The LaTeX code: $$ \mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \end{vmatrix} $$
Here's a workaround: make the fractions smaller with an extra class that targets the spans with "mfrac" class (makes no difference in the MathJax case):
The LaTeX code: $$ \mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \end{vmatrix} $$
Accents
The LaTeX code: $$ \hat{x}\ \vec{x}\ \ddot{x} $$
Stretchy brackets
The LaTeX code: $$ \left(\frac{x^2}{y^3}\right) $$
Evaluation at limits
The LaTeX code: $$ \left.\frac{x^3}{3}\right|_0^1 $$
Case definitions
The LaTeX code: $$ f(n) = \begin{cases} \frac{n}{2}, & \text{if } n\text{ is even} \\ 3n+1, & \text{if } n\text{ is odd} \end{cases} $$
Maxwell's Equations
The LaTeX code: $$ \begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} $$
These equations are quite cramped. We can add vertical spacing using (for example) [1em] after each line break (\\). as you can see here:
The LaTeX code: $$ \begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\[1em] \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\[0.5em] \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\[1em] \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} $$
Statistics
Definition of combination:
The LaTeX code: $$ \frac{n!}{k!(n-k)!} = {^n}C_k $$
The LaTeX code: $$ {n \choose k} $$
Fractions on fractions
The LaTeX code: $$ \frac{\frac{1}{x}+\frac{1}{y}}{y-z} $$
n-th root
The LaTeX code: $$ \sqrt[n]{1+x+x^2+x^3+\ldots} $$
Matrices
The LaTeX code: $$ \begin{pmatrix} a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33} \end{pmatrix} $$
The LaTeX code: $$ \begin{bmatrix} 0 & \cdots & 0 \\ \vdots & \ddots & \vdots \\ 0 & \cdots & 0 \end{bmatrix} $$
Punctuation
The LaTeX code: $$ f(x) = \sqrt{1+x} \quad (x \ge -1) $$
The LaTeX code: $$ f(x) \sim x^2 \quad (x\to\infty) $$
Now with punctuation:
The LaTeX code: $$ f(x) = \sqrt{1+x}, \quad x \ge -1 $$
The LaTeX code: $$ f(x) \sim x^2, \quad x\to\infty $$
#1: xxx
The construction $\dfrac{num}{den}$ is equivalent to saying $$ {\displaystyle\frac{num}{den}} $$
So it's not correct to say that dcases changes \frac into \dfrac. Indeed, inside it (as well as in equation), we'll have $$ \frac{\frac{S}{S}}{T} $$ where the letters denote the style chosen, because the numerator will be in style T as follows from the rules. Here's an example, where the overall style is D.
enter image description here
As it can be seen, the styles have their effect also on other symbols, the "big operators": a \sum in style D will be bigger than in style T. Style D usually forces subscript and superscripts to big operators to be set below and above it (look for \displaylimits, \limits and \nolimits).
Thus there is a big difference between $\displaystyle\sum_{i=1}^{n} a_{i}$ and $\sum\limits_{i=1}^{n} a_{i}$
In the first case the summation symbol will be big, in the second one it will be the normal one for style T, but with limits above and below as imposed by \limits (it's not recommended to do it).
#1: xxxx
\LaTeX\ Mathematics Examples
Prof Tony Roberts
Delimiters
See how the delimiters are of reasonable size in these examples \[ \left(a+b\right)\left[1-\frac{b}{a+b}\right]=a\,, \] \[ \sqrt{|xy|}\leq\left|\frac{x+y}{2}\right|, \] even when there is no matching delimiter \[ \int_a^bu\frac{d^2v}{dx^2}\,dx =\left.u\frac{dv}{dx}\right|_a^b -\int_a^b\frac{du}{dx}\frac{dv}{dx}\,dx. \]
Spacing
Differentials often need a bit of help with their spacing as in \[ \iint xy^2\,dx\,dy =\frac{1}{6}x^2y^3, \] whereas vector problems often lead to statements such as \[ u=\frac{-y}{x^2+y^2}\,,\quad v=\frac{x}{x^2+y^2}\,,\quad\text{and}\quad w=0\,. \]
Occasionally one gets horrible line breaks when using a list in mathematics such as listing the first twelve primes $\(2,3,5,7,11,13,17,19,23,29,31,37\)\,$.
In such cases, perhaps include \verb|\mathcode`\,="213B| inside the inline maths environment so that the list breaks: $\(\mathcode`\,="213B 2,3,5,7,11,13,17,19,23,29,31,37\)\,$.
Be discerning about when to do this as the spacing is different.
Arrays
Arrays of mathematics are typeset using one of the matrix environments as in \[ \begin{bmatrix} 1 & x & 0 \\ 0 & 1 & -1 \end{bmatrix}\begin{bmatrix} 1 \\ y \\ 1 \end{bmatrix} =\begin{bmatrix} 1+xy \\ y-1 \end{bmatrix}. \]
Case statements use cases: \[ |x|=\begin{cases} x, & \text{if }x\geq 0\,, \\ -x, & \text{if }x< 0\,. \end{cases} \]
Many arrays have lots of dots all over the place as in \[ \begin{matrix} -2 & 1 & 0 & 0 & \cdots & 0 \\ 1 & -2 & 1 & 0 & \cdots & 0 \\ 0 & 1 & -2 & 1 & \cdots & 0 \\ 0 & 0 & 1 & -2 & \ddots & \vdots \\ \vdots & \vdots & \vdots & \ddots & \ddots & 1 \\ 0 & 0 & 0 & \cdots & 1 & -2 \end{matrix} \]
Equation arrays
In the flow of a fluid film we may report \begin{eqnarray} u_\alpha & = & \epsilon^2 \kappa_{xxx} \left( y-\frac{1}{2}y^2 \right), \label{equ} \\ v & = & \epsilon^3 \kappa_{xxx} y\,, \label{eqv} \\ p & = & \epsilon \kappa_{xx}\,. \label{eqp} \end{eqnarray}
Alternatively, the curl of a vector field $(u,v,w)$ may be written with only one equation number: \begin{eqnarray} \omega_1 & = & \frac{\partial w}{\partial y}-\frac{\partial v}{\partial z}\,, \nonumber \\ \omega_2 & = & \frac{\partial u}{\partial z}-\frac{\partial w}{\partial x}\,, \label{eqcurl} \\ \omega_3 & = & \frac{\partial v}{\partial x}-\frac{\partial u}{\partial y}\,. \nonumber \end{eqnarray} Whereas a derivation may look like \begin{eqnarray*} (p\wedge q)\vee(p\wedge\neg q) & = & p\wedge(q\vee\neg q) \quad\text{by distributive law} \\ & = & p\wedge T \quad\text{by excluded middle} \\ & = & p \quad\text{by identity} \end{eqnarray*}
Functions
Observe that trigonometric and other elementary functions are typeset properly, even to the extent of providing a thin space if followed by a single letter argument: \[ \exp(i\theta)=\cos\theta +i\sin\theta\,,\quad \sinh(\log x)=\frac{1}{2}\left( x-\frac{1}{x} \right). \]
With sub- and super-scripts placed properly on more complicated functions, \[ \lim_{q\to\infty}\|f(x)\|_q =\max_{x}|f(x)|, \] and large operators, such as integrals and \begin{eqnarray*} e^x & = & \sum_{n=0}^\infty \frac{x^n}{n!} \quad\text{where }n!=\prod_{i=1}^n i\,, \\ \overline{U_\alpha} & = & \bigcap_\alpha U_\alpha\,. \end{eqnarray*}
In inline mathematics the scripts are correctly placed to the side in order to conserve vertical space, as in \( 1/(1-x)=\sum_{n=0}^\infty x^n. \)
Accents
Mathematical accents are performed by a short command with one argument, such as \[ \tilde f(\omega)=\frac{1}{2\pi} \int_{-\infty}^\infty f(x)e^{-i\omega x}\,dx\,, \] or \[ \dot{\vec \omega}=\vec r\times\vec I\,. \]
Command definition
$ \newcommand{\Ai}{\operatorname{Ai}} $ The Airy function, $\Ai(x)$, may be incorrectly defined as this integral \[ \Ai(x)=\int\exp(s^3+isx)\,ds\,. \] $ \newcommand{\boldmath}[1]{\mathbf {#1}} $ $ \newcommand{\D}[2]{\frac{\partial #2}{\partial #1}} \newcommand{\DD}[2]{\frac{\partial^2 #2}{\partial #1^2}} \renewcommand{\vec}[1]{\text{\boldmath{#1}}} $ This vector identity serves nicely to illustrate two of the new commands: \[ \vec\nabla\times\vec q =\vec i\left(\D yw-\D zv\right) +\vec j\left(\D zu-\D xw\right) +\vec k\left(\D xv-\D yu\right). \]
Theorems et al.
\[ \newtheorem{theorem}{Theorem} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{definition}[theorem]{Definition} \]
\begin{definition}[right-angled triangles] \label{def:tri} ... \end{definition}
A \emph{right-angled triangle} is a triangle whose sides of length~\(a\), \(b\) and~\(c\), in some permutation of order, satisfies \(a^2+b^2=c^2\).
\begin{lemma} ... \end{lemma}
The triangle with sides of length~\(3\), \(4\) and~\(5\) is right-angled.
This lemma follows from the Definition~\ref{def:tri} as \(3^2+4^2=9+16=25=5^2\).
\begin{theorem}[Pythagorean triplets] \label{thm:py} ... \end{theorem}
Triangles with sides of length \(a=p^2-q^2\), \(b=2pq\) and \(c=p^2+q^2\) are right-angled triangles.
Prove this Theorem~\ref{thm:py} by the algebra \(a^2+b^2 =(p^2-q^2)^2+(2pq)^2 \\ =p^4-2p^2q^2+q^4+4p^2q^2 \\ =p^4+2p^2q^2+q^4 \\ =(p^2+q^2)^2 =c^2\).
\( \newcounter{mysection} \newcounter{mysubsection}[mysection] \addtocounter{mysection}{2} % set them to some other numbers than 0 \addtocounter{mysubsection}{10} % same % \arabic{mysection}.\arabic{mysubsection} Blah blah \stepcounter{mysection} \arabic{mysection}.\arabic{mysubsection} Blah blah \stepcounter{mysubsection} \arabic{mysection}.\arabic{mysubsection} Blah blah \addtocounter{mysubsection}{25} \arabic{mysection}.\arabic{mysubsection} Blah blah and more blah blah \)
\mathnormal is not defined by MathJax? $\mathnormal{x}$, so we define it here as a new command. And is \operatorname supported: $\operatorname{f}$ or $\operatorname{f_n^2}$? $$ \newcommand\mathnormal[1]{ \mathrm{#1} } \newcommand\f[2]{ \operatorname{\mathnormal{f}_{\mathnormal{#1}}^{\mathnormal{#2}}} } \begin{equation*} \f{2}{n} \end{equation*} $$
Note that \operatorname{\mathnormal{f}}_{#1}^{#2} (sub- and superscript outside \operatorname) would place the subscript too far away from the letter f. $$ \operatorname{\mathnormal{f}}_n^2 $$
Here the problem begins: Since \operatorname internally applies \mathrm to its argument, \f{2}{n} typesets the exponent n upright. $$ \f{2}{n} $$ On the other hand, if I write
\newcommand\f[2]{ \operatorname{\mathnormal{f}_{\mathnormal{#1}}^{\mathnormal{#2}}} }
then the numbers' font is changed.
This gets really tricky when combining letters (or other operators) and numbers like \f{2mn\cdot x}{\frac{c}{2}}: $$ \f{2mn\cdot x}{\frac{c}{2}} $$
Is there a way to get the "right" letters and the "right" numbers at the same time?
Can you please explain why you want to use \operatorname, instead of just typing f_2^n?
Because of the spacing: E.g. a\f{2}{n}+b is different from a\f{2}{n}+b.
The idea is simply to highlight function symbols in somewhat lengthy equations, such that it is easier to determine which symbols are functions, constants and so on.
Thanks for the info! (Let me mention that it might be OK to do this for educational purposes, but not in usual typesetting.)
It's not clear exactly what layout you want, (perhaps a full minimal example and image in your question would have helped).
The main function of \operatorname is to provide multi-letter operators like log etc, if you want a math italic f it seems that you just need one of these, depending on where you want the limits to go.
The other function is to give it operator spacing, ie a small gap before the argument, so perhaps the first or second form is what you are looking for? $$ f_1^2 x \qquad f_n^2 x \qquad f_1^n x $$ $$ \mathop{f_1^2} x \qquad \mathop{f_n^2} x \qquad \mathop{f_1^n} x $$ $$ \mathop{{}f}_1^2 x \qquad \mathop{{}f}_n^2 x \qquad \mathop{{}f}_1^n x $$ $$ \mathop{{}f}\limits_1^2 x \qquad \mathop{{}f}\limits_n^2 x \qquad \mathop{{}f}\limits_1^n x $$
#1: Samples
MathJax doesn't exactly follow TeX rules it seems: compare with https://tex.stackexchange.com/questions/43008/absolute-value-symbols: \[ \newcommand{\abs}[1]{\lvert{#1}\rvert}% \] \[ \newcommand{\norm}[1]{\lVert{#1}\rVert}% \] \[ \newcommand{\Value}{\frac{1}{2}x^2}% \] \[x=\abs{\Value} \quad \norm{\Value} \qquad\text{non-starred} \] \[x=\abs*{\Value} \quad \norm*{\Value} \qquad\text{starred}\qquad\] \[ x=\left\lvert\Value\right\rvert \] Looks like the \left and \right are necessary if you want to scale those 'verts''...
Source: https://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/BracketsNorms.html:
Brackets and Norms
The frequently used left delimiters include (, [ and {, which are obtained by typing (, [ and \{ respectively. The corresponding right delimiters are of course obtained by typing ), ] and \}. In addition | and || are used as both left and right delimiters, and are obtained by typing | and \| respectively. For example, we obtain
[GIF Image]
by typing
Let $X$ be a Banach space and let $f \colon B \to \textbf{R}$ be a bounded linear functional on $X$. The \textit{norm} of $f$, denoted by $\|f\|$, is defined by \[ \|f\| = \inf \{ K \in [0,+\infty) : |f(x)| \leq K \|x\| \mbox{ for all } x \in X \}. \]
Larger delimiters are sometimes required which have the appropriate height to match the size of the subformula which they enclose. Consider, for instance, the problem of typesetting the following formula:
[GIF Image]
The way to type the large parentheses is to type \left( for the left parenthesis and \right) for the right parenthesis, and let LaTeX do the rest of the work for you. Thus the above formula was obtained by typing \[ f(x,y,z) = 3y^2 z \left( 3 + \frac{7x+5}{1 + y^2} \right). \]
If you type a delimiter which is preceded by \left then LaTeX will search for a corresponding delimiter preceded by \right and calculate the size of the delimiters required to enclose the intervening subformula. One is allowed to balance a \left( with a \right] (say) if one desires: there is no reason why the enclosing delimiters have to have the same shape. One may also nest pairs of delimiters within one another: by typing \[ \left| 4 x^3 + \left( x + \frac{42}{1+x^4} \right) \right|. \] we obtain
[GIF Image]
By typing \left. and \right. one obtains null delimiters which are completely invisible. Consider, for example, the problem of typesetting
[GIF Image]
We wish to make the vertical bar big enough to match the derivative preceding it. To do this, we suppose that the derivative is enclosed by delimiters, where the left delimiter is invisible and the right delimiter is the vertical line. The invisible delimiter is produced using \left. and thus the whole formula is produced by typing \[ \left. \frac{du}{dx} \right|_{x=0}. \]
#1: Samples
Grabbed from https://github.com/odewahn/ipynb-examples.
The Markdown parser included in IPython is MathJax-aware. This means that you can freely mix in mathematical expressions using the MathJax subset of Tex and LaTeX. Some examples from the MathJax site are reproduced below, as well as the Markdown+TeX source.
Motivating Examples
The Lorenz Equations
Source \[ \begin{aligned} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z + xy \end{aligned} \] Display $$\begin{aligned} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z + xy \end{aligned}$$
The Cauchy-Schwarz Inequality
Source \[ \begin{equation*} \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) \end{equation*} \] Display $$\begin{equation*} \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) \end{equation*}$$
A Cross Product Formula
Source \[ \begin{equation*} \mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \end{vmatrix} \end{equation*} \] Display $$\begin{equation*} \mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \end{vmatrix} \end{equation*}$$
The probability of getting (k) heads when flipping (n) coins is
Source \begin{equation*} P(E) = {n \choose k} p^k (1-p)^{ n-k} \end{equation*} Display¶ $$\begin{equation*} P(E) = {n \choose k} p^k (1-p)^{ n-k} \end{equation*}$$
An Identity of Ramanujan
Source \begin{equation*} \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\ldots} } } } \end{equation*} Display $$\begin{equation*} \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\ldots} } } } \end{equation*}$$
A Rogers-Ramanujan Identity
Source \begin{equation*} 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for $|q|<1$}. \end{equation*} Display $$\begin{equation*} 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for $|q|<1$}. \end{equation*}$$
Maxwell's Equations
Source \begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} Display $$\begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}$$
Equation Numbering and References
Equation numbering and referencing will be available in a future version of IPython.
Inline Typesetting (Mixing Markdown and TeX)
While display equations look good for a page of samples, the ability to mix math and formatted text in a paragraph is also important.
Source
This expression $\sqrt{3x-1}+(1+x)^2$ is an example of a TeX inline equation in a **[Markdown-formatted](http://daringfireball.net/projects/markdown/)** sentence.
Display
This expression $\sqrt{3x-1}+(1+x)^2$ is an example of a TeX inline equation in a Markdown-formatted sentence.
#1: Samples
Grabbed from https://tex.stackexchange.com/questions/98433/interaction-of-boldmath-and-not \[ \newcommand*\longnot{% \mathrel{% \mkern-0.75mu \raisebox{-0.8pt}{$\not$}% \mkern1.5mu \raisebox{0.8pt}{$\not$}% \mkern-0.75mu } } \]$\bm{A\not\subseteq B}$ versus $\bm{A\longnot\subseteq B}$
with color: $\color{red}{\bm{R \longnot\subseteq T,\ x \longnot\le y}}$
#1: Samples
Triangle
Let the right triangle hypothenuse be aligned with the coordinate system *x-axis*. The vector loop closure equation then reads $$a{\bold e}_\alpha + b\tilde{\bold e}_\alpha + c{\bold e}_x = \bold 0$$ (1) with $${\bold e}_\alpha = \begin{pmatrix}\cos\alpha\\ \sin\alpha\end{pmatrix} \quad and \quad {\tilde\bold e}_\alpha = \begin{pmatrix}-\sin\alpha\\ \cos\alpha\end{pmatrix}$$
Resolving for the hypothenuse part $c{\bold e}_x$ in the loop closure equation (1) $$-c{\bold e}_x = a{\bold e}_\alpha + b\tilde{\bold e}_\alpha$$
and squaring
> finally results in the Pythagorean theorem (2) > > $$ c^2 = a^2 + b^2 $$ (2)
#1: AsciiMath
... by noting that that `7 / ((k^2 + k + 1)(2k - 1)) = 4 / (2k - 1) - (2k + 3) / (k^2 + k + 1)` and that `sum_(k=-n)^(n+1) 1 / (2k - 1) = sum_(k=-n)^(n+1) (2k - 1) / (k^2 + k + 1) = 0` (quoting reference: Knuth Fascimile 5A, answer to exercise 129, pp. 49)
`1` or `2+3` or `a + b`
#1: LaTeX Symbols
- https://www.ctan.org/pkg/comprehensive
- https://github.com/github/markup/issues/897
- https://docsify.js.org/#/
- https://github.com/cben/mathdown/wiki/math-in-markdown
- https://marketplace.visualstudio.com/items?itemName=goessner.mdmath
- https://www.ctan.org/tex-archive/macros/latex/contrib/semantic
- https://github.com/gajus/usus#using-via-the-command-line-interface-cli
#1: Repeating decimal fractions are rational