ACEnetica

Discussion about the use of self-organisation for automatically "programming" networks of processing nodes.

Sunday, September 25, 2005

Including maths in blog postings

In the not too distant future it should be very easy to include maths on web pages in a way that is understood by all web browsers. It is certainly possible to do this right now, but maths is very definitely a second class citizen as far as web pages are concerned.

The technology that helps us to include maths (and other structured objects) on web pages is XML (eXtensible Mark-up Language) which is like a very fancy version of the HTML that we all know and love. I have been tracking the development of XML with interest for many years.

MathML is one of the mark-up languages that has been defined using XML, and its use in blogs has been frequently discussed by Jacques Distler in his blog here. However, I am not aware of any shrink-wrapped solutions to the problem of blogging with MathML. It seems to always require too much hacking around with "utilities", which is something I could do but am too lazy to bother with.

MathML has two features that I very much like:
  1. It explicitly represents the full structure of mathematical expressions. This means that it is not a snapshot of the finished equation, but is an algorithmic description of how to construct the equation, keeping the interrelationship between its various parts intact.
  2. The maths is part of the web page itself, and is not a set of embedded images (called in from hundreds of small image files) as has been the case in the past (e.g. LaTeX2HTML, Mathematica's "Save as HTML", etc).

Currently few browsers understand MathML directly (e.g. Internet Explorer needs the free MathPlayer plug-in), and even then they do not necessarily display the maths very well. This technology is still not mature.

I particularly like MathML (and more generally XML) because its design allows it to be easily imported/exported to/from Mathematica. The reason for this ease of communication is that the internal representation used by Mathematica is essentially the same as XML.

Mathematica also offers another less pretty way of including maths on web pages, which also preserves the structure of the maths in the same way that MathML does. Thus you can use Mathematica InputForm to write out maths in a 1-dimensional notation. For instance, Sin[x]==Integrate[Cos[x],x] has the obvious meaning, and it will evaluate to True in Mathematica. This approach generalises to arbitrarily complicated expressions but it can become rather "wordy", so careful indenting to highlight the structure of expressions is a good idea.

The use of MathML has not yet become widely enough acknowledged that all web software knows how to display it. For instance, the blog editing software I am using (see www.blogger.com) doesn't understand MathML (or, at least, I can't find a way of doing it). So I will limit myself to using Mathematica InputForm for now in my blog postings.

0 Comments:

Post a Comment

<< Home