I have also managed to get
http://www.kellnerweg.de/~bzeiss/releas ... _05.tar.gz to work on phpBB 2.0.1
If it helps here are the changes I made to both the download and phpBB files.
Firstly, latexrender
I created a tmp file inside the latexrender folder and pointed to it in
class.latexrender.php with
Change
Code: Select all
var $_tmp_dir = "/tmp"; // without ending slash !
To
Code: Select all
var $_tmp_dir = "/full_path_goes_here/latexrender/tmp";
It is important to chmod 777 for both pictures and this new tmp directory
Unless you have lpr installed, dvips won't produce the required .ps file so to get round this you need to tell dvips the name of the output file
class.latexrender.php
Change
Code: Select all
$command = $this->_dvips_path." -E ".$this->_tmp_filename.".dvi";
To
Code: Select all
$command = $this->_dvips_path." -E ".$this->_tmp_filename.".dvi"." -o ".$this->_tmp_filename.".ps";
There can be problems with transparency as ImageMagick sometimes ignores the -transparent command. If you don't want the background to be white then throughout
class.latexrender.php change all .png to .gif and they will be transparent
I find that the mathematical text looks too large compared with the surrounding text as it is in 12pt. It can be reduced to 10pt which looks much better:
class.latexrender.php
Change
Code: Select all
$string = "\documentclass[12pt]{article}\n";
to
Code: Select all
$string = "\documentclass[10pt]{article}\n";
Secondly, phpBB files
Add a TeX button which will add the [tex] and [/tex] tags
posting_body.tpl
Add
to the end of the bbtags array to get
Code: Select all
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','
',
'
','
','[img]','[/img]','
','','[tex]','[/tex]');[/code]
though you may also have other buttons
To make the posting box look better you may wish to change the width of the textboxes from
to
At the end of the section starting with
Code: Select all
<input type="button" class="button" accesskey="b" name="addbbcode0" value=" B "
style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" />
Add
Code: Select all
<td><span class="genmed">
<input type="button" class="button" accesskey="x" name="addbbcode18" value="TeX"
style="width: 40px" onClick="bbstyle(18)" onMouseOver="helpline('x')" />
</span></td>
replacing 18 (twice) with an even number 2 more than the number in the previous lines. Change x (in accesskey="x") if you already have this letter for other buttons
lang_main.php
After
Code: Select all
$lang['bbcode_f_help'] = 'Font size: [size=x-small]small text[/size]';
Add
Code: Select all
$lang['bbcode_x_help'] = 'Formula: [tex]formula[/tex] (alt+x)';
posting.php
After
Code: Select all
'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],
Add
Code: Select all
'L_BBCODE_X_HELP' => $lang['bbcode_x_help'],
If you want (Windows) users to use a WYSIWYG for writing the LaTeX code then Lotus Word Pro produces excellent TeX (just remove $) or use TeXaide from
Design Science and remove \[ and \]
Optional additional changes:
1. Still think the text looks too big? You can reduce it to 8pt if you (or your host) install the extsizes package available from
CTAN. Add these files to a new extsizes directory in usr/share/texmf/tex/latex. Refresh the database using
texhash command assuming you are using tetex.
Finally, in
class.latexrender.php change
Code: Select all
$string = "\documentclass[10pt]{article}\n";
to
Code: Select all
$string = "\documentclass[8pt]{extarticle}\n";
2. In IE the images with the mathematical text sits above the line which looks odd. You can improve the alignment in by changing the code in
phpbb_hook_2.php from
Code: Select all
$text = substr_replace($text, "<img src='".$url."'>",$pos,strlen($tex_matches[0][$i]));
to
Code: Select all
$text = substr_replace($text, "<img src='".$url."' align=absmiddle>",$pos,strlen($tex_matches[0][$i]));