I have left Harvard as of July 1, 2008 to take a position at NYU. This website has been cached and left static. Feel free to browse my new website, aka "What the heck is a Clinical Associate Professor?"

09.20.05

LatexRender Plugin

Posted in LaTeX at 7:56 am by leingang

I’m trying the LaTeXRender plugin by Sixthform. Installation is easy, but at first I got no formulas, only error messages.

Using some of the hints found on the “Path problems in Linux” post, I was able to figure out what was going on.

My server’s “convert” command didn’t understand the “-trim” option. I was able to get reasonable results by using “-crop 0×0″ in the same place. That is, in the file class.latexrender.php, change this line:

$command = $this->_convert_path." -density ".$this->_formula_density.
" -trim -transparent \"#FFFFFF\" ".$this->_tmp_filename.".ps ".
$this->_tmp_filename.".".$this->_image_format;

to

$command = $this->_convert_path." -density ".$this->_formula_density.
" -crop 0x0 -transparent \"#FFFFFF\" ".$this->_tmp_filename.".ps ".
$this->_tmp_filename.".".$this->_image_format;

This doesn’t crop the image to 0×0, but trims to the smallest rectangle that includes all non-background data. See the convert man page

Here is a test: \displaystyle\int_{\partial \Omega} \omega = \int_\Omega d\omega. It does seem to crop a bit off the right of the omega character.

Another test:  \displaystyle\int_{-\infty}^\infty e^{-x^2}\,dx = \sqrt{\pi} .

Comments are closed.