# Typing Mathematics in Microsoft Word

This book is about the Math Builder (officially called as Equation Editor) tool in Microsoft Word and Outlook 2007 and higher. It also applies to Microsoft PowerPoint and Excel 2010 and higher. Note that this is a different tool than the legacy tool Equation Editor 3.0 (which is still available on 32-bit Office versions until the January 2018 update) and MathType.
Typesetting mathematics on a computer has always been a challenge. The mathematical community almost universally accepts a typesetting language called LaTeX. Math Builder is a much easier to use tool that has less functionality than LaTeX but more than typical document processing. Microsoft call this hybrid language the Office Math Markup Language, or OMML for short. It is an appropriate tool for:
* Typing any document whose focus is not itself mathematics.
* Typing a short math document quickly.
* A stepping stone between word processing (MS Word) and typesetting (LaTeX)
Note that Math Builder does not perform any mathematics; it is a tool for displaying it.

## Pros and Cons

Pros:
* Math Builder is WYSIWYG: after typing an equation you see immediately what it looks like.
* It's easy to get started: it's already built in to Microsoft Word. Common symbols have point-and-click icons.
* It's easy to use: Common symbols have keyboard shortcuts so that a veteran user need not use a mouse at all.
* Nearly all symbols use the same commands as LaTeX.
* The format used is non-proprietary and given in Unicode Technical Note #28.
* It can be used in Outlook to easily write equations in emails; it renders as images to the recipent.
Cons:
* Some uncommon symbols are not listed in the menu and require knowing the keyboard shortcut. Typically this is the LaTeX code for the symbol.
* There are differences between Math Builder and LaTeX code: advanced functionality that requires more than just a symbol tend to follow the same flavor but have slightly different syntax. Math Builder code tends to be shorter than LaTeX code and disappears upon completion to the WYSIWYG output. Examples here are matrices, multiple aligned equations, and binomial coefficients.
* No LaTeX typesetting tools such as labels and references are implemented.
* No highly advanced LaTeX tools such as graphing, commutative diagrams, or geometric shapes are implemented. (Note:- Geometric shapes are otherwise available in the Insert ribbon)
* Students studying mathematics might not be motivated to learn LaTeX because they might be able to get by with Equation Builder in Word to satisfy the vast majority of their needs. However, when such a student reaches the limits, unlike LaTeX there is absolutely no recourse to expand the program to satisfy it.

## Inserting an equation

Microsoft Word has two different typing environments: text and math. To obtain the math environment, click on "Equation" on the "Insert" ribbon on Windows or Word for Mac '16, or in "Document Elements" on Word for Mac '11. The keyboard shortcut is "alt"+ "=". For a Mac system, the shortcut is "control" + "=" or "control" + "shift" + "+". Everything you type in this environment is considered math: all automatic formatting of text is disabled. To exit the math environment, click on any text outside the math environment. One easy way to do this is by pressing the right arrow key.

## Common Mathematics
### Fractions

There are multiple ways to display a fraction. The default is vertically aligned as illustrated below. Obtain this by typing the fraction and pressing space: 1/2
${\frac {1}{2}}$
Linear fraction (resp. skewed fraction) is obtained using \ldiv (resp. \sdiv) and pressing space (twice) or by typing 1 \ldiv 2 (resp. 1 \sdiv 2) and pressing space. While you can also do this by right-clicking on the equation and clicking Linear, this affects the whole equation and not just the fraction.
${v}/{p}$

### Parenthesis, brackets, and braces

Grouping symbols will automatically size to the appropriate size. These symbols include ",,, ||". For instance, the expression below can be obtained with (1/2(x+1)):
$\left({\frac {1}{2}}(x+1)\right)$
Be careful to press space after the "2" to render the fraction, otherwise Word might put "x+1" in the denominator. Also press space after typing every closing parenthesis ")", which will adjust both the opening and closing parentheses size to fit the group's contents. Because the 1/2 fraction is is quite tall, the outer parentheses need to be adjusted to enclose the fraction appropriately. To be exact, the key presses required to reproduce the equation above are ( 1 / 2 space ( x + 1 ) space(optional) ) space.

### Exponents and subscripts

Exponents can be obtained by using "^" and subscripts by "_". The monomial below can be obtained by typing x_2^5 or x^5_2 and pressing space.
$x_{2}^{5}$

### Symbols: $\neq ,\leq ,\subseteq ,\vee ,\rightarrow ,\Rightarrow$ etc

These are all common symbols. The easiest thing to do would be to find a LaTeX reference sheet. A few of those symbols are shown here:
| code | output |
| \neq or /= | $\neq$ |
| \leq or <= (resp. \geq or >= ) | $\leq$ (resp $\geq$) |
| \subseteq | $\subseteq$ |
| \vee | $\vee$ |
| \rightarrow or -> | $\rightarrow$ |
| \Rightarrow or => | $\Rightarrow$ |
| \times | $\times$ |
| \div | $\div$ |
| \pm or +- or -+ | $\pm$ |
| \infty | $\infty$ |
| \otimes (resp. \oplus) | $\otimes$ (resp. $\oplus$) |
| \hbar | $\hbar$ |
| \partial | $\partial$ |

