The most basic way to add LaTeX to Canvas content is using the LaTeX Equation Editor which is accessible via the Insert Math Equation button on the editor’s toolbar. However, for more extensive or complex documents, you can also add LaTeX directly to Canvas pages as well as upload a folder and link to it. These methods are described below.
Adding LaTeX Directly to the Canvas Rich Text Editor
You can type or paste LaTeX directly into a Canvas Page (or other content area). To do this, use the delimiters \( and \) for inline and $$ and $$ for display math.
To display LaTeX, Canvas currently uses version 2.7.7 of MathJax with the TeX-MML-AM_SVG configuration. You can read some key information about what MathJax supports in these pages:
The pages above relate to version 3.2 of MathJax. The MathJax 2.7.7 documentation doesn’t appear to be as clear on these areas.
If you wish to use a custom MathJax configuration, this cannot be done using the Editor. However, you can use the method described below.
Adding Folders Containing LaTeX Files to Canvas
In some cases, it may be cumbersome or repetitive to add and maintain LaTeX directly on Canvas Pages. This may be because there are many linked pages that are updated using a TeX editor, because a specific MathJax configuration is used or because macros are defined in one file and referenced throughout.
In this case, you can upload a zipped folder of files to the Canvas files area and embed one or more of these files into Canvas pages.
To do this:
1. Upload the zipped folder to the Canvas files area (How?)
2. Get the file url that you want to display in a Canvas Page:
- In the files area, right click on the file name and select Copy Link Address
- Paste the link to a text editor (e.g. notepad, textedit) and use the two numbers contained in it (course id and file id respectively to reformat the url as follows (e.g.):
https://canvas.manchester.ac.uk/courses/36630/files/folder/Experiments/e_over_m/e_over_m?preview=1184738
becomes
https://canvas.manchester.ac.uk/courses/36630/files/1184738/download
3. Construct the embed code
Paste your url into the src attribute of this snippet:
<p><iframe src="<add your url here>" width="100%" height="1000"></iframe></p>
e.g.
<p><iframe src=" https://canvas.manchester.ac.uk/courses/36630/files/1184738/download" width="100%" height="1000" ></iframe></p>
4. Add the embed code to a Canvas Page
- Add a Canvas Page
- Title the page and select insert>embed on the Rich Text Editor menu, or click the embed icon on the toolbar
.
- Paste the embed code and click submit
- Save the page
- Your page should now display
When you overwrite an uploaded folder with a new version, using the same folder name, the link embedded in the Canvas page will automatically update.
For Advanced Users: To add a custom version of the MathJax library in your uploaded files, see the MathJax documentation here: Simple integration