Preamble
Initially, it is necessary to download the mimetex utility. I suppose that you installed a recent version of Punbb in the repository forum of your site, in other words: http://yoursite/forum leads to your Punbb forum, if it is not the case you must change the ways of the repositories consequently in the following parts.
Mimetex is a cgi script. If you can’t use cgi scripts on your site(Ask your provider), you will not be able to use mimetex.
Important points: in the root of your site
create a repository cgi-bin
create a repository latex
create a repository latex/pictures
check the rights of latex/pictures: this repository must be in mode writable, we will store in latex/pictures the images generated by mimetex: that’s the cache system. I saw lot of contributions which proposed to the installation of mimetex under PUNBB forums nevertheless in all these contributions anybody does not propose a cache system, the consequences are that the site is then overloaded since with each time a forum is published or read, all the latex formulas are again compiled by mimetex...
Compilation of mimetex
I suppose your domain is: www.mydomain.com ou www.mydomain.net ... We will compile mimetex to obtain the cgi script which we will place in repository cgi-bin in the root of your site. You must compile your file mimetex.c:
Some explanations:
the option -DREFERERmakes it possible to specify your domain name that proves to be important insofar as you do not want that one uses your script apart from your site
the option -DCACHEPATH specifies the repository where the images generated by mimetex will be stored
latex.cgi is the file generated by compilation, you must place this file in repository cgi-bin.
Do not forget to place latex.cgi in repository cgi-bin.
Modification of PUNBB’s parser
We now will modify the code of Punbb so that it takes into account latex: all that will be put between [tex] and [/tex] will be latex. In the repository include of your Punbb forum, you must find the file parser.php.
Open up the file parser.php
Locate the function function do_bbcode($text)
This function end by return $text;
Before return $text; insert the following code, without forgetting to adjust the Configuration section:
Results
You can visualize what that currently gives on my forum under construction: Latex under PUNBB forums