Click here to Skip to main content
15,851,701 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm in the process of converting latex to mathml in php.Texmath is the command line tool through which the conversion process can be done.

Latex file:
\mathbf{f} = (f_{1},

shell_exec('echo "password" | sudo -S /root/.cabal/bin/texmath latexfile > outputfile');

If I run this php file thorugh command line,it generates the desired output file which is below
command line script:
php test.php

<math display="block" xmlns="">
       <mstyle mathvariant="bold">
       <mo stretchy="false" form="prefix">(</mo>
         <mo stretchy="false" form="postfix">)</mo>

When I run this php file through the browser am getting the output file like
<math display="block" xmlns="">
        <mstyle mathvariant="bold">

It ignores all the mathtype characters. Why is it gives desired output only through the command line not through the browser. When I open these two files in the editor it displays 'UTF-8'. Is this is character encoding issue? How to solve this.

Additional note: If I run php file through local host it gives desired result as the command line php execution does. The problem only with shared web server.
John C Rayan 27-Feb-15 5:31am    
can you get the source from your browser using view source. What browser are you using.
Vidhya Raju 1-Mar-15 23:41pm    
It doesn't display anything in the browser. Just this code creates a file which contains special characters

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900