LaTex Questions Answered: Viewing an expression and MathJax vs. QuickLaTeX

The following is an excerpt from the chapter LaTeX Questions Answered in Pressbooks Guide: A reference for open textbook authors using Pressbooks by Lauri M. Aesoph

How do I view an expression as it appears in LaTeX markup?

A good way to learn how to write LaTeX is to examine original markup. MathJax makes it very easy to view equations as they were originally written.

To see how an equation appears as LaTeX markup, right-click it and select Show Math As > TeX Commands from the menu. This will trigger a small pop-up window that contains the equation written in LaTeX.

Another option is to right-click the equation and select Math Settings > Math Renderer > Plain Source. This will make the original markup appear in the book in place of a human-readable mathematical expression. To go back to the default setting that renders LaTeX in a human-readable way, select Math Settings > Math Renderer > CommonHTML.

Try this out on the following expression:

a2+b2=c2

What is the difference between MathJax and QuickLaTeX?

If you look at the Plugins tab in the dashboard of your book, you’ll see a plugin called WP QuickLaTeX, which allows you to render LaTeX as SVG images. QuickLaTeX used to be the plugin that rendered LaTeX equations in BCcampus books, but as of early 2020, we have switched over to relying on MathJax.

MathJax is a JavaScript display engine that turns math markup written in LaTeX, MathML, or AsciiMath into high-resolution, accessible equations. The plugin PB-MathJax is automatically turned on in books hosted in the British Columbia/Yukon Open Authoring Platform. You won’t see it on the list of plugins because it is the default behaviour for books on this platform, and it can only be overridden if you turn on WP QuickLaTeX.

While both of these plugins can be used to render LaTeX equations, there are a few key differences between them, a few of which are noted in the table below.

Item MathJax QuickLaTeX
Notation Notation methods include [latex]…[/latex] and $$…$$ Notation methods include [latex]…[/latex]$$…$$$…$\(…\) and \[…\]
Accessibility Advanced accessibility features, such as the ability to collapse math, explore it in detail, and zoom in to a custom level. Can easily view in the web book the original LaTeX as it was written Renders LaTeX as images with the original commands as alt text, which is not easily readable by humans (especially those unfamiliar with LaTeX)

We recommend using MathJax, as it has far superior accessibility features to QuickLaTeX. For this reason, most of our LaTeX support will apply primarily to MathJax, not QuickLaTeX.

How do I know if I’m using MathJax or QuickLaTeX?

If your book is in the British Columbia/Yukon Open Authoring Platform, MathJax will automatically be integrated and turned on. QuickLaTeX will be available on the list of plugins, but will be deactivated by default. You’ll know that your book is using QuickLaTeX if you go to the Plugins tab and see that WP QuickLaTeX is activated, which would only happen if someone chose to activate it.

If QuickLaTeX is activated, it will override MathJax. If you would like to use MathJax instead (which is what we recommend), go to the Plugins tab, find WP QuickLaTeX, and click “Deactivate.”


The featured image for this post (viewable in the BCcampus News section at the bottom of our homepage) is by Karolina Grabowska from Pexels