Mathematical equations directly in Canvas
Here is an example of $T_{n}$
Tn
A more complex example:
E=mc2
If you put in the LaTeX expression as an in-line equation, such as $E = mc^2$, into the advanced editor, you get:
$E=mc2$
However, trying to enter in Advanced editing mode:
(t′+z′x′−iy′x′+iy′t′−z′)=(αβγδ)(t+zx−iyx+iyt−z)(α∗γ∗β∗δ∗).
leads to:
(t′+z′x′−iy′x′+iy′t′−z′)=(αβγδ)(t+zx−iyx+iyt−z)(α∗γ∗β∗δ∗)
Leaving out the \begin and \end equation leads to:
(t′+z′x′−iy′x′+iy′t′−z′)=(αβγδ)(t+zx−iyx+iyt−z)(α∗γ∗β∗δ∗)
However, one can see that the equation was rendered correctly in the editor - but does not get inserted properly (even when leaving out the trailing period):
Another version of matrices:
(u′v′)=(eη00e−η)(uv)
In this case using the LaTeX:
\begin{pmatrix}u' \cr v'\end{pmatrix} = \begin{pmatrix}e^{\eta} & 0 \cr 0 & e^{-\eta}\end{pmatrix} \begin{pmatrix}u \cr v\end{pmatrix}
Hence perhaps I should try:
\begin{pmatrix}t^{\prime} + z^{\prime} & x^{\prime} - iy^{\prime} \cr x^{\prime} + iy^{\prime} & t^{\prime} - z^{\prime}\end{pmatrix} = \begin{pmatrix}\alpha & \beta \cr \gamma & \delta\end{pmatrix} \begin{pmatrix}t + z & x - iy \cr x + iy & t - z\end{pmatrix} \begin{pmatrix}\alpha^{*} & \gamma^{*} \cr \beta^{*} & \delta^{*} \end{pmatrix}
(t′+z′x′−iy′x′+iy′t′−z′)=(αβγδ)(t+zx−iyx+iyt−z)(α∗γ∗β∗δ∗)
We can note that the above works correctly, hence one has to use the \begin{pmatrix} \end{pmatrix} formulation rather than \pmatrix{} - i.e., use the AMS formulation, rather than the TeX formulation.
Using MathML one can enter the following via the HTML editor:
<math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <msup><mi>a</mi><mn>2</mn></msup> <mo>+</mo> <msup><mi>b</mi><mn>2</mn></msup> <mo>=</mo> <msup><mi>c</mi><mn>2</mn></msup> </mrow> </math>
You get the following equation out -(which is incorrect) as it seems to strip the MathML out! :
a2+b2=c2
Another example
<math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <mo>+</mo> <mrow> <mn>4</mn> <mo></mo> <mi>x</mi> </mrow> <mo>+</mo> <mn>4</mn> </mrow> <mo>=</mo> <mn>0</mn> </mrow> </math>
produces:
x2+4x+4=0
As the editor strips out the MathML.
The pages seems to use MathJax Links to an external site. to render the mathematical equations on the page.
Since the page is using MathJax, can one just put equations in directly without the editor? Such as When $a \ne 0$, there are two solutions to ax2+bx+c=0 and they are x=−b±√b2−4ac2a.
(The idea to try this came from https://eastsideprep.instructure.com/courses/1054508/pages/javascript-injecting-mathjax?module_item_id=7579448 . Which discusses injecting MathJAX into a Canvas page.)
Interestingly one can put the text of the above without the $s and putting the text into \text{xxxx} in the advanced LaTeX Math editor and get:
When a≠0, there are two solutions to (ax2+bx+c=0) and they are x=−b±√b2−4ac2a
It is interesting to see that the image (<img class="equation_image" ...> ) that is inserted has as the value of the "alt" attribute the LaTeX:
alt="\text{When } a \ne 0 \text{, there are two solutions to } (ax^2 + bx + c = 0) \text{ and they are } x = {-b \pm\sqrt{b^2-4ac}\frac{2}{a}}"
also this is the value of the "title" attributes
title="\text{When } a \ne 0 \text{, there are two solutions to } (ax^2 + bx + c = 0) \text{ and they are } x = {-b \pm\sqrt{b^2-4ac}\frac{2}{a}}"
Put in an equation, but without an image "src" attribute:
Now visit this equation with the editor - selected the whole text and then copy to the clipboard: (t′+z′x′−iy′x′+iy′t′−z′)=(αβγδ)(t+zx−iyx+iyt−z)(α∗γ∗β∗δ∗)
Put in an equation, but without an image "src" or "alt" attribute:
This did not produce anything.
Put in an equation, but without an image "src" or "title" attribute:
(t′+z′x′−iy′x′+iy′t′−z′)=(αβγδ)(t+zx−iyx+iyt−z)(α∗γ∗β∗δ∗)