DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:jsmath

This is an old revision of the document!


jsmath plugin

Compatible with DokuWiki

2009-02-14 2010-11-07

plugin Plugin for displaying LaTeX equations using jsMath or MathJax

Last updated on
2010-10-13
Provides
Syntax
Repository
Source

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to asciimath, asciimathml, format, katex, latex, latexwas, masciimath, math, math2, mathjax, mathpublish, mimetex, svgedit

Tagged with formula, latex, math

User Reactions

It's awesome! This plugin together [with] MathJax makes publishing math in dokuwiki a real pleasure. And it is so easy to install both.” (anonymous user)

Features

  • 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.

Usage

Once this plugin is completely installed, you can embed LaTeX code into your wiki pages.

Inline Math

Each of the following will cause jsmath to display the formula inline:

$e^{i \pi} = -1$
\(e^{i \pi} = -1\)
<jsm>e^{i \pi} = -1</jsm>

Displayed Math

Each of the following will display an equation in block format, on its own line:

\[e^{i \pi} = -1\]
<jsmath>e^{i \pi} = -1</jsmath>

Download

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

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 and in recent versions quite fast. The drawback is that the client needs to manually install additional fonts for best quality.
  • MathJax is a modern replacement for jsMath. 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 MathJax.

Optionally, instead of downloading a local copy, you can use MathJax CDN by using this url http://cdn.mathjax.org/mathjax/latest on the configuration page.

a) MathJax

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

git clone git://github.com/mathjax/MathJax.git

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

b) 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.

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 choose your syntax options (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~~

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.

Backend discussion

I've just switched from jsplugin backend to MathJax one: it's awesome ! This plugin together MathJax makes publishing math in dokuwiki a real pleasure. And it is so easy to install both. Thank you very much ! Now that MathJax is in version 1.0.1 I think you should recommend it over jsmath now.

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.

How to set backend_url for JsMath

Hi,

How to set the JsMath backend_url in the plugin setting with the absolute/relative PATH on my server?

If I set it with current IP, it doesn't work when the IP changed.

Any solution? Thanks

Answer: Try dyndns.org. I'm not sure whether relative paths work. – Holger.

How to add extensions for MathJax

Thanks for the excellent plugin! I needed the AMSmath and AMSsymbols extensions so I manually added them to install_js.php as follows.

document.write('<script type="text/javascript" src="<?php echo($backend_url); ?>/MathJax.js">MathJax.Hub.Config({extensions: ["jsMath2jax.js","TeX/AMSmath.js","TeX/AMSsymbols.js"], jax: ["input/TeX", "output/HTML-CSS"] });</script>');

It would be great if there was an option on the configuration page to list extensions that should automatically be loaded. Did I miss it? Thanks.

Webspace inode limit solved by MathJax CDN

Some webspaces set an inode limit for the users (maximum number of files and folders) and, if you unzip the MathJax package directly on the server, it take about 36.000 inodes; this number is really high for a lot of free webspaces, then to resolve the issue you can use the cdn network kindly offered by MathJax, by putting the following url in the field “plugin»jsmath»backend_url”:

 http://cdn.mathjax.org/mathjax/latest/ 
plugin/jsmath.1301832448.txt.gz · Last modified: 2011-04-03 14:07 by 87.152.144.71

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki