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.

Long LaTeX posts in WordPress.com

Tuesday 25th August 2009

Filed under: — Steve @ 7:52 pm

LaTeX2WP, written by Luca Trevisan, is a Python script that will convert a LaTeX file into a format suitable for pasting into a WordPress.com post.

WordPress.com uses its customised version of LatexRender to render the snippets of LaTeX, but LaTeX2WP will help prepare long texts. LaTeX2WP takes a TeX file and reformats it adding the required HTML codes and latex tags so that you can have, for example, numbered equations and dispayed equations. This is particularly useful for long mathematical notes containing lots of mathematics. It’s used by, amongst others, the Fields medallist Terence Tao for his blog at What’s new.

You can read more about LaTeX2WP and download it from LaTeX to WordPress


 

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