wiki:LatexFormulaMacro

Version 15 (modified by figaro, 9 years ago) (diff)

Cosmetic changes, tagged with nolicense

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.

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

3 / 7

enhancement

4 / 5

task

2 / 2

Download

Download the zipped source from [download:latexformulamacro here].

Source

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

Example

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 matricies, like this:

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

For more complicated usage, use the {{{ ... }}} format and the "nomode" command to disable the display-math 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
   \]
  }}}

Installation

Requirements:

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

Install as any other Trac plugin.

Recent Changes

17863 by rjollos on 2020-10-07 01:11:34
Revert r17862 on 0.11 directory

Refs #13887.

17862 by rjollos on 2020-10-07 01:10:00
Make compatible with Trac 1.2

Fixes #13887.

16975 by rjollos on 2017-11-18 10:06:44
Add metadata
(more)

Author/Contributors

Author: vgough
Maintainer: none
Contributors:

Attachments (1)

Download all attachments as: .zip