# MathX: LaTeX formulas in MODx

01-04-2012 22:38

This is my first extra for MODx CMS (or, as they say, CMF). Did you every try to put some mathematical formulas into your webpages? There are many methods to do this: MathX simplifies the procedure (if you use MODx, of course). You can download the plugin from the Extras section of the MODx website, i.e., from here.

With this plugin you can render your LaTeX formulas in a MODx resource. Use <math></math> for your block formulas and <m></m> for your inline formulas.

For example, after installing this plugin, you can write (this formula is only an example, it does not have any sense):

$\theta^2 + \omega^2 = \frac{1}{\sqrt{x^2 + y^2}}$

That will be rendered as:

Moreover, you can write inline formulas like this: <m>e^{i\pi}+1=0</m>, that will be rendered as .

Formulas are rendered using the online services of www.codecogs.com and cached once forever (in /assets/components/mathx), so that you do not have problems with CodeCogs quotas.

You can freely change the style of rendered formulas. The block formulas <math></math> are rendered with an image of class mathx_block, surrounded by a div of the same class. Inline formulas <m></m> are rendered with an image of class mathx_inline, surrounded by a span of the same class. For example, on my website, the stylesheet contains these lines:

/* MathX styles */
div span img.mathx_inline { margin: 0; padding: 0; vertical-align: baseline; border:0 }