Canvas Equation Editor Tips: Advanced View

With the Advanced View of the Canvas Equation Editor, you can input more complicated mathematical text using LaTeX, like matrices, interval notation, and piecewise functions. In case you don’t have a lot of LaTeX experience, here are some tips for how to write LaTex for some commonly used mathematics.

 

Interval Notation (mixed parentheses and brackets)


For interval notation using parentheses on both sides or brackets on both sides, you can use the basic view. Just type ( to get ( ) or [ to get [ ] in the editor.

Symbols in Advanced View
Symbol Code
Left parenthesis \left(
Left bracket \left[
Right parenthesis \right)
Right bracket \right]
infinity symbol \infty
negative infinity -\infty
square root \sqrt{ }
fraction \frac{ }{ }

Below are several examples that should help you construct the LaTeX for the interval notation you need.

LaTex Samples
Display LaTex in Advanced View
LaTeX: \left(x,y\right](x,y] \left(x,y\right]
LaTeX: \left[x,y\right)[x,y) \left[x,y\right)
LaTeX: \left[-2,\infty\right)[2,) \left[-2,\infty\right)
LaTeX: \left(-\infty,4\right](,4] \left(-\infty,4\right]
LaTeX: \left(\sqrt{5} ,\frac{3}{4}\right](5,34] \left(\sqrt{5} ,\frac{3}{4}\right]

 

Piecewise Functions


You can use the Advanced View of the Canvas Equation Editor to write piecewise functions. To do this, you will need to write the appropriate LaTeX to express the mathematical text (see example below):

Sample equation
Code Equation

f(x) = \left\{

\begin{array}{Ir}

1+x & \text{if} x <3\\

1-x & \text{if} x >3

\end{array}

\right

LaTeX: f(x) = \left\{
\begin{array}{Ir}
1+x & \text{if } x <3\\
2 & \text{if } x =3\\
1-x & \text{if } x >3
\end{array}
\right.f(x)={1+xif x<32if x=31xif x>3

 

This kind of LaTeX expression is like an onion - there are many layers. The outer layer declares the function and a resizing brace:

Outer layer of function

The next layer in builds an array to hold the function definitions and conditions:

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.

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 are some useful symbols and notations to use as you construct piecewise functions:

Piecewise Functions
Notation Symbols
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

Another Example of Piecewise functions

Sample Equation
Code Equation
f(x)=\left\{1 when xQ0 when xQ
\right.
LaTeX: f(x)=\left\{\begin{array}{ll}
1 & \text { when } x \in \mathbb{Q} \\
0 & \text { when } x \notin \mathbb{Q}
\end{array}\right.f(x)={1 when xQ0 when xQ

 

Determinants and Matrices


Determinants and matrices have the same general structure them.

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, the symbol & is used to separate elements of the array and the notation \\ is used for line breaks.

Matrices samples

Any of these can be rewritten 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:

A=\left(\frac{1}{2}\right)

Produces this equation: LaTeX: A=\left(\frac{1}{2}\right)A=(12)

Augmented Matrices

An augmented matrix is built using the same kind of notations as in the previous examples with one new
twist:

{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

The symbol & is used to separate the cells of the array and \\ is used as a line break.

Sample Augmented Matrices

Sample Equation
Code Equation
\left(\begin{array}{ccc|c}
1 & 2 & 3 & \pi \\
4 & 5 & 6 & \sqrt{5} \\
7 & 8 & 9 & -3
\end{array}\right)
LaTeX: \left(\begin{array}{ccc|c}
1 & 2 & 3 & \pi \\
4 & 5 & 6 & \sqrt{5} \\
7 & 8 & 9 & -3
\end{array}\right)(123π45657893)
\left(\begin{array}{lll|lll}
1 & 2 & 3 & 1 & 0 & 0 \\
4 & 5 & 6 & 0 & 1 & 0 \\
7 & 8 & 9 & 0 & 0 & 1
\end{array}\right)
LaTeX: \left(\begin{array}{lll|lll}
1 & 2 & 3 & 1 & 0 & 0 \\
4 & 5 & 6 & 0 & 1 & 0 \\
7 & 8 & 9 & 0 & 0 & 1
\end{array}\right)(123100456010789001)

To change to an augmented matrix in brackets, change to using \left[ at the beginning and \right] at the
end.

Creating Tables

You can use the Advanced View to make tables as well. This also uses the same basic principles as
arrays and matrices with just a few tweaks.

\hline inserts a horizontal line the width of the array
{c|ccc} array with 1 column, 1 vertical line, 3 columns
{|c|c|c|c|} array with vertical lines around all 4 columns


The symbol & is used to separate the cells of the array and \\ is used as a line break. Here are two
examples to help you construct a proper table.

Sample Equations
Code Equation
\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}
LaTeX: \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}xf(x)g(x)h(x)234605002746491612
\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}
LaTeX: \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}x21012f(x)76543

Special Characters

Because they are used to construct equations, certain characters may not appear in the Rich
Content Editor after they are typed into the Math Editor. If you need these characters to appear
as-is in your equation, use the workaround table below.

Workarounds
Character Workaround
# \# or \##
$ \$ or \$$
% \% or \%%
& \& or \&&
^ \^
_ \_ or \__
{ \{ or \{{
} \} or \}}
~ \~~

LaTeX for Advanced View Examples

These are provided if you'd like to copy and paste the LaTeX from the examples into the Advanced View
of the Equation Editor to tinker with the examples.

Interval Notation Examples

\left(x,y\right]
\left[x,y\right)
\left[-2,\infty\right)
\left(-\infty,4\right]
\left(\sqrt{5} ,\frac{3}{4}\right]

Determinants and Matrices

A=\begin{pmatrix}
0 & 2 \\
-1 & 5
\end{pmatrix}
A=\begin{bmatrix}
\frac{2}{3} & 2 \\
-1 & \sqrt{5}
\end{bmatrix}
A=\begin{vmatrix}
10 & -5 \\
0 & 20
\end{vmatrix}
A=\left(\frac{1}{2}\right)


Creating Tables


\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}
\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}


Piecewise Functions


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.
f(x)=\left\{
\begin{array}{lr}
1 & \text{when }
x\in\mathbb{Q} \\
0 & \text{when }
x\notin\mathbb{Q}\\
\end{array}
\right.


Augmented Matrices


\left(\begin{array}{ccc|c}
1 & 2 & 3 & \pi \\
4 & 5 & 6 & \sqrt{5} \\
7 & 8 & 9 & -3
\end{array}\right)
\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)