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

Using LaTeX in WordPress

LatexRender-ng

Friday 28th August 2009

Filed under: — Steve @ 11:07 pm

LatexRender has been adapted to many uses such as the hosted blogs at WordPress.com. One new version is LatexRender-ng. One of its features is that it can output images in Scalable Vector Graphics (SVG) format. This has the advantage of allowing the images to be scaled as well as being faster to load than PNGs or GIFs. Unfortunately this is not well supported by Internet Explorer.

Poor GIF output in LatexRender

Filed under: — Steve @ 6:18 pm

John Forkosh (author of mathTeX) has brought to my attention a bug in the latest version of ImageMagick’s convert. This is used to produce the gif image and can result in poor output with very light fonts. If you get this you can get a better result with LatexRender if you convert to a png instead.

In class.latexrender.php look for the line
var $_image_format = "gif"; //change to png if you prefer
and change it to
var $_image_format = "png";

You could instead use an older version of ImageMagick (such as version 6.2.9) or bypass ImageMagick altogether with dvipng, which is the method that WordPress.com uses.

Discussion of this problem can be found here. Let’s hope the bug is resolved in the near future.


 

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