Using the wrong formula shown mathtran

Using the wrong formula shown mathtran

by Võ Trọng Trí -
Number of replies: 7
The formula \[\mathop {\lim }\limits_{x \to + \infty } f\left( x \right)\] show that \[{\lim _{x \to + \infty }}f\left( x \right)\] ????
Average of ratings: -
In reply to Võ Trọng Trí

Re: Using the wrong formula shown mathtran

by Mauno Korpelainen -

Different distributions of (La)TeX can use different syntax...

If you need in mathtran http://www.mathtran.org/cgi-bin/mathtran?D=2;tex=\lim\limits_{x\to+\infty}f\left(x\right)

try somethings like

http://www.mathtran.org/cgi-bin/mathtran?D=2;tex=\lim\limits_{x\to+\infty}f\left(x\right)

In reply to Mauno Korpelainen

Trả lời: Re: Using the wrong formula shown mathtran

by Võ Trọng Trí -
Thank you very much !
There are differences: Mathtran :\mathop {\lim }\limits_{x \to + \infty } f\left( x \right)
and Tex: \lim\limits_{x\to+\infty}f\left(x\right)
In reply to Mauno Korpelainen

Trả lời: Re: Using the wrong formula shown mathtran

by Võ Trọng Trí -
Mathtran the mathematical formulas can not have the <,>
because the seal type >,< in moodle will be converted to HTML &gt;,&lt;
http://mathtran.org/cgi-bin/mathtran?D=1;tex=a+%26gt%3B+b+%26gt%3B+c+%26lt%3B+d
\[a > b > c < d\]

In reply to Võ Trọng Trí

Re: Trả lời: Re: Using the wrong formula shown mathtran

by Mauno Korpelainen -

Editor can strip or change tags but there are always workarounds.

You can for example use directly img tags with editor image plugin address bar like this:

http://www.mathtran.org/cgi-bin/mathtran?D=1;tex=\textstyle%20\Phi_{j%2B1/2}%3D\left\{%0D%0A\eqalign{%0D%0A%26%20\Phi_L\%20\%20m_{j%2B1/2}\ge0%20\cr%0D%0A%26%20\Phi_R\%20\%20m_{j%2B1/2}%3C0%0D%0A}%0D%0A\right.

to render http://www.mathtran.org/cgi-bin/mathtran?D=1;tex=\textstyle%20\Phi_{j%2B1/2}%3D\left\{%0D%0A\eqalign{%0D%0A%26%20\Phi_L\%20\%20m_{j%2B1/2}\ge0%20\cr%0D%0A%26%20\Phi_R\%20\%20m_{j%2B1/2}%3C0%0D%0A}%0D%0A\right.

I copied that example from http://www.mathtran.org/formulas/ - just use mouse right click (Properties) to show the address of each image as an example...

In reply to Mauno Korpelainen

Trả lời: Re: Trả lời: Re: Using the wrong formula shown mathtran

by Võ Trọng Trí -
Of course mathtran.org true formula.
But as the article on moodle as compiled by the filter will contain errors mathtran
For example, when you type the formula $ $ a> b <c $ $ will get: click

So when composing posts very inconvenient. How do you fix or not?



In reply to Võ Trọng Trí

Re: Trả lời: Re: Trả lời: Re: Using the wrong formula shown mathtran

by Mauno Korpelainen -

I suppose that if you use htmlarea editor replaces < and > with &lt; and &gt; because lib/editor/htmlarea/htmlarea.php has code

HTMLArea.htmlEncode = function(str) {
// we don't need regexp for that, but.. so be it for now.
str = str.replace(/&/ig, "&amp;");
str = str.replace(/</ig, "&lt;");
str = str.replace(/>/ig, "&gt;");
str = str.replace(/\x22/ig, "&quot;");
// \x22 means '"' -- we use hex reprezentation so that we don't disturb
// JS compressors (well, at least mine fails.. ;)
return str;
};

It's not reasonable to change code of HTMLArea so you should probably edit mathtran filter (filter.php) and add there (near line 40) something like

$texexp = str_replace('&lt;','<',$texexp);
$texexp = str_replace('&gt;','>',$texexp);

to replace those characters back in mathtran expression.

I haven't tested this yet, but that's how things are done in those plugins where you need to change characters to some other characters and back for various reasons... EDIT: it works fine this way - tested...

In reply to Mauno Korpelainen

Trả lời: Re: Trả lời: Re: Trả lời: Re: Using the wrong formula shown mathtran

by Võ Trọng Trí -
It was wonderful, I have done. Thank you very much!!! Mỉm cười
In a similar way, I also changed to show the error formula \[{\lim _{x \to - \infty }}f\left( x \right)\] to \[\mathop {\lim }\limits_{x \to - \infty } f\left( x \right)\]
by
$texexp = str_replace('\mathop {','',$texexp);
You can comment this author mathtran edit this bugĐồng ý