Everything works well, and using the above method, the math looks much better than the standard htlatex method. Except for things such as $\dot{x}$ which shows up really strange now and is not rendered well. I tried this on IE, Firefox, and Chrome, all with the same problem.

I'll show the small tex file, then the htlatex command I used, then the htlatex.cfg file (which is the same exact .cfg file show in the above answer), then show the HTML output.

Although over all the math looks better in this new method (mathml/mathjax which I have no idea how it actually works), but there are few spots where the math does not render well in HTML. Here is another case

2 Answers
2

The main problem is that tex4ht has been configured to use a precomposed accented x for \dot{x} which is the wrong translation, and produces incorrect output as you show. The generated MathML should use the <mover> form as for the dotted x.

But how would this solution be incorporated in the workflow that I have? I simply have source .tex file and also configuration file .cfg that I can change, and htlatex ofcourse. I can't be editing HTML files by hand each time and fix things after each build? I do not use Mathjax directly myself. htlatex generated the mathml file itself such that it uses MathJax to render things somehow. So any fix I need to do, must be done during compiling the latex file by htlatex and not after that. It seems you think there is a bug in htlatex then? Should I report this as htlatex bug? thanks.
–
NasserApr 20 '13 at 8:32

@Nasser Not so much a bug as a mis-configuration I suspect. It's a long time since I used tex4ht (last century sometime:-) so I can't directly point you to the configuration option but it can't be that hard to tell it not to mess with the mathematics at all and just pass it straight to the output html for mathjax to sort out.
–
David CarlisleApr 20 '13 at 8:49

It also failes on $\dot{x}^2$ producing this !Mathematica graphics, after many hours trying many different combinations, I gave up on tex4ht+mathml+mathjax. It is not working. Back to using tex4ht+ png for math. At least png for math works. Also the suggestion to leave equations unchanged did not work for me. I give up :)
–
NasserDec 31 '13 at 9:39

Yes, adding the {} helped. But it still had the same issue with not using the correct \dot{x} rendering. I use this matjax nice page cdn.mathjax.org/mathjax/latest/test/sample-dynamic.html to test things on mathjax directly. And mathjax itself can handle $\dot{x}^2$, so it seems the mathml generated by htlatex has issue with it. thanks.
–
NasserDec 31 '13 at 10:08