using MathTran with CMSMS

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
mtung
New Member
New Member
Posts: 4
Joined: Mon Jan 28, 2008 10:17 am

using MathTran with CMSMS

Post by mtung »

Hi,

I am trying to run MathTran (http://www.mathtran.org/) on my CMSMS web site. MathTran is used to represent mathematical formulas by using Javascript which automatically translates LaTeX given as HTML tag to PNG image format.

Using MathTran in standard HTML is actually quite easy (I am describing this so you may recreate the problems I get with CMSMS):

(1) Put the following Javascript into the header (mathtran_img.js is run remotely, but may also be installed locally):





(2) Use LaTeX code such as this one in the main body of the HTML document


Simple equations as (2) will work. However, more involved examples as



produce errors. The error messages indicates that there is some conflict with the Smarty Compiler class in PHP5 and
the 'tex' tag of MathTran. You'll find a detailed error output at the end of this message.

Would it be possible to make MathTrans fully compatible with CMSMS? Would this require a simple
redefinition of the involved tags, or rather something like a new, specialized module?

TeX/LaTeX is the de facto standard for representing scientific formulas. It would be a great thing to fully incorporate MathTrans
into CMSMS. Do you have any suggestions how to achieve this?

Many thanks in advance for ideas and helpful suggestions,
                                                                                   Michael

string(126) "Smarty error: [in preview:cmspreviewVBqF5U line 80]: syntax error: unrecognized tag: n=1 (Smarty_Compiler.class.php, line 446)" string(124) "Smarty error: [in preview:cmspreviewVBqF5U line 80]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(126) "Smarty error: [in preview:cmspreviewVBqF5U line 80]: syntax error: unrecognized tag: n^2 (Smarty_Compiler.class.php, line 446)" string(124) "Smarty error: [in preview:cmspreviewVBqF5U line 80]: syntax error: unrecognized tag  '' (Smarty_Compiler.class.php, line 590)" string(128) "Smarty error: [in preview:cmspreviewVBqF5U line  80]: syntax error: unrecognized tag: \pi^2 (Smarty_Compiler.class.php, line 446)" string(124) "Smarty   error: [in preview:cmspreviewVBqF5U line 80]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(125) "Smarty error: [in preview:cmspreviewVBqF5U line 90]: syntax error: unrecognized tag: -n (Smarty_Compiler.class.php, line 446)" string(124) "Smarty error: [in preview:cmspreviewVBqF5U line 90]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line   590)" string(126) "Smarty error: [in preview:cmspreviewVBqF5U line 93]: syntax error: unrecognized tag: n=0 (Smarty_Compiler.class.php, line 446)" string(124) "Smarty error: [in preview:cmspreviewVBqF5U line 93]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)
Last edited by mtung on Mon Jan 28, 2008 11:03 am, edited 1 time in total.
bterkuile
Forum Members
Forum Members
Posts: 97
Joined: Sun Jul 22, 2007 11:48 am

Re: using MathTran with CMSMS

Post by bterkuile »

The easiest way to solve this is to put the equation between {literal} and {/literal} tags, this will solve most of the problems.
So you will have something like

Code: Select all

{literal}
<img alt="a^2+b^2=c^2" />
{/literal}
I created a mimetex module for TinyMCE, which you also might like. It can be found at: http://www.companytools.nl/mimetex

This will let you work with equation inside TinyMCE. You will have to update the TinyMCE module from cmsms but it works nice.
mtung
New Member
New Member
Posts: 4
Joined: Mon Jan 28, 2008 10:17 am

Re: using MathTran with CMSMS

Post by mtung »

Hi, this fast really a fast fix to the problem. Thanks! I will try out your TinyMCE extension.
Best, Mike
Post Reply

Return to “CMSMS Core”