[[PageOutline(2-5,Contents,pullout)]]
= Render mathematical expressions in Trac using â€‹MathJax
== Description
This is a plugin for rendering mathematical expressions in Trac using [http://www.mathjax.org MathJax]. MathJax is issued by the MathJax Consortium, which is a joint venture of the American Mathematical Society (AMS) and the Society for Industrial and Applied Mathematics (SIAM) to advance mathematical and scientific content on the web. MathJax works across a wide range of browsers. Unlike the TracMathPlugin, this plugin performs all rendering on the client side using web fonts.
It exists in two implementations, each with a different syntax.
To display math inline, enter LaTeX equation in between a pair of `\(` and `\)` brackets:
{{{
Here is an inline equation: \( y = x^2 \)
}}}
To display a block of math, either enter it between a pair of `$$` characters:
{{{
Here is a block equation: $$ y = x^2 $$
}}}
or use the `latex` preprocessor:
{{{
{{{
#!latex
y = x^2
}}}
}}}
Each of these examples will be displayed as follows:
[[Image(mathjaxexample.gif)]]
See also: TracMathPlugin, LatexFormulaMacro, Trac2LatexPlugin, LatexMacro
== Bugs/Feature Requests
Existing bugs and feature requests for TracMathJaxPlugin are
[report:9?COMPONENT=TracMathJaxPlugin here].
If you have any issues, create a
[/newticket?component=TracMathJaxPlugin new ticket].
[[TicketQuery(component=TracMathJaxPlugin&group=type,format=progress)]]
== Download
Download the latest release in [https://bitbucket.org/kisielk/tracmathjaxplugin/get/0.4.zip zip], [https://bitbucket.org/kisielk/tracmathjaxplugin/get/0.4.tar.gz gz], or [https://bitbucket.org/kisielk/tracmathjaxplugin/get/0.4.tar.bz2 bz2] format.
== Source
For the latest changes, check out the source [https://bitbucket.org/kisielk/tracmathjaxplugin using Hg], or [https://bitbucket.org/kisielk/tracmathjaxplugin/src browse it on Bitbucket].
== Installation
Unpack your download. Go to the top level directory of !TracMathJax and type:
{{{#!sh
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, then consult these [TracPlugins trac plugin installation steps].
As of version 0.4 of this plugin you no longer need to download !MathJax to your web server. The plugin will use version of !MathJax from their secure CDN.
== Configuration
To activate the component, edit your project's `trac.ini` file to include:
{{{#!ini
[components]
tracmathjax.* = enabled
}}}
{{{#!comment
Dont understand why [components] is highlighted in an incorrect color.
}}}
For additional customization of the display output, see the [http://www.mathjax.org/resources/docs/ MathJax documentation].
== Release Notes
'''0.4''': Update CDN URL
'''0.3''': Use the !MathJax CDN to serve !MathJax
'''0.2''': Fixed bugs with inline macro syntax (#8500)
'''0.1''': Initial release
== Alternative Implementation
There exist an alternative implementation which uses `math` keyword in wiki syntax so that it does '''not''' conflict with `TracMathPlugin`. This could be used for real LaTeX rendering, including [http://www.texample.net/tikz/ TikZ]. This alternative implementation is AGPL-licensed.
Inline syntax is also different, simply using WikiMacros. Examples:
{{{
[[math(1+2=3)]]
{{{
#!math
x = \frac{1}{2}
}}}
}}}
Otherwise, implementations should be functionally equivalent. If it is not so, please inform us.
=== Bugs/Feature Requests
Please use [https://github.com/trac-hacks/trac-mathjax/issues GitHub] for any issues you have with this implementation.
=== Download
Download the zipped source from [https://github.com/trac-hacks/trac-mathjax/archive/master.zip here].
=== Source
You can clone this implementation from [https://github.com/trac-hacks/trac-mathjax here] using git, or [https://github.com/trac-hacks/trac-mathjax the source] on GitHub.
=== Installation
{{{#!sh
pip install MathJaxPlugin
}}}
For more information, please follow [t:TracPlugins#InstallingaTracPlugin documentation] on how to install Trac's plugins.
== Author/Contributors
'''Authors:''' [wiki:kisielk], [wiki:mitar] [[BR]]
'''Maintainer:''' [[Maintainer]] [[BR]]
'''Contributors:'''