====== jsmath plugin ======
---- plugin ----
description: Plugin for displaying LaTeX equations using MathJax
author : Holger
email : yllohy@gmail.com
type : Syntax
lastupdate : 2011-06-21
compatible : 2011-05-25 2009-02-14 2009-12-25 2010-11-07, angua
depends
conflicts :
similar : format, math, math2, latex
tags : math, latex, formula
downloadurl: http://plugins-for-dokuwiki.googlecode.com/files/plugin-jsmath.zip
bugtracker : http://code.google.com/p/plugins-for-dokuwiki/issues/list
sourcerepo : http://code.google.com/p/plugins-for-dokuwiki/source/browse/#svn/trunk/jsmath
donationurl:
----
===== Installation =====
Install this plugin in the plugin manager and use LaTeX code right away!
For your convenience, the plugin is available in two different archive formats.
^ Download | [[http://plugins-for-dokuwiki.googlecode.com/files/plugin-jsmath.tar|plugin-jsmath.tar]] | [[http://plugins-for-dokuwiki.googlecode.com/files/plugin-jsmath.zip|plugin-jsmath.zip]] |
===== 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 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\)
e^{i \pi} = -1
=== Displayed Math ===
Each of the following will display an equation in block format, on its own line:
\[e^{i \pi} = -1\]
e^{i \pi} = -1
===== Configuration =====
On the DokuWiki Configuration Settings page (available in the admin menu) you can
- Choose to not use dollar symbols for displaying math.
- Set the full URL to the MathJax or jsMath installation you want to use. The default is the official MathJax distribution at [[http://cdn.mathjax.org/mathjax/latest]]
===== (Optional) Install a local copy of 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:
* [[http://www.math.union.edu/~dpvc/jsmath/ | 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.
* [[http://www.mathjax.org | MathJax]] is a modern replacement for jsMath. The high-quality fonts are automatically downloaded and used if the client uses a modern browser.
The default behaviour of the jsmath plugin is to use the MathJax CDN at [[http://cdn.mathjax.org/mathjax/latest]], but you can also download and use a local copy.
You only need to install one of those libraries. If unsure, choose MathJax.
=== a) MathJax ===
To get the cutting edge version of MathJax, get the most recent version from the [[https://github.com/mathjax/MathJax | 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 [[http://www.math.union.edu/~dpvc/jsMath/authors/installation.html | installation instructions]]. In short:
- Download [[http://sourceforge.net/projects/jsmath/files/ | jsMath]] and extract the zip-file to a directory on your webspace.
- Optionally download the [[http://sourceforge.net/projects/jsmath/files/ | jsMath Image Fonts]] and extract the zip-file to the same directory.
- Optionally install the [[http://www.math.union.edu/~dpvc/jsmath/download/jsMath-fonts.html | TeX fonts for jsMath]] on your local machine.
===== Development =====
If you want to contribute to this plugin, go to the [[http://plugins-for-dokuwiki.googlecode.com/|project page]] of this plugin or contact [[yllohy@gmail.com|Holger]].
===== Discussion =====
Please report your issues to the [[http://code.google.com/p/plugins-for-dokuwiki/issues/list|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 [[plugin:asciisvg]] is installed, [[plugin:jsmath]] does not work anymore.
Any workaround? Thanks.
**Answer:**
Please report details to the [[http://code.google.com/p/plugins-for-dokuwiki/issues/list|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('');
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.
=== Formula labels and references ===
Anyone got an idea or workaround for how to label formulas and refer to or even link to them from the text?
> It's not pretty but I use a combination of [[plugin:bookmark]] and [[plugin:wrap]] to label equations. It's tedious because they don't autonumber. For example:
where \(\delta_{kl}\) is the Kronecker delta function. Hence [[#Eq. 3.3]] reduces to
(Eq. 3.4)
\[
\text{Covar}[a_j,a_k] = C_{jk}
\]
and we find that \([C]\) is the covariance matrix. The variance of a single parameter \(a_j\) is simply defined as
(Eq. 3.5)
\[
\text{Var}[a_j]=\text{Covar}[a_j,a_j]=C_{jj}.
\]
> The Mathjax people work on adding support for \label and \ref capabilities. [[https://github.com/mathjax/MathJax/issues/71]] -- Holger.
==== 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/