New, MathTeX

bigcrunch - November 25, 2007 - 11:35
Project:Mathematics Filter
Version:5.x-1.1
Component:Code
Category:feature request
Priority:minor
Assigned:dwees
Status:active
Description

MathTeX (http://www.forkosh.dreamhost.com/source_mathtex.html) is similar to mimeTeX, but with better graphics. Is it based on cgi and work fine with this module (only change mimeTex cgi with mathTeX cgi).

MathTex can render PNG images changing the reques to "/cgi-bin/mathtex.cgi?\png " (NOTE: \png). With the actual filter is not possible make this, but with a little change it will be possible. This will resolve the problem with PDFview module (do not support GIF images).

Thanks, and sorry for my english.

#1

dwees - November 25, 2007 - 11:43
Priority:normal» minor
Assigned to:Anonymous» dwees

Well this module actually will support this. Simply change the path to the cgi in the settings, then in each of your formulas, prefix them with \png.

So instead of using [tex]x^2+y^2[/tex], you would use [tex]\png x^2+y^2[/tex], which should work. Let me know if it doesn't and I'll add another setting (prefix with -blank- which would let you prefix all of your formulas with whatever you choose, in this case \png).

Dave

#2

bigcrunch - November 25, 2007 - 11:46

I have probed this changing line 138 from:
$mimetex_cgi_path_http."?"
to:
$mimetex_cgi_path_http."?\png"

and changind line 147 from:
$formula_image_file = $file_directory_path . '/' . sha1($mimetex_formula) . '.gif';
to:
$formula_image_file = $file_directory_path . '/' . sha1($mimetex_formula) . '.png';

and work fine!

Thanks

#3

dwees - November 25, 2007 - 12:59

Okay, I forgot about the image caching line. I'll add a feature to select MathTex instead of Mimetex and that will change the file extension of the cached image. I'll also include a link to the documentation on both in the admin/settings page so that this is a bit easier to use. I need to do some updating of some minor bugs in this module anyway.

Dave

 
 

Drupal is a registered trademark of Dries Buytaert.