Canvas Equation Editor Tips: Math Expressions Using LaTeX
This document provides instruction for using LaTex in the Canvas Equation Editor.
In the Canvas Equation Editor, available in the Rich Content Editor, you can use LaTeX code to enter more complicated mathematical expressions such as such interval notation, piecewise functions, matrices, determinants, and tables. This document provides tips for entering mathematical expressions using LaTeX.
You can learn more about using the Equation Editor.
Notes:
- In addition to the Equation Editor, you can manually enter equations in any Canvas area that includes a text field, such as the title of an assignment or in a calendar event.
- Other resource documents provide tips for entering expressions related to chemistry.
Symbols and Operators
Many symbols and operators are available in the toolbar of the Equation Editor, but you can also enter them using LaTeX. If you prefer to enter expressions and equations via LaTeX code, you can refer to the following table:
x ^ 2 | \cap | f \circ g | |||
x_2 | \le | \infty | |||
/sqrt | \ge | \angle C | |||
\nthroot | \in | \partial | |||
3/5 | \notin | \rightarrow | |||
y^\prime | \subset | \lim_x\rightarrow a | |||
y\prime\prime | \notsubset | \vert (or | key on keyboard) | |||
\pm | \subseteq | \cup | |||
3*9 or 3 \cdot 9 | \varnothing | \parallel | |||
3 \times 9 | \approx | \sum | |||
9 \div 3 | \ne | \perp | |||
\therefore | \ell | \int |
Note: You can enter line breaks with \\ (two backslashes).
Additional Symbols and Notation
The following symbols and notation are available on the Equation Editor toolbar or via the following LaTeX codes:
Non-italicized text "if": \text{if }
Non-italicized text "when": \text{when }
Is an element of: \in
Is not an element of: \notin
Symbol for Real Numbers: \mathbb{R}
Symbol for Integers: \mathbb{Z}
Symbol for Rationals: \mathbb{Q}
Is less than or equal to: \le
Is greater than or equal to: \ge
Is not equal to: \ne
Interval Notation (mixed parentheses and brackets)
For interval notation using parentheses on both sides or brackets on both sides, you can type ( to get ( ) or [ to get [ ] in the editor.
Display |
LaTeX Code |
left parenthesis |
\left( |
right parenthesis |
\right) |
left bracket |
\left[ |
right bracket |
\right] |
Below are several examples of LaTeX code that you can use for interval notation.
Display |
LaTeX Code |
|
\left(x,y\right] |
|
\left[x,y\right) |
|
\left[-2,\infty\right) |
|
\left(-\infty,4\right] |
|
\left(\sqrt{5} ,\frac{3}{4}\right] |
Examples:
\left(x,y\right]
\left[x,y\right)
\left[-2,\infty\right)
\left(-\infty,4\right]
\left(\sqrt{5} ,\frac{3}{4}\right]
Piecewise Functions
You can use LaTeX in the Canvas Equation Editor to write piecewise functions. Here are some examples:
This kind of LaTeX expression contains layers. The outer layer declares the function and a resizing brace:
The next layer in builds an array to hold the function definitions and conditions:
The innermost layer defines the functions and conditions. The symbol & is used to separate the cells of the array and \\ is used as a line break.
Here is another example of piecewise functions:
Example 1:
f(x)=\left\{
\begin{array}{lr}
1+x & \text{if } x<3 \\
2 & \text{if } x=3 \\
1-x & \text{if } x>3
\end{array}
\right.
Example 2:
f(x)=\left\{
\begin{array}{lr}
1 & \text{when } x\in\mathbb{Q} \\
0 & \text{when } x\notin\mathbb{Q}\\
\end{array}
\right.
Note: You can enter line breaks with \\ (two backslashes)
Determinants and Matrices
You can use LaTeX matrix notation to enter determinants and matrices in the Canvas Equation Editor.
Matrix in parentheses:
\begin{pmatrix} and \end{pmatrix}
Matrix in brackets:
\begin{bmatrix} and \end{bmatrix}
Determinant:
\begin{vmatrix} and \end{vmatrix}
Inside the matrix structure, you can use the symbol & to separate elements of the array and \\ for line breaks. Here are three examples:
Any of these can also be written in one line, like this:
A=\begin{vmatrix} 10 & -5 \\ 0 & 20 \end{vmatrix}
Note: When the matrix only holds one value, you may need to use the \left and \right delimiters to get the parentheses, brackets, or braces to resize:
Example 1:
A=\begin{bmatrix}
\frac{2}{3} & 2 \\
-1 & \sqrt{5}
\end{bmatrix}
Example 2:
A=\begin{pmatrix}
0 & 2 \\
-1 & 5
\end{pmatrix}
Example 3:
A=\begin{vmatrix}
10 & -5 \\
0 & 20
\end{vmatrix}
A=\left(\frac{1}{2}\right)
Augmented Matrices
You can build an augmented matrix using column notation:
{ccc|c} Augmented matrix with 3 columns, one vertical line, 1 column
{ccc|ccc} Augmented matrix with 3 columns, one vertical line, 3 columns
{cc|cc} Augmented matrix with 2 columns, one vertical line, 2 columns
Use the symbol & to separate the cells of the array and \\ as a line break.
To change to an augmented matrix in brackets, change to using \left[ at the beginning and \right] at the end.
Example 1:
\left(\begin{array}{ccc|c}
1 & 2 & 3 & \pi \\
4 & 5 & 6 & \sqrt{5} \\
7 & 8 & 9 & -3
\end{array}\right)
Example 2:
\left(\begin{array}{ccc|ccc}
1 & 2 & 3 & 1 & 0 & 0 \\
4 & 5 & 6 & 0 & 1 & 0 \\
7 & 8 & 9 & 0 & 0 & 1
\end{array}\right)
Tables
You can use LaTeX to create tables.
\hline inserts a horizontal line the width of the array
{c|ccc} table with 1 column, 1 vertical line, 3 columns
{|c|c|c|c|} table with vertical lines around all 4 columns
Use the symbol & to separate the cells of the table and \\ for a line break. Below are some examples:
Example 1:
\begin{array}{c|ccc}
x & f(x) & g(x) & h(x) \\
\hline
-2 & 3 & 4 & -6 \\
0 & 5 & 0 & 0 \\
2 & 7 & 4 & 6 \\
4 & 9 & 16 & 12
\end{array}
Example 2:
\begin{array}{|c|c|c|c|c|c|}
\hline
x & -2 & -1 & 0 & 1 & 2\\
\hline
f(x) & -7 & -6 & -5 & -4 & -3 \\
\hline
\end{array}
Special Characters
Because they are used to construct equations, certain characters may not display as expected when entered into the Equation Editor. If you need these characters to appear as-is in your expression, use the workaround table below.
Character |
Workaround |
# |
\# or \## |
$ |
\$ or \$$ |
% |
\% or \%% |
& |
\& or \&& |
^ |
\^ |
_ |
\_ or \__ |
{ |
\{ or \{{ |
} |
\} or \}} |
~ |
\~~ |
Last update: 2024-04-22
You can access this resource from the following Canvas Guide: