www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Mathematical formulae in documentation / Mathjax

Hi,

MathJax is a Javascript trick that can nicely typeset
mathematical equations written in TeX, on-the-fly, in any HTML
document. Enabling it is easily done by adding some <script
...></script> in the <head>, which I managed to do by overriding
DDOC. However, if I have a piece of code like

/// Return \(x^2\)
int square(int x)

dmd -D produces

.... Return \(<i>x</i>\) ....

Mathjax searches for \( ... \) in the page and then typeset as if
it was written in TeX it but here it does not recognise <i> and
gives up. Editing DDOC_PARAM is not an option of course.

Is there a way around?

Thanks in advance!
Dec 04 2014