Writing \(\LaTeX\) on webpages using MathJAX
To write LaTeX on a webpage, one must include the MathJAX script in the page to allow the browser to interpret LaTeX. This can be accomplished by taking the following steps:
Setup steps
- Open the page you would like to put LaTeX on.
- Lock the page for editing and click "edit content" to edit the content area where you intend to place the LaTeX.
- Switch the window's view from WYSIWYG to CODE view.
- Paste the following into the editor:
Embedding LaTeX in HTML
Even though MathJax allows LaTeX to be rendered on websites, it still requires some alterations to make the content fit within the context of the page. Paragraphs in HTML should be wrapped in paragraph tags. Within paragraphs, one can use inline LaTeX by wrapping the LaTeX in escaped parentheses \\( \\). For display-style rendering (such as the matrix definition in the following example), create a new paragraph tag and then place the LaTeX content in this tag, with the LaTeX content wrapped in double-dollar signs $$ \$$. Note that LaTeX can also be used in other HTML elements such as unordered lists and ordered lists. See the example for details.Example code
The following code yields the example rendered below:
Rendered example
Consider the matrix
$$C = \begin{bmatrix}8 & 4 \\ 4 & 8\end{bmatrix}$$
- Compute the characteristic polynomial for \(C\). You should find two linearly independent eigenvectors \(\mathbf{v}_1\) and \(\mathbf{v}_2\). Let \(\mathcal{B} = \{\mathbf{v}_1, \mathbf{v}_2\}\).
- Compute the standard matrix for the composite linear transformation $$\mathbb{R}^2 \overset{P_{\mathcal{B}}}{\longrightarrow}\mathbb{R}^2 \overset{C}{\longrightarrow} \mathbb{R}^2 \overset{P_{\mathcal{B}}^{-1}}{\longrightarrow} \mathbb{R}^2$$
Recall that \(P_{\mathcal{B}}^{-1}\) is the coordinate mapping defined by \(\S 4.4\) (so, \(\mathbf{x} = P_{\mathcal{B}}[\mathbf{x}]_{\mathcal{B}}\)). [Hint: where does the composite transformation send the basis vectors \(\mathbf{e}_1\) and \(\mathbf{e}_2\)? (And, recall that \(P_\mathcal{B} = \begin{bmatrix}\mathbf{v}_1 & \mathbf{v}_2\end{bmatrix}\)).