MathJax and PHP array

93 views
Skip to first unread message

Arindam Bandyopadhyay

unread,
Aug 15, 2016, 4:05:43 PM8/15/16
to MathJax Users
I am using MathJax. It is not working when I use an array(which contains some latex equation) in PHP. 
Please help.
With best regards,
Arindam Bandyopadyay.
India.

David Farmer

unread,
Aug 15, 2016, 4:41:08 PM8/15/16
to MathJax Users

Without more clues, like a live example, it is hard to diagnose
the problem.

But one guess it too many or not enough backslashes.

Regards,

David
> --
> You received this message because you are subscribed to the Google Groups "MathJax Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> mathjax-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

Arindam Bandyopadhyay

unread,
Aug 20, 2016, 12:07:07 PM8/20/16
to MathJax Users
Thank you David for your quick reply. Sorry for the delay. I am sending three php file named 1.php, 2.php and 3.php which can be seen my website link: http://www.arinmath.in/32/1.php,
http://www.arinmath.in/32/2.php,
http://www.arinmath.in/32/3.php for quick output.
In 1.php array is used but there is no latex equation and output is o.k.
In 2.php array is used and the array contains some latex equation and the output is not o.k.
In 3.php array is not used but the same latex equation is used and the output is o.k.
I can't understand why such type of ambiguity occurs.
Please help.
With regards,
Arindam Bandyopadhyay.
India.

David Farmer

unread,
Aug 20, 2016, 2:04:42 PM8/20/16
to MathJax Users

Dear Arindam,

This is not a MathJax problem: if is a problem with your script that
is sending the contents of the page.

If you look at the page source (Firefox I am doing Tools -> Web Developer
-> page source) you will see that the first dollar sign is missing in
each line. Also, some of the backslashes ("\frac" for example) are
replaced by funny characters.

I haven't uses php in a while, but if you write $x^2 = 3$
and "$x" is interpreted as a variable, then you will get something
like "^2 = 3$" because $x (the variable) has no value.

Add a backslash in front of the dollar signs and it should be okay.
(As I guessed in my first email: not enough backslashes).

Regards,

David
Reply all
Reply to author
Forward
0 new messages