Displaying mathematics with TeX

Last modified: January 5, 2008 - 23:57

The standard syntax that mathematicians use to type mathematical expressions is TeX and its extensions LaTeX and AMSLaTeX. Almost all mathematical research is written in TeX. It is not surprising therefore that TeX has also become the de-facto standard for writing mathematics online. While TeX syntax is a convenient way of entering mathematics, when you look at the mathematics you don't want to have to read the TeX syntax but want the mathematics to appear nicely typeset. Drupal has several modules that achieve this. These are compared briefly below so that you can judge which one will be the most appropriate for your installation. The choice will depend on the complexity and amount of mathematics that you are planning to display on your site and also on whether you are willing and able to install additional software on your server.

  • jsMath is a piece of javascript that renders the TeX on the client's browser. This means that you do not have to install any TeX rendering software on your server and the processing of TeX does not increase the load on your server. The downside of course is that the user's browser has to work harder and the display of the mathematics takes a bit longer. With the default setting jsMath will display the page to the browser initially with all the TeX syntax still in place and will then start converting this into typeset mathematics. So the user can already start reading the page while jsMath is still converting the TeX. You can get an impression of how well this works by looking at examples. If you do not want to shift the work of processing the TeX to your user's browser then you should go with one of the next two modules.
  • Mathematics Filter uses MimeTeX to convert the TeX to images that are then included in the webpage. This requires you to install the mimeTeX executables on your server. MimeTeX does not use the standard TeX engine but renders directly to images. This makes it very fast. It does however mean that, like jsMath, it can render only a subset of the complete TeX syntax. For most applications this will not be a problem. But if it is the you should go with the DruTeX module instead.
  • DruTeX uses the full LaTeX engine to convert the TeX to dvi and then uses ImageMagic and dvipng to convert the dvi to images. This means that unlike the other solutions DruTeX can handle the entire TeX syntax. The drawback however is that you need to install several software packages on your server before DruTeX will work. Also the processing of the TeX will put extra load on your server. DruTeX is quite an impressive module with its own plugin architecture. It has its own discussion group.
  • TeXfilter is similar to DruTeX in that it requires a LaTeX installation on your server and therefore brings similar advantages and disadvantages. It is a simpler module than DruTeX but

 
 

Drupal is a registered trademark of Dries Buytaert.