jsmath plugin

jsmath plugin by Stephen Gould
Plugin for displaying LaTeX equations using jsMath or MathJax

Last updated on 2010-03-15. Provides Syntax.
Compatible with DokuWiki 2009-02-14.

Similar to asciimath, asciimathml, format, latex, math, math2, svgedit.

Tagged with formula, latex, math.

Advantages

  • Use LaTeX-code and high-quality LaTeX-fonts in your wiki.
  • Neither client nor server require additional LaTeX-specific setup.
  • LaTeX-code is beautifully rendered by the client's browser using a JavaScript library.

Download

For convenience, the plugin is available in two different archive formats.

Download plugin-jsmath.tar plugin-jsmath.zip

Installation

To setup your DokuWiki for displaying LaTeX, you need to upload some files to your webspace and install the jsmath plugin.

Step 1: The Rendering Backend

The jsmath plugin for DokuWiki does not render the LaTeX-code itself. Instead it uses a JavaScript backend that renders the code in the client's browser. Two different JavaScript backends are currently supported:

  • jsMath is mature software, but the client needs to manually install additional fonts for best quality.
  • MathJax is going to replace jsMath but is still in beta-status. The high-quality fonts are automatically downloaded and used if the client uses a modern browser.

You only need to install one of those libraries. If unsure, choose jsMath.

a) jsMath

Follow the installation instructions. In short:

  1. Download jsMath and extract the zip-file to a directory on your webspace.
  2. Optionally download the jsMath Image Fonts and extract the zip-file to the same directory.
  3. Optionally install the TeX fonts for jsMath on your local machine.

b) MathJax

To get the cutting edge version of MathJax, checkout the most recent version from the developer's page. In short:

svn co https://mathjax.svn.sourceforge.net/svnroot/mathjax mathjax
cd mathjax
unzip fonts.zip

Now move the mathjax directory to your webspace. You can test your installation by going to URL/mathjax/test/

Step 2: The jsmath Plugin

  1. Install the jsmath plugin for DokuWiki using DokuWiki's plugin manager as usual.
  2. Go to the DokuWiki Configuration Settings page (available in the admin menu) and set the full URL to your jsMath or MathJax installation. This is the directory to which you installed the JavaScript library in Step 1.
  3. Choose whether you want to use jsMath or MathJax.
  4. Optionally disable the dollar syntax (e.g. if you use dollars as currency symbols).

Note: When trying to display latex formulas for the first time, it may help to clear the browser cache. In Firefox, just press 'Ctrl-Shift-R'. Also try adding somewhere in your latex test page the following code to clear DokuWiki's cache:

~~NOCACHE~~

Usage

Once jsmath and a backend are correctly installed, you can embed LaTeX code into your wiki pages.

Block Formulas

This will display an equation in block format, on its own line:

<jsmath>\lim_{n\to\infty}\sum_{i=1}^{n} \frac{1}{i}=\infty</jsmath>

Alternatively, the square bracket syntax is completely equivalent:

\[\lim_{n\to\infty}\sum_{i=1}^{n} \frac{1}{i}=\infty\]

Inline Formulas

The following example will cause jmath to display the formula inline:

<jsm>\lim_{n\to\infty}\sum_{i=1}^{n} \frac{1}{i}</jsm>

Alternatively, the dollar syntax is completely equivalent:

$\lim_{n\to\infty}\sum_{i=1}^{n} \frac{1}{i}$

Development

If you want to contribute to this plugin, go to the project page of this plugin or contact Holger.

Discussion

Please report your issues to the issue tracker.

Unresolved Issues

Conflict with asciisvg plugin

Hi,

When asciisvg is installed, jsmath does not work anymore.

Any workaround? Thanks.

Answer: Please report details to the issue tracker. – Holger.

New line issue

Issue 1

Hello, I recently switched to jsmath plugin (first I had an hack for that). I've noticed that in array environment the new line command (double backslash) is interpreted by DokuWiki and not by jsmath plugin, causing a new line in the source code rather than in the array environment.

Is there anybody else with the same issue?

Thank you, Emanuele

ANSWER: Hi Emanuele, I saw the same thing; if you escape your backslashes, it should work, a la: \\\\

Update: I forgot, also other DokuWiki commands are overwritten before the code is passed to jsmath plugin. In example, with this code

  \sigma(c)

I get a copyright symbol in the formula.

I opened a bug ticket in the project page.

 
plugin/jsmath.txt · Last modified: 2010/03/16 00:55 by 95.88.23.106
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsGitXRefTranslate