User:WimW/PoorMansMath

From mediawiki.org

Presented here is the really simple solution to showing equations in your Wiki: use an external service to convert the equations. At [1] an option is offered to create an image from your equation. The equation is passed by URL, so it should contain no blanks and such characters. Other such services may exist, but I am unaware of them.

While the amount of work to operationalize it is close to zero, there are drawbacks though.

  1. the equation images are not locally stored, so they will be regenerated with every view.
  2. there's overhead involved calling an external website.
  3. you're depending you wiki on a third party, whose website might disappear, be renamed, become too slow, etc.
  4. enabling the IMG-tag involves a security risk, depending on how open your wiki is to unknown contributors.

Here's an example, but it is unlikely to work here on MediaWiki, for it needs a smal change in the LocalSettings.php ($wgAllowImageTag = true;); otherwise just the IMG-tag and the link are shown:

   <IMG src='http://latex.codecogs.com/gif.latex?e=m\cdot{c^{2}}'>

<IMG src='http://latex.codecogs.com/gif.latex?e=m\cdot{c^{2}}'>

To make things easier, wrap this into a template, e.g.:

template: equation

<includeOnly>
<IMG src='http://latex.codecogs.com/gif.latex?{{{eqn}}}'>
</includeOnly>
<noinclude>

== purpose ==
Poor man's equation parser

== usage ==

enter {{equation|1=e=m\cdot{c^{2}} 


to get {{equation|eqn=e=m\cdot{c^{2}} 
</noinclude>

(requires $wgAllowImageTag)