### Greek, Script, and Fraktur letters

The math environment implements 3 fronts in addition to the default.
* Greek letters can be obtained by typing a "\" followed by the name of symbol. Capitalizing it creates a capital letter. \delta \Delta produces $\delta \Delta$
* Script letters can be obtained by typing "\" followed by "script" followed by the letter. \scriptd \scriptD produces ${\mathcal {d}}{\mathcal {D}}$
* Fraktur letters can be obtained by typing "\" followed by "fraktur" followed by the letter. Fraktur does not have capitals. \frakturd produces ${\mathfrak {d}}$

### Blackboard Bold letters

Blackboard bold letters can be obtained by typing "\" followed by "double" followed by the letter. \doubled \doubleD produces $\mathbb {d} \mathbb {D}$

### Mathematical Physics
#### Vectors

A vector is often denoted by an overhead right arrow, which can be obtained by following a letter variable with "\vec": ${\overrightarrow {A}}$. Unit vectors (e.g. ${\hat {x}}$) are denoted by a hat (circumflex), which can be obtained by following a letter variable with "\hat". The gradient (also known as del or nabla) operator $\nabla$ may be displayed using "\nabla".

#### Newtonian Dot Notation

Dot notation for time derivatives (e.g. ${\dot {r}},{\ddot {r}}$) can be obtained by following a letter variable with "\dot" for a first derivative and "\ddot" for a second derivative.

#### Vector Products

The dot product (inner product) can be displayed using the centered dot symbol "\cdot" e.g. the divergence $\nabla \cdot A$. The cross product can be displayed using "\times" e.g. the curl $\nabla \times A$.

### Matrices

Matrices are obtained with the "\matrix" symbol. Use parentheses to start and end the matrix. Use "@" to separate rows, and "&" to separate columns. The matrix below can be created by typing [\matrix(1&2&3@4&5&6)].
${\begin{bmatrix}1&2&3\\4&5&6\end{bmatrix}}$

### Multiple Aligned Equations

Aligning equations can be obtained with the "eqarray" symbol. Use parentheses to start and end the matrix. Use "@" to separate equations. Use "&" to specify alignment and whitespace. The first "&" and then every other occurrence is alignment. The second and then every other occurrence is white space. The equations below can be obtained by typing the following text:
${\begin{aligned}2&x+&3&y=5\\&x+&&y=7\end{aligned}}$
(The math environment here seems to be adding excess space between the alignments that doesn't occur in Word)

### Radicals

Radicals are obtained using the "\sqrt" symbol, followed by the index, then "&", then the radicand.
For example: \sqrt(a&b) will output ${\sqrt[{a}]{b}}$.
Additionally, \sqrt(x) will simply output ${\sqrt {x}}$.

### Integrals

| code | output |
| \int | $\int$ |
| \int_a^b | $\int _{a}^{b}$ |
| \iint_a^b | $\iint _{a}^{b}$ |
| \iiint_a^b | $\iiint _{a}^{b}$ |
| \oint_a | $\oint _{a}$ |
| \oiint_a | ∯$_{a}$ Double oriented integral (No corresponding Wikibooks math symbol) |
| \oiiint_a | ∰$_{a}$ Triple oriented integral (No corresponding Wikibooks math symbol) |
| \coint_a | ∲$_{a}$ Clockwise oriented integral (No corresponding Wikibooks math symbol) |
Integrals are obtained by inserting the desired integral symbol (see above table), and then pressing space twice.
For example: \int_a^b space space 1/x space dx will output $\int \limits _{a}^{b}{\frac {1}{x}}\,dx$

## Inline versus Display

Equations have two forms. Inline specifies that the equation is to be in line with text. This affects a few expressions to make them appear smaller. For instance fractions will use a smaller font. Summations and integrals will place the endpoints to the right of the symbol instead of below it. Display specifies to use as much space as needed. Display mode equations must appear on their own line.

## Modifying and creating shortcuts

Everything in Math Builder requires special symbols that the computer knows how to interpret. These symbols are constructed with all the commands starting with "\" as illustrated in the above sections. This is implemented via math autocorrect which you can modify. For instance, you might like to use \ra instead of \rightarrow. You can do this by adding the command to the math autocorrect directory.

## References

* ↑ https://support.office.com/en-us/article/Equation-Editor-6eac7d71-3c74-437b-80d3-c7dea24fdf3f
* ↑ Iztok Hozo. "Using Word 2007's new equation editor" (PDF). Indiana University Northwest. Retrieved 06-05-2019. {{cite web}}: Check date values in: |accessdate= (help); Unknown parameter |dateformat= ignored (help)