Wednesday, September 17, 2008

Adding math tag support

Adding <math> tag support (without Latex installing).
The basic recipe is here: http://www.mediawiki.org/wiki/LaTeX_on_a_shared_host

  1. Find WIKI_HOME/includes/Math.php
  2. Backup it!
  3. Find public static function renderMath($tex, $params=array())
  4. Change function body to

public static function renderMath( $tex, $params=array() ) {
return '<img class="tex" src="/cgi-bin/mimetex.cgi?' . rawurlencode($tex) . '" alt="TeX: ' . rawurlencode($tex) . '">';
}


src="/cgi-bin/mimetex.cgi... because I've added mimetex.cgi into my cgi-bin directory. See also http://avbwiki.blogspot.com/2008/09/enable-tex.html

No comments: