Easy Recipe for WYSIWYG Math Formulas in Drupal

Posted: June 15th, 2010 | Author: | Filed under: Dreamhost, Drupal | Tags: , , , , , , , , | No Comments »

Objective: An easy recipe to setup Drupal to allow users to write / edit mathematics expressions.

Check List:

    Required Drupal Modules

  1. Mathematics Filter aka Mathfilter

    Required Non Drupal Components

  1. Mathtex or Mimetex
  2. TinyMCE


  1. Install Mimetex or Mathtex and Mathematics Filter. This will allow basic LaTeX markups to be rendered as graphics. Make sure this part works first before proceeding.
  2. At this stage, create an “Input Format” for Math. Since Mimetex / Mathtex is an external binary, use a seperate input method that only authenticated users can use, it is better be safe than sorry.
  3. Install WYSIWYG API and TInyMCE. Verify they work. Assign TinyMCE as the editor for the Math Input Method under the WYSIWYG module configuration.
  4. Here is the tricky part. Install WYSIWYG ASCIIMATH module into the /modules directory also the /sites/all/modules directory. You would want to create symbolic links from of your mimetex binaries to where the respective mimtex directories! eg my mathtex lives in /cgi-bin directory, so in the /modules/wysiwyg_asciimath/mimetex directory I issue ln -s ../../../cgi-bin/mathtex mathtex command.
  5. Go back to the WYIWYG, click on Edit in the Math Input Format. Check ASCIIMath and ASCIIMathCharmap and Save

Why no ASCIIGraph? For some reason ASCIIGraph doesn’t seem to render well once I switch to View mode. So for now I am going to stick with my JSXGraph module.