WHAT IS MATHML?
MathML is a low-level specification for mathematical and scientific content on the Web and beyond.
These pages provide you with information on how to learn and use MathML, on available software, and news from the MathML community.
LEARN
What is MathML teaches you how to create your first equation and to understand the base constructs of MathML.
For a quick intro, try Mozilla's tutorial, Daniel Scully's Beginner's Guide, Ryan Hodson's tutorial, or the Connexions Guide to MathML.
For a thorough resource on all tags and attributes, dive into the excellent documentation at Mozilla and you can also simply check out some pretty examples of MathML.
source: https://www.w3.org/Math/
Relationship between MathML and TeX
MathML is very verbose and is a pain to write manually, which is no problem if your code is automatically generated. For programs it is easy to parse, since it is XML.
TeX math code was designed to be written by humans and results in much shorter code. I cannot answer your question if one format will replace the other. As I mentioned they serve different purposes.
Is there any attempt to automatically transform one into the other that anyone is aware of?
I cannot speak for LaTeX, but in ConTeXt you can input MathML directly. Information about MathML in ConTeXt and the Wiki - MathML. Here is an example (credits to Hans Hagen) taken from one of the ConTeXt manuals:
\usemodule[mathml]
\starttext
\xmlprocessdata{}{
<?xml version="1.0" encoding="UTF-8"?>
<math xmlns="http://www.w3c.org/mathml" version="2.0">
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci> x </ci>
</bvar>
<apply>
<root/>
<ci> u </ci>
</apply>
</apply>
<apply>
<times/>
<apply>
<divide/>
<cn> 1 </cn>
<apply>
<times/>
<cn> 2 </cn>
<apply>
<root/>
<ci> u </ci>
</apply>
</apply>
</apply>
<apply>
<diff/>
<bvar>
<ci> x </ci>
</bvar>
<ci> u </ci>
</apply>
</apply>
</apply>
</math>
}{}
\stoptext
For a TeX to MathML conversion, you can use the XML export, see ConTeXt wiki - epub and my answer to the question Converting ConTeXt document to HTML.
---------------------------------------------------------------------------------------------------------------------------------
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.
---------------------------------------------------------------------------------------------------------------------------------
Clearly the designers of LaTeX and MathML are deadly rivals and never speak to each other (or to the designers of OpenMath for that matter). [I've been asked to point out in the comments that this sentence is frivolous: there is a an overlap between the designers of LaTeX2e, MathML, OpenMath and this answer.]
Tex and MathML can't really be compared as TeX is (essentially) a typesetter and MathML (essentially) is just an input language. However TeX comes with certain input conventions and MathML input expressions often end up being typeset, so there is an overlap.
Note that MathML is naturally Unicode-centric: almost all characters are accessed via Unicode. The extent to which TeX is Unicode aware depends a lot on which TeX engine you are using. Another difference is that TeX is oriented towards a situation in which the author has full knowledge of fonts and page size etc being used, and so, if necessary can add fine tune adjustments (although many journal submission processes suffer from these "tweaks":-) The design MathML on the other hand is perhaps more influenced by a typical browser scenario in which the author has very limited control over the fonts used and virtually no control over the page size.
You might also look at my answer in the related question:
Why is LaTeX used as the defacto standard for math equations?
There are simply lots of pieces of software for going from one to the other.
In direction (La)TeX → MathML
-
LaTeXML (NIST) (my personal favourite at present, all the MathML examples in DLMF were produced via this software)
-
tex4ht (Also very good, very customisable but historically a bit hard to control)
-
itex I haven't direct experience of this one but another popular convertor.
-
the tex input parser of MathJaX (probably the most popular way to put Mathematics on the web, used at many of the sister sites in this stackexchange network.
In the direction direction MathML → TeX
Several XSLT stylesheets, I'll just mention mine at
- pmml2tex This was used to generate many of the sample images and TeX rendering in the HTML and PDF versions of the MathML spec.
source: https://tex.stackexchange.com/questions/57717/relationship-between-mathml-and-tex
'Math' 카테고리의 다른 글
Math expression test in tistory (0) | 2020.03.31 |
---|---|
Hosting Your Own Copy of MathJax (0) | 2020.03.28 |
TeX Resources on the Web (0) | 2020.02.13 |
MathML presentaion in almost all web brower (0) | 2020.01.29 |
TeX, LaTeX . What the ... (0) | 2020.01.29 |