目次
from: https://www.dokuwiki.org/plugin:mathpublish
mathpublish Plugin
---- plugin ---- description: PHP only solution for including mathematical formulae into DokuWiki author : Andreas Gohr email : dokuwiki@cosmocode.de type : syntax lastupdate : 2019-03-05 compatible : Frusterick Manners, Greebo, Hogfather depends : conflicts : similar : asciimath, asciimathml, jsmath, math, masciimath, mathjax tags : math, formula downloadurl: https://github.com/cosmocode/dokuwiki-plugin-mathpublish/zipball/master bugtracker : https://github.com/cosmocode/dokuwiki-plugin-mathpublish/issues sourcerepo : https://github.com/cosmocode/dokuwiki-plugin-mathpublish/ donationurl: ----
This plugin is based on phpmathpublisher by Pascal Brachet to allow inclusion of properly rendered mathematical formulae in DokuWiki pages.
This plugin was originally written by Christopher Smith and named math2.
This is a completely self-contained PHP solution. It requires no third party packages. It makes use of php's GD library and freely available fonts1) to create an images for each formula. The plugin script, phpmathpublisher and the required fonts are all included in the download package.
Installation
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
Change Log
- Version upped (2024/05/24 06:51)
- allow purging (2024/05/23 18:19)
- fix unicode symbols (2024/05/23 18:13)
- Version upped (2023/01/03 07:50)
- Adjust alignement and rendering issues (2023/01/02 23:34)
- Version upped (2022/07/05 06:50)
- do not use curly brace string access. fixes #16 (2022/07/05 01:47)
- Version upped (2019/03/06 07:51)
PHP Requirements
To run this plugin your PHP installation needs to have:
- tokenizer library
- gd library
- png capabilities, i.e. libpng, which also requires the zlib library
- freetype font library
Most default installs of PHP (eg. at web hosts) do have all these requirements fulfilled anyway. For full details refer to the PHP documentation.
Examples/Usage
Example:
<m>S(f)(t)=a_{0}+sum{n=1}{+infty}{a_{n} cos(n omega t)+b_{n} sin(n omega t)}</m> <m 8>delim{lbrace}{matrix{3}{1}{{3x-5y+z=0} {sqrt{2}x-7y+8z=0} {x-8y+9z=0}}}{ }</m> <m 32>delim{|}{{1/N} sum{n=1}{N}{gamma(u_n)} - 1/{2 pi} int{0}{2 pi}{gamma(t) dt}}{|} <= epsilon/3</m>
Result2):
Syntax
The general syntax to embed a formulae is this:
<m size>...mathematical formulae...</m>
- size (optional) the base glyph size in pixels - default value: 12.
- alignment can be controlled in the same way as DokuWiki images, one space to the left to right align, one to the right to left align, one on each side to centre.
For a complete list of what mathematical terms can be used, refer to the original mathpublisher documentation or this DokuWiki-compatible formulae syntax page3)
mathpublish Plugin syntax
Create wiki:syntax:math (or whatever you want to call it) and paste in:
Adapted from http://www.xm1math.net/phpmathpublisher/doc/help.html .
To toggle to the math mode, you must use the <m>...</m> tag. The math commands must be separated by a space character or surrounded by {}.
Typical commands
- x+y :
- x-y :
- x*y :
- x/y :
- x^y :
- x_y :
- x<>y :
- x>y :
- x>=y :
- x<y :
- x⇐y :
- (x) :
- {x} :
Space
- a~b :
Greek:
- alpha :
- beta :
- gamma :
- delta :
- epsilon :
- varepsilon :
- zeta :
- eta :
- theta :
- vartheta :
- iota :
- kappa :
- lambda :
- mu :
- nu :
- xi :
- pi :
- varpi :
- rho :
- varrho :
- sigma :
- varsigma :
- tau :
- upsilon :
- phi :
- varphi :
- chi :
- psi :
- omega :
- Gamma :
- Lambda :
- Sigma :
- Psi :
- Delta :
- Xi :
- Upsilon :
- Omega :
- Theta :
- Pi :
- Phi :
Symbols:
- infty :
- in :
- notin :
- forall :
- exists :
- notexists :
- partial :
- approx :
- pm :
- inter :
- union :
- ortho :
- parallel :
- backslash :
- prime :
- wedge :
- vert :
- lbrace :
- rbrace :
- circ :
- varnothing :
- subset :
- notsubset :
- cdots :
- vdots :
- ddots :
Arrows:
- left :
- right :
- leftright :
- doubleleft :
- doubleright :
- doubleleftright :
- nearrow :
- searrow :
Sets:
- bbR :
- bbN :
- bbZ :
- bbC :
Roots and Limits:
- sqrt{a} :
- root{n}{a} :
- lim{a}{x} :
Big Operators:
- int{a}{b}{x} :
- doubleint{a}{b}{x} :
- tripleint{a}{b}{x} :
- oint{a}{b}{x} :
- sum{a}{b}{x} :
- prod{a}{b}{x} :
- bigcup{a}{b}{x} :
- bigcap{a}{b}{x} :
Delimiters:
- delim{[}{x}{]} :
- delim{]}{x}{]} :
- delim{[}{x}{[} :
- delim{]}{x}{[} :
- delim{lbrace}{x}{rbrace} :
- delim{|}{x}{|} :
- delim{vert}{x}{vert} :
Matrix:
- Syntax : matrix{num of lines}{num of columns}{first_element … last_element}
- matrix{2}{3}{a b c d e f g} :
Tabular:
- Syntax : tabular{lines description}{columns description}{first_element … last_element}
- lines : sequence of 1 (draw the horizontal line) or 0 (don't draw the horizontal line) - the length of the sequence=num of lines+1
- columns : sequence of 1 (draw the vertical line) or 0 (don't draw the vertical line) - the length of the sequence=num of columns+1
- tabular{111}{1111}{a b c d e f g} :
- tabular{1001}{101}{1 2 3 4 5 6} :
Constructions:
- vec{express} :
- {express}under{foo} :
- {express}over{foo} :
- overline{express} :
- underline{express} :
- hat{express} :