Contents
Render Latex formula to image
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.
To create the image from the formula text, the following is performed:
 Create .tex file in temporary directory.
 Run latex on .tex file to produce .dvi file.
 Run dvips on .dvi file to produce .eps file.
 Run convert on .eps file to produce .jpg file.
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.
defect 
2 / 6 


enhancement 
4 / 5 

task 
2 / 2 
Download
Download the zipped source from here.
Source
You can check out LatexFormulaMacro from here using Subversion, or browse the source with Trac.
Installation
Requirements:
 Latex
 dvips
 convert (from the ImageMagic package)
 ghostscript
General instructions on installing Trac plugins can be found on the TracPlugins page.
Example
By default, the latex code is rendered in math mode. This allows for quick math expressions. There is also a builtin 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:
For more complicated usage, use the {{{ ... }}} format and the "nomode" command to disable the displaymath mode:
{{{ #!formula #nomode 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.
Recent Changes
 8403 by rjollos on 20100821 08:02:12

Add revision info to macro. Fixes #6569.
 8402 by rjollos on 20100821 07:44:24

Adding 0.11 version to repository, previously attached to wiki page. Fixes #6568.
 678 by vgough on 20060421 07:33:50

LatexFormulaMacro:
Apply changes from Ken McIvor
fixes #65
(more)
Author/Contributors
Author: vgough
Maintainer: none (needsadoption)
Contributors:
Attachments (1)

matrixequation.png
(727 bytes) 
added by figaro 4 months ago.
Matrix equation
Download all attachments as: .zip