Support for LaTeX Math Formulas in wiki pages

Notice: This plugin is unmaintained and available for adoption.


This is a processor that allows you to embed mathematical equations in Trac wiki pages. It is basically a port of mt-math to Trac.

Adding the following lines in your wiki page or ticket description:


would produce something akin to:

Other features:

  • links for any \label{} that appears, eg \label{eq1} will allow you link to the output image via SomeWikiPage#eq1.
  • you can use the '$' latex syntax instead, provided use_dollars is enabled in your configuration.

See also:

Bugs/Feature Requests

Existing bugs and feature requests for TracMathPlugin are here.

If you have any issues, create a new ticket.


18 / 23


7 / 7


Download the 0.6 release in zip, gz, or bz2 format.


For the latest changes, check out the source using Hg, or browse it on Bitbucket.


Requirements: pdflatex and ghostscript, available as packages on most Linux distributions.

Unpack your download. Go to the top level directory of TracMath and type:

python bdist_egg

This should create an egg file under the dist subdirectory of your current directory. Copy the egg to the plugins directory of your trac project. If you have any difficulties installing consult these trac plugin installation steps.

To activate the component, edit your project's trac.ini file to include:

tracmath.* = enabled

The settings default to a Linux environment where pdflatex_cmd is /usr/bin/pdflatex and gs_cmd is /usr/bin/gs, and cache_dir is tmcache, relative to project dir. You can override these settings by including in your trac.ini file settings, such as:

pdflatex_cmd = <location of your pdflatex binary>
gs_cmd = <location of your gs binary>
cache_dir = <cache directory, relative to project dir or absolute>
max_png = <max number of pngs in cache - defaults to 500>
use_dollars = True
invalid_commands = <list of invalid commands in LaTeX source>
png_resolution = <PNG resolution when rendering - defaults to 110>

Note that if you have spaces in the location you should double-double quote it. For example:

pdflatex_cmd = ""C:/Program Files/MiKTeX 2.7/miktex/bin/pdflatex.exe""
gs_cmd = ""C:/Program Files/GhostScript/bin/gs.exe""

If you encounter an error: "LaTeX Error: File preview.sty not found", install also packages: cm-super and texlive-latex-extra.

Release Notes

Version 0.6 (2013/01/10)

  • Updated for Trac 1.0 and 0.11 compatibility [thafreak]

Version 0.5 (2011/09/24)

  • Document template is now Trac template [mitar]
  • Validates input to prevent dangerous LaTeX commands [mitar]
  • Using pdflatex and gs to support wider number of LaTeX packages (like TikZ) [mitar]

Version 0.4 (2011/09/10)

  • Added compression option to control the png compression level. Set it to a number from 1 (lower) to 9 (higher) [kisielk]
  • FIxed #9066 [kisielk]
  • Added additional logging to help in future debugging [kisielk]
  • Fixed some error handling bits [kisielk]

Version 0.3 (2010/12/21)

  • General code refactoring / cleanup [kisielk]
  • Applied mag-factor patch from #6422 [kisielk]
  • Fixed sha module deprecation warnings (#7836) [kisielk]
  • Fixed cache implementation so cache management works correctly [kisielk]


Author: rlotun
Maintainer: none (needsadoption)
Contributors: mitar, thafreak

Last modified 4 years ago Last modified on May 11, 2017, 7:10:02 AM

Attachments (1)

Download all attachments as: .zip