wiki:LatexFormulaMacro

Version 2 (modified by Valient Gough, 19 years ago) (diff)

add note about known bug

Render Latex formula to image

Notice: This plugin is unmaintained and available for adoption.

Description

Render a latex formula to an image using Latex, dvips, and ImageMagick.

The images are named based on a sha1 hash of the formula and parameters, so that images don't have to be regenerated every time they are viewed.

In order to create the image from the formula text, the following is performed:

  1. create .tex file in temporary directory
  2. run latex on .tex file to produce .dvi file
  3. run dvips on .dvi file to produce .eps file
  4. run convert on .eps file to produce .jpg file

If the image doesn't exist, I get an internal error after the first run. But then the second time everything is good. The only error in the logs is this:

... malformed header from script. Bad header=This is TeX, Version 3.14159 (: /home/httpd/vhosts/default/cgi-bin/trac.cgi

I don't know what's causing the problem. If you hit preview after entering a formula, you'll get an internal error page. Hit back and hit preview again and then it works.

Bugs/Feature Requests

There is one known bug, see the description above.

Existing bugs and feature requests for LatexFormulaMacro are here.

If you have any issues, create a new ticket.

Download

LatexFormulaMacro for 0.8.

Source

You can check out the source for LatexFormulaMacro from Subversion at http://trac-hacks.swapoff.org/svn/latexformulamacro.

Example

[[formula(100| \mat{R'\\G'\\B'} = \mathbf{A} \mat{R\\G\\B} + \mathbf{x})]]

Author/Contributors

Author: vgough
Contributors:

TagIt(macro,vgough,alpha,0.8)?

Attachments (1)

Download all attachments as: .zip