## Hacking Dotclear 2 for writing XHTML+MathML+SVG

By fredw on Sunday, May 2 2010, 17:17 - Permalink

Of course, the first thing I've checked after setting this blog is whether
it is possible to have a `XHTML+MathML+SVG`

page in dotclear. As indicated in the Mozilla
MathML Project page, one has to:

- serve the page as
`application/xhtml+xml`

.This is simply done by editing the value of parameter

`$content_type`

in the function`serveDocument`

of the file`dotclear/inc/public/lib.urlhandlers.php`

. - write well-formed XML document.
Apparently, dotclear is good enough to do that. However, its editor does not seem to have any option for producing MathML or SVG. Personally, I don't use the wiki syntax and prefer to write the XHTML page myself with the tools I'm used to. As a consequence, this is not really a problem for me.

It is also a good idea to write a

*valid*XML document. By default, dotclear uses the doctype`XHTML 1.0 Strict`

so I had to modify the files`themes/name_of_your_theme/tpl/*.html`

to set`XHTML+MathML+SVG`

instead.

Once this simple changes are made, you can insert MathML formulas such that this expression of a general Quantum Fourier Transform over a finite group:$$\forall g\in G,{F}_{G}\mid g\u27e9=\frac{1}{\sqrt{\mid G\mid}}\sum _{\rho \in \hat{G}}\sqrt{{d}_{\rho}}\sum _{i,j=1}^{{d}_{\rho}}{\rho}_{ij}(g)\mid \rho ij\u27e9$$

or SVG images such that this quantum circuit used in the famous Shor's algorithm:

Voilà!

--update 30/01/2011: you can find my patch for Dotclear 2.2

## Comments

best mathemathic code what i see ever!!!!!

Wow what a great post