Website Services
Need help with your site? |
| The MathPublisher plugin for Joomla 1.5 allows you to easily add maths to pages. The plugin uses phpMathPublisher by Pascal Brachet from http://www.xm1math.net/phpmathpublisher/ where you can find help on the syntax, try it out and see some examples. phpMathsPublisher is also used by plugins for DokuWiki and WordPress |
The phpMathPublisher syntax is probably slightly easier to use than TeX that is used by other plugins e.g. MimeTeX and arguably produces better looking output.
If you are interested in alternatives to MathPublisher there is a good review by Alex Matulich.
Version 1.5 (released 2010-06-02) improved support for special characters. Minor bug fixes.
- Allow / for joomla_root config value when joomla installed directly in DOCUMENT_ROOT
- better support for html entities and special characters like less than, greater than, euro, quotes in the formula.
- New special code {slash} for simple a / b style fractions
Installation
Install by downloading the zip file and install using the Joomla Admin interface (Extensions > Install/Uninstall)
Go to the plugin manager to configure and enable the plugin.
Configuration
Go to Extensions > Plugin Manager and click on Content - MathPublisher. Enable the plugin and check the configuration.
The default installation assumes joomla is installed directly under your DOCUMENT_ROOT in the joomla directory, and is accessed in the joomla directory off your root server url e.g. http://my.server.org/joomla/. You may need to change these settings to match your site.
You can use an alternative key instead of the rather lengthy {mathpublisher} and the default is {math}. Don't be tempted to use a single character (e.g. m as the string {m} is very likely to apper in formulae and will confuse the plugin.
Font and background colour may also be specified to match your website sytle.
| name | example | default | description |
| alternativetag | formula | math | Alternative tag to trigger the plugin usage. If you think that {mathpublisher} is too long and prefer shorter syntax, feel free to specify your own tag. For example: math (avoid very short tags e.g. m - consider sum{m}{n}{p}) |
| joomla_root | cms/joomla | joomla | This is where joomla is installed. This is the relative path under DOCUMENT_ROOT to joomla e.g. libraries/joomla (use a single / if joomla is installed directly in your DOCUMENT_ROOT) |
| joomla_abs_root | /usr/pathto/htdocs | Optional alternative absolute path to joomla. Some free hosts do not set DOCUMENT_ROOT to each users path, so the relative joomla_root will not work. Specify the full path to joomla here if you need to. Otherwise, leave blank |
|
| joomla_url_root | content | joomla | This is where joomla is accessed from your sites root URL. E.g. joomla for http://my.site/joomla/. If joomla is accessed in the root of your web site, use a single / here. |
| color | #ff8844 | #000000 | Font color. The color for the formula. Use html #rrggbb style e.g. #ff8844 or #f84. |
| bg_color | #002030 | #ffffff |
Background color. The background color - used for anti-aliasing which makes the characters look smoother. Choose a value that is close to the average background color behind the formula. Use html #rrggbb style e.g. #002030 or #023. |
| enable_in_comments | Yes | No | Enable in comments. Select Yes to allow math to be used in comments. Tested with JComments only. |
The default config is usually OK for most hosting providers, but if not, and you are unsure what values to use, the following may help:
Log in to your Joomla administration page and go to Site > Global Configuration
Open the System tab and copy the value of "Path to Log folder"
This contains the full path to your joomla installation with '/logs' on the end. So you can remove the '/logs' and use the remaining path for the value of "Optional. Alternative absolute path to Joomla" in the MathPublisher configuration.
The other value that needs to be set is "This is where joomla is accessed from your sites root URL."
You can get this value from the Joomla administration URL. It is the path between the host name and /administrator/index.php
For example if your admin URL is
http://www.mywebsite.com/some/path/administrator/index.php
Use "some/path"
If Joomla is accessed directly in the root of your site, the admin URL will be something like:
http://www.mywebsite.com/administrator/index.php
Use a single slash "/" (do not leave empty, as that will use the default "joomla")
Use in comments and forums
The MathPublisher tags will work in Kunena forum posts if you set "Joomla Mambot Support" to "Yes" in the Kunena front end configuration.
JComments will show maths if you set "Enable in comments" to yes in the MathPublisher configuration. This setting may also work for other comment plugins, but I have only tested it with JComments.
Usage
{mathpublisher size=16} pi approx 22/7 {/mathpublisher}shows:

{mathpublisher} pi = 22/7 - int{0}{1}{ { x^4 (1-x)^4} / {1+x^2} dx } {/mathpublisher}
The optional size= parameter specifies the font size and defaults to 14. any value between 10 and 26 may be used. values will be restricted to this range.
It is OK to place maths within other text, for example: the radius of a circle is
and its circumference is
.
If you need to override the default colour, you may also include color= and/or bg_color= parameters in the tag. These colour tags only support the html #rrggbb or #rgb style colours which should not be quoted. The bg_color is only used to anti-alias the formula so that it looks good against your site background, so choose a setting that is close to the typical background colour of your site. The main background of the formula image will be transparent so that your site background shows through.
Examples:

Comparison with MimeTeX
| MathPublisher | MimeTeX |
| {math}pi = sum{n=0}{+infty}{ {(n!)^2 2^{n+1}} / {(2n+1)!} }{/math} | {tex}\pi=\sum\limits_{n=0}^{+\infty} \frac{{(n!)^2 2^{n+1}}}{(2n+1)!}{/tex} |
![]() |
|
Other plugins using phpMathPublisher
- Wordpress plugin by Ron Fredericks : http://wordpress.org/extend/plugins/wpmathpub/
- WordPress plugin by Timm Severin : http://wordpress.org/extend/plugins/wpmathpublisher/
- DokuWiki plugin by Christopher Smith : http://www.dokuwiki.org/plugin:math2
Version History
2010-06-02 version 1.5 improved support for special characters. Minor bug fixes. download v1.52010-03-27 version 1.4 support HTML entities in formula text. download v1.4
2010-03-07 version 1.3 support PHP 5.3. download v1.3
2010-02-21 version 1.2 support optional mathpublisher tags in JComments. download v1.2
2010-02-09 version 1.1 includes colour support and ability to specify an absolute path to joomla. A few minor bug fixes. download v1.1
2010-01-22 version 1.0 original version. Black formulae with best results on light backgrounds. download v1.0
Last Updated (Wednesday, 02 June 2010 09:32)


