Supporting MathML
After lots of trial and error, I think I finally have a fairly solid handle on what it takes to get a web page to properly display MathML. Depending on your situation, you can follow one of the sets of instructions below.
My instructions work for Firefox. I make no claims for Internet Explorer. Safari and other browsers based on Apple’s WebCore do not support MathML currently.
Supporting MathML in an individual document
The document’s filename must end in
.xhtml
The DOCTYPE must be set properly:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html>
must have the proper namespace:<html xmlns="http://www.w3.org/1999/xhtml">
<math>
elements must also have the proper namespace:<math xmlns="http://www.w3.org/1998/Math/MathML">
Supporting MathML in a CGI script
The script must return the proper HTTP Header content-type —
application/xhtml+xml
. This will, however, break Internet Explorer. I have written an extension for Oddmuse (still in testing) that detects which browser a visitor is using in order to send the proper content-type, but this seems like a kludge.The DOCTYPE must be set properly:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html>
must have the proper namespace:<html xmlns="http://www.w3.org/1999/xhtml">
<math>
elements must also have the proper namespace:<math xmlns="http://www.w3.org/1998/Math/MathML">
Installing the proper fonts for Firefox
Firefox supports MathML, but you must install the proper fonts for it to display properly. You can find these fonts at MIT.
When all is working properly, the following equation should look familiar and should consist of graphics in addition to characters:
<<x_(1,2) = (-b+-sqrt(b2–4ac))/(2a) [quadratic equation solution]>>