This site is a showcase for using LatexRender for mathematics in WordPress

Using LaTeX in WordPress

Path Problems in Linux

Friday 14th January 2005

Filed under: — Steve @ 3:32 pm

If you can’t get LatexRender to work then comment out the 6 unlink lines in class.latexrender.php with // so that they look like this:
// unlink($this->_tmp_dir."/".$this->_tmp_filename.".tex");
// unlink($this->_tmp_dir."/".$this->_tmp_filename.".aux");
// unlink($this->_tmp_dir."/".$this->_tmp_filename.".log");
// unlink($this->_tmp_dir."/".$this->_tmp_filename.".dvi");
// unlink($this->_tmp_dir."/".$this->_tmp_filename.".ps");
// unlink($this->_tmp_dir."/".$this->_tmp_filename.".".$this->_image_format);

Then look in the /tmp folder you have created and see what files have been created. If there’s a .ps file but no .gif or .png file then it may be because ImageMagick can’t find Ghostscript as detailed in Latexrender for WordPress under Mac OS X.

This is because in Linux, Imagemagick expects to find the gs file (Ghostscript’s binary) in /usr/bin. In fact, it may be in /usr/local/bin or somewhere else. You can either
1. reinstall Ghostscript into /usr/bin
or
2. change the path in Imagemagick’s file to tell it where to look. The file you want is delegates.mgk and might be found in /usr/share/ImageMagick, though this can vary. In this text file just alter /usr/bin/gs to the correct path – there may be 8 of these to change.
or
3. This is probably the simplest method. Make a symbolic link from /usr/bin/gs to /usr/local/bin/gs or wherever gs resides. How do I create a symbolic link?
or
4. See Marcin Gomulka’s comment below. This is great if you don’t have access to the server

Please let me know if this works for your installation.


 

This site is a showcase for using LatexRender for mathematics in WordPress