Hacker News new | past | comments | ask | show | jobs | submit login
Announcing ... MathML! (WebKit) (webkit.org)
81 points by swannodette on Aug 18, 2010 | hide | past | favorite | 27 comments



Are there any good tools for generating MathML automatically, or converting LaTeX to MathML? Writing MathML for an expression[1] is a tedious pain in the ass. The MathML expansion of a formula ends up being very similar to a verbose parse tree represented in XML, and mathematical notation can be very dense so those trees get large.

[1] This is where the word "non-trivial" usually goes, but not this time.


Several approaches:

1. The semi-official answer seems to be to use a WYSIWYG editor, which seems to be the solution XML proponents take to any syntax problem. ;-) For example, you can export to MathML from OpenOffice's equation editor.

2. If your goal is just to display math in webpages, there are some .js libraries that replace MathML's concrete syntax inline: you write a different syntax directly in your markup, and then it's converted at load time to MathML for browser rendering. The first widely used one was ASCIIMathML (http://www1.chapman.edu/~jipsen/mathml/asciimath.html), which inspired LaTeXMathML (http://math.etsu.edu/LaTeXMathML/), and possibly others.

3. There are a number of offline translators from TeX math syntax to MathML. I've only ever used Blahtex (http://blahtex.org/), but there are a ton, in various stages of completeness and maintained-ness.

edit: it looks like the original blahtex is abandoned for a few years now, but a maintained descendant is here: http://gva.noekeon.org/blahtexml/


There is also mathjax (http://www.mathjax.org/) which can render MathML if your browser supports it (the actual markup you use is the de-facto standard LaTeX notation).

Now I only need something that will let me paste Matlab figures into HTML documents as SVG... (would make for a great research wiki.)


I am quite fond of http://golem.ph.utexas.edu/~distler/blog/itex2MML.html . It's not exactly the same, but the only glitch that you are likely to hit is that "ab" is not the same as "a b": the first is one variable (MathML has the concept of multiletter variable names), and the second is two variables neighbouring.


MediaWiki has a tool that parses LaTeX, sanity checks it, and can spew out LaTeX again or a very limited version of MathML.

If anyone out there knows OCaml enough to improve its emitter that would mean MathML for Wikipedia articles in WebKit browser once this comes out.


We use the LaTeXML system [http://dlmf.nist.gov/LaTeXML/], see also http://trac.mathweb.org/LaTeXML for developer-related stuff. LaTeXML can transform (most of) your LaTeX documents to XHTML+MathML which can then be presented in the browser. In the arXMLiv project [http://arxmliv.kwarc.info] you can see LaTeXML in action: we have transformed the majority (over half a million articles) of http://arxiv.org.


I wrote a Haskell library, [texmath](http://github.com/jgm/texmath) that converts LaTeX to MathML; this is used in pandoc and gitit. The library comes with two executables, one a standalone command-line converter, another a CGI program. There's an interactive demo [here](http://johnmacfarlane.net/texmath). The library just handles standard LaTeX math + AMS extensions. It doesn't yet know how to parse macros.


Windows 7 has the Math Input Panel, which lets you write equations on a tablet and convert them to MathML. The same recognition engine can be used from OneNote, which I've used to take notes during a lecture and later convert to a decent-looking document.


I use Open Office, and export. The OO editor is pretty quick for typing math. I then have a couple of scripts that clean things up a bit.



When this version of WebKit makes its way into Chrome I'll finally be able to stop using Firefox. Nowadays I only use it for MathML.


Weird... the square roots look like crap, especially compared to the rest and when zoomed in (r65222, so not most recent, but still very). No color-AA.

The rest of that is gorgeous, though. Awesomeness.

edit: nope, r65398 doesn't fix it.


Interesting. Opera supports MathML and the square root also looks like crap zoomed in, while the rest looks fine. Maybe a bug in some shared library?


Finally! Once it percolates down to Safari and Chrome, I hope to see a real adoption of MathML in the academic community (which tends to use IE less, while having a stronger demand for MathML).


Chrome doesn't support it now. As it's WebKit based, will the next version incorporate this feature?


This is just a nightly build; both Chrome and Safari's public releases lag some way behind the nightlies, for obvious reasons.


Awesome! I worked on an iPhone app about 6 months ago that could have really benefitted from this. Instead we had to use a third party lib on the server to render the MathML into images. It was a huge mess.

Here's to hoping we see this trickle down to UIWebView soon!


I wonder when search engines will start indexing MathML. I spent a good part of college trying to figure out exactly what to search for in Google while working on problem sets and being able to search expressions would've saved some late nights.


> I wonder when search engines will start indexing MathML

More importantly, to understand the same formula under different notations.


The problem is context. A formula means nothing without it. Identifying the correct context (or even just the most likely one) for a formula is Not Easy.

Different fields within maths, engineering & physics frequently reuse names and symbols to mean different things, so formulas which look the same can have completely different meanings. And as you alluded to, formulas which look different can end up meaning the same thing.

MathML is split into presentation markup and content markup. The presentation markup describes the rendering of a formula; the content markup describes its semantics. If anyone actually used the semantic markup, it could help with this problem.


That would be nice, but whether two formulas are equivalent is undecidable.


This is awesome. I've been waiting for this for a while.


Are we supposed to be able to select text in an equation? Selection looks kind of weird there, and when pasted, looks like this: ζnk1∞1kn


Not selecting, but making math render crisply like text does.


What I don't get, is why is MathML only for displaying formulas, not not for making actual, working algorithms?


What do you mean?


Good to see WebKit picking this up as well!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: