BU Logo HowTo
Use Latex Math Mode Prof. Bartenstein
 

Contents:

Overview

Why use Latex Math Mode?

Often, it is difficult to create easy to read mathematical formulas using strictly typewritten text, especially when that text is formatted by a document creation tools such as Microsoft Word, or when composing text to be displayed in a web browser. Most textbooks and technical papers are written using a very powerful markup driven formatting tool called Latex. The Latex Math Mode is a subset of latex devoted to making it easier to define and format mathematical formulas. If you learn a little about Latex Math Mode, it will make it much easier to create professional mathematical formula displays. Many tools, such as Brightspace and Gradescope, provide the capability of entering formulas using a Latex Math Mode syntax, and displaying the result.

Latex Math Mode is a markup language, like HTML. You type both text and markup information that is then translated and displayed without the markup, but with a better formated result.

arrow_circle_up

How do I get into Latex Math Mode?

Different tools use Latex Math Mode in different ways. The following list shows some of the more important tools, and how those tools use Latex Math Mode

Tool User Text Formatted Result Comments
Latex The result of $x \times 2^{10}$ is big. The result of x × 210 is big. Math mode text is contained in pairs of single dollar signs ($)
Gradescope The result of $$x \times 2^{10}$$ is big. The result of x × 210 is big. Math mode text is contained in pairs of double dollar signs ($$)
Brightspace x \times 2^{10} x × 210 In a formatted text box, click on the "+v" icon, select "Equation", and then "LaTeX Equation" to get a pop-up to fill in the equation markup as described below.

arrow_circle_up

What kinds of markup can I use?

You can use Latex Math Mode Markup to do many things.

arrow_circle_up

How does the Latex Math Mode handle unmarked text?

Not all text in a Latex Math Mode string is markup. You can also enter raw text. In math mode, this raw text is formatted as follows:

alpha-numeric characters
Alpha-numeric characters are displayed using an italic font, as if they were variable names.
white space
White space in general is ignored. Since we are only describing embedded math strings, newlines aren't allowed, and blanks and tabs are ignored. To get true white space in math mode, see Adding White Space.
Operators
Operators such as + or > are recognized by Latex Math Mode, and space is added to the left and right of these operators.

Warning: Some characters are reserved to indicate markup. The list of these characters is in Markup Syntax below.

arrow_circle_up

Math Mode Mark-up

Markup Syntax

Markup in Latex Math Mode uses Latex markup conventions. Most text is unmarked text. However, there are some special characters that signal to Latex that markup follows. Clearly, these characters cannot be used as raw text. These special characters are as follows:

Backslash (\)
A backslash indicates the start of a markup command. The text following the backslash is the command name. The command name may optionally be followed by optional arguments in square brackets ([]) and/or positional arguments in curly braces ({}). Each command has a specific impact on formatting.
Percent Sign (%)
A percent sign is used to start a line comment in Latex and should be avoided in Math Mode. If you need an actual percent sign, use \%.
Curly Braces ({...})
Curly braces are used to group text in Latex, and should not be used in Latex Math Mode as actual characters. To get actual curly braces in Math Mode, use \{ \} instead of { and }.
Underscore (_)
An underscore indicates that the next character or curly brace enclosed group of charactes should be formatted as a subscript.
Circumflex (^)
A circumflex indicates that the next character or curly brace enclosed group of charactes should be formatted as a superscript.

arrow_circle_up

Math Mode Operators

The following table shows the most common mathematical operators, and how to format those operators in Latex Math Mode.

Op Markup Comments
+, -, / +, -, / Operators that appear on the keyboard need no special markup.
×, ·, ÷ \times, \cdot, \div Multiplication and division operators not on the keyboard.
x+1
y+2
\frac{x+1}{y+2} A fraction in which the numerator is the first group of text enclosed in curly braces after \frac, and the denominator is the second group. Groups may contain any valid math mode text, including more markup. Fractions are formatted with a horizontal line with the numerator on top and the denominator on the bottom.
∑, ∏, lim, ∫ \sum, \prod, \lim, \int Operators that traditionally have limits. Limits can be added using subscript and/or superscript notation (see the subscript/superscript section below). For example \sum_{n=0}^\infty for the sum from n=0 to infinity.
≠, ≤, ≥\ne, \leq, \geq Relational operators not on the keyboard.
∩, ∪, ⊂, ⊃ \cap, \cup, \subset, \supset Set operators for intersection, union, superset, and subset.
sin, cos, tan, ... \sin, \cos, \tan, ... Trig functions. The backslash causes the function names to appear in a non-italic font instead of the italic font used for variables.

arrow_circle_up

Greek Letters

The following table shows greek letters, and how to format those letters in Latex Math Mode.

Letter Markup Comments
α,β,γ... \alpha,\beta,\gamma, ...Lowercase greek letters.
Α,Β,Γ... \Alpha, \Beta, \Gamma, ...Uppercase greek letters.

arrow_circle_up

Using Subscripts and Superscripts in Math Mode

Mathematical formulas often use subscripts or superscripts to do things like differentiate variables, or use superscripts as a "to the power" operator.

In Latex Math mode, an underscore (_) indicates that the following character or group of characters enclosed in curly braces should be formatted using a subscript. For example, the text X_{min} would get formatted as: Xmin.

Similarly, a circumflex (^) indicates that the following character or group of characters enclosed in curly braces should be formatted using a superscript. For example, the text 2^{32} would get formatted as: 232

Both superscript and subscript can be used at the same time, such as X_y^3 would get formated as: Xy3

arrow_circle_up

Adding White Space

In math mode, white space is ignored. This can be frustrating if you want to add blanks. The question is, how wide do you want the blank space to be? Math mode markup provides detailed control over the width of a blank. The following table summarizes the white space markup.

Markup Description
\ (that's a backslash followed by a space.) Inserts the equivalent of a space in normal text.
\quad Inserts space equal to the current font size width (often wider than a normal text space).
\; Inserts 5/18 of a \quad
\: Inserts 4/18 of a \quad
\, Inserts 3/18 of a \quad
\! Removes 3/18 of a \quad - actually moves the following text to the left
\qquad Inserts twice the space of a \quad

arrow_circle_up

Latex Math Mode References

This web page covers the basics, but there's a lot more about Latex Math Mode out there. For more detail, here are some recommended web sites to look up:

Overleaf Mathematical Expressions
Overleaf is a Latex editor, but has some good documentation.
Geeks for Geeks Relational Operators in Latex
A good reference for Latex operator symbols.
Wikibooks Latex/Mathematics Environemnt
Comprehensive and detailed information about Latex Math Mode

arrow_circle_up