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.

$$-{e}^{-i\pi}=1$$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.

How about comments?

$${\int}_{\mathcal{M}}d\alpha ={\int}_{\partial \mathcal{M}}\alpha $$Awesomeness. You rock!

breaking away:

$\text{Itex2MML::Error}$

$$\perp \top \square \blacksquare \diamond \u25ca\u29eb\u25b5\u25b4\u25be\u2605$$ $$\frac{x+y}{\mathrm{xy}}$$ $$[\begin{array}{ccc}0& \cdots & 1\\ \vdots & \ddots & \vdots \\ 2& \cdots & 3\end{array}]$$ Eyjafjallajökull from the most popular and trashiest newspaper in Germany. $\text{Itex2MML::Error}$ $${x}_{\mathrm{1,2}}=\frac{-b\pm \sqrt{{{b}^{2}-4\mathrm{ac}}}}{2a}$$Hm, I posted the last comment and created the tex stuff by copy&paste from the Tex Wikipedia article, I mean it

shouldhave worked unless I pasted it wrongDoes the “Journal” theme work? That is my favorite.

Wikipedia does not use itex

@Tim: it’s

$$\begin{array}{rlrl}L& =\underset{\mid x\mid \to \mathrm{\infty}}{\mathrm{lim}}\frac{\mathrm{cos}\frac{1}{x}\cdot \frac{-1}{{x}^{2}}}{}\frac{-1}{{x}^{2}}& \phantom{\rule{1em}{0ex}}& \text{by me}\\ & =\underset{\mid x\mid \to \mathrm{\infty}}{\mathrm{lim}}\mathrm{cos}\frac{1}{x}\cdot \frac{-1}{{x}^{2}}\cdot \frac{{x}^{2}}{-1}& & \text{by him}\\ & =\mathrm{cos}\frac{1}{\mathrm{\infty}}=\mathrm{cos}0=1& & \text{Axiom 3}\end{array}$$itex, not tex. I guess I ought to add the “View Source” ability to the theme. I’m not sure what the error was in the first one, but the second should have used ‘aligned’ instead of ‘alignat’. Let me try:If you could add a “Source” feature to this, you would super rock

Stick it down as “feature request”! Is there a “preview comment” plugin for wordpress?

>Is there a “preview comment” plugin for wordpress?

Not as far as I know…

Hmm, now why didn’t your comment get properly parsed?

should be a blockquote.

Andrew said:

uuhhh – that’s a difference I completly ignored to this point, without problems

admin says

I’d like to have that, too. Or an “edit after posting” one.

Not as far as I know…

And one that allows me to correct the typo in my own name.

>>Is there a “preview comment” plugin for wordpress?

>Not as far as I know…

That’s what I said! (Nested quotes? )

Oh oh! A preview button!

Right, found a preview plugin. Let’s try it out with some maths as well: ${x}^{2}=\pi $. Wow! It worked “out of the box” (well, with one modification but that was already in the

readmeand I don’tknowthat it wouldn’t have worked without that change).This is really great! Now I just have to figure out how it works. Let’s try something like

$\u27e8x\u27e9={\int}_{-\mathrm{\infty}}^{+\mathrm{\infty}}\mid x\u27e9\u27e8x\mid \mathrm{dx}$

Sweet!

By the way, how did Eric get the nice, big integrals? Mine was puny.

@Ian: Use double dollar signs

Eric asked about wikilinks. They ought to already be here. Let’s try with a link to the nlab itself: HomePage.

Oh, by the way. I think non-ascii wikilinks do not work.

Let me try it out:

$${\int}_{-\mathrm{\infty}}^{+\mathrm{\infty}}{e}^{-{x}^{2}/2}\mathrm{dx}=\sqrt{2\pi}$$ so with a change of variables, ${\int}_{-\mathrm{\infty}}^{+\mathrm{\infty}}{e}^{-{x}^{2}}\mathrm{dx}=\sqrt{\pi}$.Hmm, some stuff came out in boldface… it’s because there was no space between the d and the x. If I put a space in, I get

$${\int}_{-\mathrm{\infty}}^{+\mathrm{\infty}}{e}^{-{x}^{2}/2}dx=\sqrt{2\pi}$$ and then the subsequent text is not boldface.Wait, it is! The $dx$ looks fine but the following text is boldface. Huh.

I seem to have a knack for bumping into bugs! But anyway, this is great, Andrew. Congratulations! The world will thank you.

Firebug is fantastic. Using it, I was able to track down exactly why that’s in bold. It’s CSS, John, but not as we know it. I’ll fix it by-and-by.

Will this work if we use Wordpress.com as host? I’d really like it for my blog since I’ve received a few complaints about the way LaTeX is implemented on WP at the moment (makes it hard to real, I guess). If so, how do I get a copy of it? Thanks!

I have just installed another plug-in (wp-math-2) and it runs quite fine except for the same an issue already displayed above: the expression below a root is actually written below … well below as the root is written as a superscript before the expression, followed by a black rectangle and the expression below the rectangle. For example : $$x=\frac{-b\pm \sqrt{{b}^{2}-4.a.c}}{2.a}$$ Is there a way to fix this or overcome it? Is it due to a wrong LaTex syntax ?