Page 1 of 1

using MathTran with CMSMS

Posted: Mon Jan 28, 2008 10:51 am
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)

Re: using MathTran with CMSMS

Posted: Mon Jan 28, 2008 12:24 pm
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.

Re: using MathTran with CMSMS

Posted: Mon Jan 28, 2008 1:36 pm
by mtung
Hi, this fast really a fast fix to the problem. Thanks! I will try out your TinyMCE extension.
Best, Mike