wiki:TracMathPlugin

Version 33 (modified by anonymous, 3 years ago) (diff)

--

Support for LaTeX Math Formulas in Wiki Pages

Description

Allow embedded equations in wiki pages. Basically a port of mt-math to trac.

See also tagged:LaTeX

Download and Source

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

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

Installation

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

 $ python setup.py 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:

 [components] 
 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:

 [tracmath]
 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""

Additional Requirements

pdflatex and ghostscript

Bugs/Feature Requests

Existing bugs and feature requests for TracMathPlugin are here. If you have any issues, create a new ticket.

Example

{{{
#!latex
$\mbox{Var}[\tau(X_p,X_d)] = \mbox{Var}[E(\tau(X_p,X_d)|X_p)] E[\mbox{Var}(\tau(X_p,X_d)|X_p)]$
}}}

would produce something akin to:

Other features:

  • links for any \label{} that appears, i.e., \label{eq1} will allow you link to the output image via SomeWikiPage#eq1.
  • can use '$' latex syntax instead (if use_dollars is enabled in config)

Release Notes

Version 0.5

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

Version 0.4

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

Version 0.3

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

Previous Releases

[11777] by rjollos on 2012-07-25 09:46:39
Added setup.cfg.
[3463] by rlotun on 2008-04-04 10:58:46
Applied patch by guyer@…
[3462] by rlotun on 2008-04-04 10:43:37
Applied patch by Immanuel Scholz <immanuel.scholz@…> to allow
Latex style '$$' syntax in wiki pages.

Author/Contributors

Maintainer: kisielk
Author: rlotun
Contributors: mitar

Attachments (1)

Download all attachments as: .zip