#language en
== What you'll get ==
This method uses [[http://www1.chapman.edu/~jipsen/mathml/asciimath.html|ASCIIMathML]] by [[http://www1.chapman.edu/~jipsen/|Peter Jipsen]].
After implementing this patch you'll be able to use simple [[http://www1.chapman.edu/~jipsen/mathml/asciimathsyntax.html|ASCII syntax]] to write formulae that will be rendered as MathML. Math should be written between '''double''' dollar signs like this {{{$$sqrt(a^2+b^2)$$}}}. The ASCII syntax could be described as "the way you would write it in some simple language like matlab" or for the more advanced users - LaTeX where you can (but don't have to) omit the backslashes.
[[http://www1.chapman.edu/~jipsen/mathml/asciimathdemo.html|This page]] can be used for near-WYSIWYW (what you see is what you want) editing of formulae in your wiki page (note that there you have to use single dollar sign or back quote).
Here is a bitmap of example rendering by firefox <
> {{attachment:sqrt.png}}
== Get ASCIIMathML.js ==
Download [[http://www1.chapman.edu/~jipsen/mathml/ASCIIMathML.js|ASCIIMathML.js]] and save it in moins htdocs directory (the directory in which all the moin's static stuff is kept, like images and css files).
=== Changes Required for Version 2.0.1 of ASCIIMathML.js ===
If using version 2.0.1 of ASCIIMathML.js, edit the file with a text editor and around line 46 change the line
{{{
#!java
var translateLaTeX = true; // false to preserve $..$, $$..$$
}}}
to
{{{
#!java
var translateLaTeX = false; // false to preserve $..$, $$..$$
}}}
Around line 54, change the line
{{{
#!java
var AMdelimiter1 = "`", AMescape1 = "\\\\`"; // can use other characters
}}}
to
{{{
#!java
var AMdelimiter1 = "$$", AMescape1 = "\\\\$\\\\$"; // can use other characters
}}}
=== Changes Required for Version 1.4.7 of ASCIIMathML.js ===
If using version 1.4.7 of ASCIIMathML.js, edit the file with a text editor and at around the line 38 replace the lines
{{{
#!java
var AMdelimiter1 = "`", AMescape1 = "\\\\`"; // can use other characters
var AMdelimiter2 = "$", AMescape2 = "\\\\$", AMdelimiter2regexp = "\\$";
}}}
with
{{{
#!java
var AMdelimiter1 = "$$", AMescape1 = "\\\\$\\\\$"; // can use other characters
var AMdelimiter2 = "$$", AMescape2 = "\\\\$\\\\$", AMdelimiter2regexp = "\\$$";
}}}
These changes will prevent the script from recognizing every back quote or dollar sign as math delimiter.
== Change wikiconfig.py ==
Add the following to you wikiconfig.py (be sure to indent the first line properly for the {{{html_head}}} variable to be part of the config class)
{{{
#!python
html_head='''
''' % multiconfig.DefaultConfig.url_prefix_static
}}}
This line will cause Moin to add the