This is a “showcase blog” demonstrating that Wordpress and MathML can exist in harmony together. So far, all I’ve done is:
- Download and install wordpress
- Install the wordpress plugins ‘MarkdownItex’ and ‘XHTMLValidator’
- Activate these two plugins (taking care to not activate ‘Markdown Extra’ itself)
- Written this post.
And now, I can write mathematics! So let’s start with what is officially the most beautiful formula.
Of course, as expected, nothing works quite so simply. The first time that itex runs, assuming that it is not running locally, it needs to create a cache in which it can store all the mathml excerpts. So having written our post, we navigate to the correct directory, allow itex to create it’s cache, and then all is well:
cd wp-content/plugins/MarkdownItex
chmod 777 .
<reload homepage>
chmod 755 .
What we should have done at first was also modify our “theme” to display the correct “document type”. At the moment, we think that we’re just serving XHTML whereas we actually want to serve XHTML+MathML. So we need to install a “MathMLised theme”, or adapt a favourite one to MathML. This isn’t difficult, we just need to do two things: modify the DOCTYPE and serve the document as “application/xhtml+xml”. In mytheme/header.php, we change the DOCTYPE line to:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd" >
whilst in mytheme/functions.php we add the lines:
function reset_html_type($tf) {
return "application/xhtml+xml";
}
add_filter('pre_option_html_type', 'reset_html_type');
somewhere not in the middle of another function (there are other ways to achieve the same end as this).
Note: As we’re now serving proper XHTML, any little errors which previously were overlooked by forgiving browers will now be dealt with very strictly. So there may be other errors in the theme which only come to light upon further testing.
Further Note: As this is the first live test of the various themes and plugins, they aren’t publicly available yet. Anyone who wishes to test them is welcome to do so, just contact me for how to get hold of them.