Loading...
 
Skip to main content

Features / Usability


You are viewing a reply to Math Equations / Formulae in TikiWiki?

Solution (sort of)

I have a working, if kludgy, solution for use of formulae in my TikiWiki.

For benefit of any other or future users doing the same searches on the forums and documentation that I did I thought I'd pass on my inelegant but apparently functional solution.

I needed a way for my students (and myself) to work with mathematical formulas on the Wiki, but could not use the FORMULA plugin (or variations on it that are out there) because those require the host to have LaTeX installed, and mine does not.

I found a way to do this using MathML.
In future this may be the definative way to do it as MathML may (and should) be part of the standard Wiki support, but at the moment I had to mess about a bit. The key was a lovely script called ASCIIMath, available and described at http://www1.chapman.edu/~jipsen/mathml/asciimath.xmlQuestion

This is probably not the right way to do this, but this is what I did and it does work.

The script is provided in a file called "ASCIIMathML.js" which I uploaded to the "lib" directory in my directory. This script must be called on each page that uses math, so I put it into a tpl that is called for every page, the "header.tpl" file. This calls a number of scripts, so I simply added this to the set.
I looked for "tiki-js.js" which is used on all pages. Then added a call after it, replacing the tiki-js file with the ASCIIMathML.js one. I'd include code but it seems to be crashing the forum post. I also included a second line to set the equation colour to black as described in the ASCIIMath FAQ.

Now the ASCIIMath syntax can be used on any page by enclosing text in appropriate bracketing (the accent grave). It works well, though the font size is a bit small for the equations (I added a "big" quicktag, though I'm sure if I knew what I was doing there would be a way to ask for the font size to be made one or two points larger).

Anyway... I hope this is of some use to others, and maybe that those who actually know what they are doing will leap in and correct the Quick and Dirty solution here.

All the best to all in the community.
Philip