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},
f_{2})^{\prime}
test.php:
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="http://www.w3.org/1998/Math/MathML">
<mrow>
<mstyle mathvariant="bold">
<mi></mi>
</mstyle>
<mo>=</mo>
<mo stretchy="false" form="prefix">(</mo>
<msub>
<mi>f</mi>
<mn>1</mn>
</msub>
<mo>,</mo>
<msub>
<mi>f</mi>
<mn>2</mn>
</msub>
<msup>
<mo stretchy="false" form="postfix">)</mo>
<mo>′</mo>
</msup>
</mrow>
</math>
When I run this php file through the browser am getting the output file like
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<mstyle mathvariant="bold">
<mi>
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.