Thursday, June 9, 2011

MathJax and VTBE Experiments

Our faculty are interested in putting equations into Blackboard. However, the current equation editor is old and flaky (works for some browsers, not for others). I heard from other schools about MathJax ( and started to play with it.

The easiest way to use MathJax is to link directly to the MathJax distributed network service (see Using the MathJax CDN). In that case, there is no need to install MathJax yourself, and you can begin using MathJax right away.

The only thing is you need to have a bit of script tag in each of your pages:

<script type="text/javascript"

I had the inspiration to throw that snippet into the googleAnalyticsSnippet.vm (see

That took care of including the script.

I took some of the TeX examples (see and added them in via the VTBE.

To keep the VTBE from mucking with all the special characters like "{" "}":
* Turn the Text Editor OFF
* Choose "Plain Text"

And then cut-and-paste the TeX examples, e.g., Lorentz Equations

\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x - y - xz \\
\dot{z} & = -\beta z + xy

What it looks like in the VTBE:


Here is an example where I put MathJax TeX into a Test question. (Added 06/13/2011)

Here is an example where I put MathJax TeX into a Discussion post. (Added 06/13/2011)

What I typed:



* I initially had trouble with some of the examples not showing (e.g., just seeing raw code), then it occurred to me that the examples that worked started and ended with


so I added those to the non-working TeX examples and presto, they appeared properly.

* MathML examples - were not working for me, maybe conflicting with the VTBE's inherent handling of MathML (part of the built-in equation editor)

* Security concerns - including someone else's javascript in all your Bb JSP pages needs quite a level of trust. You can install MathJax locally on your server, and that's prob. where we'd be experimenting next. (And, it'd be friendlier to the MathJax CDN!)


  1. I have just discovered your blog recently and I was like wow! a blog talking about Blackboard learn??? Cool!
    Anyway thank you for your demonstration above,
    I was trying to use MathJax in VTBE in Bb,
    however when I was trying to add math equation in Discussion board, the equation crashed whenever I was replying the post. Both the equations in the parent post and the reply post cannot be shown.
    Have you encountered this issue before?

  2. Dear HeiC,

    Unfortunately, we did not pursue this experimentation any further. At the time I tested, we were running Bb Release 9.1SP5. We are now at 9.1SP7HF1. I tried the script-in-the-googleAnalyticsSnippet.vm again: the Content Area MathJax examples still worked, however, the Discussion post did not. I just saw the raw code.


    - Ian

  3. The comments at also seem to indicate issues with using the MathJax in the Discussions.

  4. Dear Ian,

    Thank you very much for your reply.
    I am now using Bb Release 9.1 SP8, still having the same problem in Discussion. Just hope this issue will be solved in the later SP.

    - HeiC

  5. Hi HeiC,

    Have you heard about the replacement VTBE? It'll come with the WIRIS equation editor. It's available on Unfortunately, last I checked, the equation editor wasn't functioning properly (they are aware of it).

    - Ian

  6. Just FYI, the WIRIS equation editor is now working on Since it's part of the replace text editor, you can use it everywhere you see a text editor, for instance in Discussion posts!