# 0.2b - Viewing MathJax Formulas

The display of complex mathematical formulas within STAT online course materials used to be accomplished by creating images of these formula. Images were satisfactory but don't always scale well, are difficult to update and require extensive alternative text tags for users with visual disabilities.

All of the complex mathematical formulas and equations within the STAT online courses are rendered using a javascript display engine called MathJax. Below is an example of a what mathematical equation looks like when it is being displayed in our online materials:

\(P(Z\le z) = \Phi(z) = \int_{-\infty}^z \frac{1}{\sqrt{2\pi}} e^{-w^2/2}\,dw\)

"MathJax is an open source Javascript display engine for mathematics that works in all modern browsers."

**How Does this Work?**

In a nutshell, with the MathJax module turned on, course authors in Drupal add LaTeX code for mathematical formula into the editor's window (adding special characters at the beginning and at the end of the code). When saved, the LaTeX code is then rendered to display the intended formula not as an image but as the individual pieces that make up the formula. (Javascript must be enabled in your browser for these formulas to be rendered.)

**Check out the Special Settings!**

Once a LaTeX formula has been displayed users can 'right-click' (Mac users Ctnl-click) on the formula in order to reveal the settings associated with the view you would like to use to clearly see the formula.

image from the MathJax site

In the image above the user has accessed the settings by right-clicking on the formula and is selecting the 'Zoom Trigger' option 'Click' so that when they click on a formula, MathJax will enlarge the formula based on the 'Zoom Factor' they have also selected.

**Try it!**

Below is an example of a formula inserted into this web page using this Javascript technology. Right click on the formula to access the Zoom settings.

\(P(Z\le z) = \Phi(z) = \int_{-\infty}^z \frac{1}{\sqrt{2\pi}} e^{-w^2/2}\,dw\)

(Course authors who login and examine the editor window will see the LaTeX code for this formula.)

Beginning Spring 2012, all STAT online course website materials in Drupal began to take advantage of this technology. Our goal is to represent all our mathematical formulas as clearly as possible for all our online users.

Here is a short video that will walk you through how to specify the settings for MathJax for the pages you view in the Statistics program.