Table of Contents
MathMulti Plugin
Compatible with DokuWiki
No compatibility info given!
Render math [(La)TeX or Plain Text idioma] expressions as image or MathML (use Mimetex, itex2mml or plain2mml)
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, jsmath, latex, latex-was, masciimath, math2, mathpublish, mimetex
This is an update of the MathMulti plugin
(Old version avail here) recoded to be compatible with the config and plugin manager plugins. Localisation has been added. It also makes it easier to add support for other math rendering engine and syntax.
Please note that this is a preliminary version of the plugin that works only withmimetex
in CGI mode (see below for config details). Other rendering engine will be included soon.
The Math Plugin render mathematical expression expressed in either (La)Tex or plain text as image or as MathML, depending on the rendering program (engine) used.
The plugin is ready to be used with these rendering programs:
It can be easily adapted/expanded to use other rendering program, allowing different output format and math syntax.
You may consider using the other DokuWiki plugins to render Math:
- the latexrenderer plugin [A bit more complex to install, still use LaTeX syntax for Maths]
- or the Math Plugin by ChrisS [simple to install but use another mathematical syntax and need some PHP add ons].
- latexrenderer as in the latexrenderer plugin,
Thanks to everyone how provided so many examples of plugin or contributed to the plugin tutorials… This was of great help! If you see part of your code here and I forgot to give credits for your work, please let me know so I could add your name.
Syntax
<math format idiom size>...mathematical formula..</math>
Where:
format
: (optional) Specify which program will be used to render the math formulae.
Support:
img
(use mimetex http://www.forkosh.com/mimetex.html)
mml
(use: itex2mml http://pear.math.pitt.edu/mathzilla/itex2mml.html or
plain2mml http://math.wcupa.edu/~johnston/plain2mathml )
It might be better not to specify the format thus you can change it at once for all math expression in your wiki by changing the config value.No longer avail.idiom
: (optional) Specify in which idiom (math dialect) the math formulae is written in
So far, onlytex
[(La)TeX] andplain
style are supported
tex
: http://www.forkosh.com/mimetex.html
or http://pear.math.pitt.edu/mathzilla/itex2mml.html
plain
: http://math.wcupa.edu/~johnston/plain2mathml/
please note that output for plain are inmml
only
ifimg
is specified, the raw text is displayed 1)size
: (optional) Default size of the Math char [points]
The Math Formulae syntax depend on Idiom. See mimetex, itex2mml, plain2mml above2).
Installation
This is mainly a 3 steps process:
1. Install Code Source
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually. If installed manually, place files in directory lib/plugins/mathmulti
.
Plugin sources: zip format (9KB), tar.gz format (6KB),
2. Install external tools
The plugin depend on external tools that must be installed separately. Please follow these packages instructions on how to install them:
You need only to install one of them.
3. Configure the options
Some options may be specified in the dokuwiki/conf/local.php
file. Better use the config plugin to do so.
$conf['plugin']['mathmulti']['mathmulti_iscgi'] = 0; //Are eqn images produced by cgi every time the page is viewed (1=yes)? $conf['plugin']['mathmulti']['mathmulti_mimetex'] = ""; //Path to mimetex bin (produce img)(webserver or filesystem path, depending on ...iscgi) $conf['plugin']['mathmulti']['mathmulti_itex2mml'] = ""; //Path to itex2mml bin (produce mathml) $conf['plugin']['mathmulti']['mathmulti_plain2mml'] = ""; //Path to plain2mml bin (produce mathml) $conf['plugin']['mathmulti']['mathmulti_format'] = "img"; //default mathmulti rendering format $conf['plugin']['mathmulti']['mathmulti_idiom'] = "tex"; //default mathmulti math idiom (dialect) $conf['plugin']['mathmulti']['mathmulti_size'] = "12"; //default mathmulti math char size [points]
At least one external tool path has to be specified: mathmulti_mimetex
, mathmulti_itex2mml
or
mathmulti_plain2mml
The value of the paths specified inmathmulti_mimetex
,mathmulti_itex2mml
andare full path to the application. Please note that the full path is different depending on themathmulti_plain2mml
mathmulti_iscgi
value. In CGI mode, the is from the web server root (as view in your site URL) otherwise it is the full machine path from the disk root.
The plugin is now installed.
Revision History
- 2006-05-25: Initial version
ToDo
- Complete support for mimtex with cached images
- Complete support for MathMl renderer (itex2mml,
plain2mml)
Discussion
Please report here any problem you encounter installing or using this plugin.
Any bug report or code improvement suggestion is also welcome!!!
Error During Installation
I have installed DokuWiki on a Debian system, using simple apt-get. Furthermore, I have also installed mimetex thus. After setting the path to mimetex in the local.php file, I get the following error: Call to undefined method syntax_plugin_mathmulti::getConf() in /usr/share/dokuwiki/lib/plugins/mathmulti/syntax.php on line 383.
Looking at the PHP-code, I can indeed not find any getConf()-method, also not in the /usr/share/dokuwiki/lib/plugins/syntax.php or /usr/share/dokuwiki/inc/parser/parser.php files, which define the classes that this class extends. However, it must be something very simple, because it seems like such a basic error that it must be impossible for it to have existed this long without anybody noticing it. Any clues? And my apologies if I'm doing something really stupid - although I know a thing or two about coding, I'm very new to Linux in general, and Debian in particular. — Daan Vreeswijk
The getConf function is defined in
dokuwiki/lib/plugins/syntax.php
Unfortunately this function does not appear to be defined in the latest stable release (2006-03-09).
I would suggest you use the latest dev version, unless your wiki is a very critical app in your organization, avail at http://dev.splitbrain.org/browse/snapshots/…
Thanks! — stephanec 2006-05-29 17:59
Plugin disabled
I installed in Mac OSX with mimetex (in cgi-bin/) but when I edit a page with <math> no image is displayed, I get the latex code instead. I looked for the info in the plugins page and it says “Mathmulti: plugin disabled” — Alvaro Martinez
it was my fault, I've put the mimetex binary in a DokuWiki subdir, and it worked when I moved to /usr/local/apache2/cgi-bin/ ;-p
Error With Installation
Again, an OS X installation. The Wiki works fine without the plugin installed. After chowning www the plugin directory, I am able to pull up an edit dialog (if I don't chown the directory, I don't get my edit dialogs). Pages where data exists do not load, however. The header loads, after that, everything is blank. The problem disappears when I remove the plugin. Pages existing prior to installation will load, but upon editing fail to load. Problems persist, even if math functions are not invoked. Ivan Kowalenko
plain2mathml disappeared
plain2mathml link is no longer valid, and I'm unable to find the script elsewhere. Could someone kindly provide his local copy ?
Yes I have the same question…— Yihui Xie 2008/06/04 13:35
Inline equations appearance
Inline math formulas are rendered slightly above rest of the text. I don't know if it is a generic issue or if it is specific to my installation. The formulas do not look good this way. Is there a way to correct this?
Offline LaTeX Installation for Desktop DokuWiki
Hiya. I'm trying to use DokuWiki as a totally offline desktop personal wiki to compile all my engineering course notes… rather than type it all out in a word processor! When I went to try and install mimetex, it wanted me to put a file in my CGI-bin… but I haven't got one… because it's an offline “site”. Obviously all the language associated with LaTeX and similar things is all about servers and CGI and PHP… but how do you get round this if you just want to use the software in the old-fashioned offline software kind of way?! So… is it possible to use DokuWiki like this, or am I barking up the wrong tree?
No rendering happening
I've installed the Mathmulti plugin and built the itex2MML tool. From the command line, I've verified that itex2MML is doing something:
/Users/u0048513/downloads/itex2mml/itex/itex2MML $x+3$ <math xmlns='http://www.w3.org/1998/Math/MathML'> <mi>x</mi> <mo>+</mo><mn>3</mn> </math>
I've configured Mathmulti to use that path as the itex2mml bin. But if I put something like <math>\sum_x{x+5}</math> into one of my pages, I just see the raw formatting \sum_x{x+5}. The HTML source generated is: <span class="math">\sum_x{x+5}</span>.
Am I doing it wrong? — Ken Williams 2008/06/17 13:53
You can check your local.php. I had the same question, but now it works at last!
$conf['plugin']['mathmulti']['mathmulti_iscgi'] = 1; $conf['plugin']['mathmulti']['mathmulti_mimetex'] = "http://localhost/cgi-bin/mimetex.exe";— yangjh 2009/11/20 15:43
Seems it doesn't work (at least for me) if mathmulti_iscgi = 0. Previous post helped me but I suggest to use relative path:
$conf['plugin']['mathmulti']['mathmulti_mimetex'] = "/cgi-bin/mimetex.cgi";— Zooloo 2010/02/21
+++++++++
Hello there,
I'm hoping to use the offline/desktop/personal only version of DokuWiki to compile and present loads of engineering work for reference purposes, and I'd like to ask for some help with installing LaTeX and a Maths display plugin please.
I've downloaded and extracted the relevant zip files, but I'm a bit lost as to what the first step is to install mimeTex on the offline version.
The installation instructions seem to relate only to when you're installing it on an online wiki.
Has anyone successfully done this before? Please could someone offer some step by step instructions?
regards,
promsan
http://forum.dokuwiki.org/post/7206;nocount
Styles aren't propagating through properly. This seems to fix it:
$ diff syntax.php.old syntax.php 219c219 < $math_html = ' class="math media'.$align.'"'; --- > $myclass = ' class="math media'.$align.'"';
-mgjk