Render Latex formula to image

Notice: This plugin is unmaintained and available for adoption.


This plugin allows you to render a mathematical formula as 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.

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.

By default, the Latex code is rendered in math mode. This allows for quick math expressions. There is also a built-in macro called "mat" which is used for formatting matrices, like this:

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

which will produce the following formula:

Matrix equation

For more complicated usage, use the {{{ ... }}} format and the "nomode" command to disable the display-math mode:

   A more complicated equation should be typeset in {\em displayed math\/} mode,
   like this:
   z \left( 1 \ +\ \sqrt{\omega_{i+1} + \zeta -\frac{x+1}{\Theta +1} y + 1} 
   \ \right)
   \ \ \ =\ \ \ 1

and no formula will be displayed.

See also tagged:LaTeX

Bugs/Feature Requests

Existing bugs and feature requests for LatexFormulaMacro are here.

If you have any issues, create a new ticket.


2 / 6


4 / 5


2 / 2


Download the zipped source from here.


You can check out LatexFormulaMacro from here using Subversion, or browse the source with Trac.



  • Latex
  • dvips
  • convert (from the ImageMagic package)
  • ghostscript

General instructions on installing Trac plugins can be found on the TracPlugins page.

Recent Changes

16397 by rjollos on 2017-03-25 09:37:00
Remove obsolete "0.9" code
16395 by rjollos on 2017-03-25 09:25:02
Remove obsolete "0.8" directories
8403 by rjollos on 2010-08-21 06:02:12
Add revision info to macro. Fixes #6569.


Author: vgough
Maintainer: none (needsadoption)

Last modified 12 months ago Last modified on Oct 2, 2016, 4:41:57 PM

Attachments (1)

Download all attachments as: .zip