Skip to the Main Content

Note:These pages make extensive use of the latest XHTML and CSS Standards. They ought to look great in any standards-compliant modern browser. Unfortunately, they will probably look horrible in older browsers, like Netscape 4.x and IE 4.x. Moreover, many posts use MathML, which is, currently only supported in Mozilla. My best suggestion (and you will thank me when surfing an ever-increasing number of sites on the web which have been crafted to use the new standards) is to upgrade to the latest version of your browser. If that's not possible, consider moving to the Standards-compliant and open-source Mozilla browser.

January 18, 2003

Little Steps

As many of you know, the reason I started this blog was because I thought the weblogs would prove to be an excellent vehicle for “informal” physics discussions.

Being able to type equations (preferably in TeX) and have them display inline in your browser is an essential part of that. My first attempt to put MathML in this blog didn’t work so well. Perhaps you think I entirely abandoned the notion. Not at all.

Some of you might also have noticed my dogged obsession with bringing this blog up to full XHTML 1.1 compliance which must, I admit, seem pretty quixotic.

Anyway, there was method to my madness. With a little mod_rewrite trick in the .htaccess file of this blog,

RewriteEngine On
RewriteBase /~distler/blog/
RewriteRule ^$   index.html    
RewriteCond  %{HTTP_USER_AGENT} Gecko
RewriteRule \.html$ - [T=text/xml]
RewriteCond  %{HTTP_USER_AGENT} Safari
RewriteRule \.html$ - [T=text/html]

I can serve up XML to Gecko-based browsers which grock MathML (but only when rendering XML files), while sending “plain old” HTML to other browsers. It’s actually the same file; just the MIME-Type is altered, depending on what browser does the asking.

This only works if my blog is 100% valid XHTML. XML parsers puke at the slightest error and refuse to render the page, unlike your basic HTML parser, which will try to render something out of even the most broken HTML.

I think I’ve succeeded. There were surprising bits of invalid (X)HTML hidden away in obscure corners of MovableType, as this thread delineates. I think I’ve caught everything now, but if you’re running a Gecko-based browser and something here returns an XML parser-error, let me know.

Assuming you have the fonts installed, this means that (MathML)

iħ ψ t=-ħ 2 2 m 2ψ+V(x)ψ

will look like (screenshot)

Schroedinger

in a Gecko-based browser.

But, of course, that’s only the first step. In the forthcoming version of MovableType, Ben and Mena have announced the introduction of a Text-Filtering API. I’ve already mentioned some of the benefits, but for present purposes, the biggest payoff is that we can write posts with embedded itex (a dialect of LaTeX) and have MovableType automatically run them through itex2mml to convert them to embedded MathML.

That’s not quite how I created this post. Instead I ran it through the online itex2mml converter. But you get the idea…

Posted by distler at January 18, 2003 4:17 PM

TrackBack URL for this Entry:   http://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/76

0 Comments & 2 Trackbacks

Read the post New Look, XHTML 1.1 and MathML
Weblog: Procrastination
Excerpt: You might have noticed the new look of this weblog. It all started due to Asif and Jacques Distler. Asif just started using LaTeX formulae on his weblog and Jacques has been doing so for quite a while. Asif is...
Tracked: January 9, 2005 11:04 PM
Read the post New Look, XHTML 1.1 and MathML
Weblog: Procrastination
Excerpt: You might have noticed the new look of this weblog. It all started due to Asif and Jacques Distler. Asif just started using LaTeX formulae on his weblog and Jacques has been doing so for quite a while. Asif is...
Tracked: March 14, 2007 7:40 AM

Post a New Comment