I'd like to quote, with kind permission of the original author, the text of an article about LaTeX and MathML from access2science. The aim of the website is to provide "articles and links on accessibility of science, technology, engineering, and math (STEM). Its purpose is to provide practical information to people with print disabilities and to their friends, parents, and teachers.". The representation of mathematics in a consistent and standardised way is very important to the community that this website serves. The article originated as a post to the blindmath mailing list in response to a similar query about the roles of LaTeX and MathML.
There seems to be some confusion regarding LaTeX and MathML here. I'd like to help straighten that out, if I may. The confusion is with regarding their roles.
LaTeX is an input format. It is how we mathematicians write our articles, books, webpages, and anything else where mathematics is involved. (And often anything where mathematics isn't involved.) It is not designed to be read as-is. It is intended to be processed into a suitable output format and then read.
If anyone thinks that they can read LaTeX and understand what is going on, then I have a few documents I can post samples from which will soon disabuse you of that notion. Of course, very simple LaTeX can be read. Something like x^2 + y^2 = z^2 is fairly easy to understand, but try something more complicated like
\sum_{m = 2 \over m \text{prime}}^{\infty} \frac{1}{m^s}
and you'll see what I mean. And that's fairly simple compared to what can be written. When you realize that LaTeX (or rather, TeX) is completely programmable, then you'll see that you can find absolutely anything in a LaTeX document.
MathML is an output format. It is not designed to be written directly, but it is designed to be read. Of course, one needs a suitable renderer: a browser for the sighted and something like MathPlayer for those who want their mathematics read aloud, but then the same is true of any output format. As it is an open standard, it is a reasonable task to design a program to render MathML in to any desired medium.
It is possible, though not always straightforward, to convert LaTeX to MathML. One reason why it is not always straightforward is that TeX (the program underlying LaTeX) often needs to know things about its output. When run normally, TeX has complete control over the process and so can know exactly how the output will be seen. When producing MathML (or XHTML), it can't know exactly how the output will be seen. But those are technical difficulties that can usually be avoided.
The main difficulty is that most websites don't bother with this route. They convert the LaTeX mathematics to a graphic which is then displayed, with the original LaTeX as the alt text. Because of how it is produced, the LaTeX is usually very simple (no complicated macros), and so it may be possible to get by with reading the alt text.
So if you want to read mathematics, look for MathML. If you want to write mathematics, learn LaTeX (or another TeX variant).
Now, to (some of) your questions.
Is MathML obviously going to replace TeX in the near future?
No, because they fulfil different roles. I use LaTeX to produce MathML documents. I couldn't do without either of LaTeX or MathML in my workflow.
Is TeX in theory any more powerful than MathML? I mean more complete in terms of underlying markup capabilities, of the class of things it can represent?
Yes. TeX is a programming language. One of its strengths is the extent to which it can be customised and extended. MathML is a markup language. It is thus rather restricted when it comes to extending and customising it.
Meta this-I understand that this question might give offense only because whenever there are two different technologies that have the same aim they are sometimes thought of as "rivals" or "competitors" and have their respective "camps". Please know I am a total newbie in this area and in no way am I making a judgement about the worthiness of either technology. I am really just trying to understand how practitioners understand their own world.
The point of the article I quoted is that these technologies are in no ways rivals. If you wanted to invent a rivalry here, it would be better to play off PDF and MathML, or TeX and ... well, there isn't really anything like TeX.
To answer your real question: which format you should use, the answer depends on what you are going to do with it. What is the eventual output of the editor? Are you going to run the output through TeX to produce nice documents, or will it end up on a webpage? Is the user ever going to see the stored document? Once a document has been written, how much flexibility are you going to allow the user to have?
My instinct would be that if you don't know, you should pick MathML. My reason being that as it is a markup format and a web standard, it will be easier to work with in the program and easier to ensure that you know exactly what the editor will produce for the given input.
texmathHaskell library? I can be used for LaTeX to MathML conversion and tried out online. – sr_ May 29 '12 at 09:06