In the past week I’ve been trying to solve Project Euler projects using PowerShell. So far so good, most problems are quite doable (although sometimes a bit slow). I’m going to write at least three posts about this (I have two drafts already), for which I will need some way to properly format mathematical equations.
For this, I installed MathJax (http://www.mathjax.org/), which converts formulae in LaTeX of MathML format into the proper representation. This post is more or less me trying out a few options, and showing off the pretty math.
Sum of all terms of f(x2) where x = 1..n
$$\sum_{x=0}^{n}{x^2} = {{2n^3 + 3n^2 + n}\over6}$$
The quadratic formula
$$x = {{-b} \pm \sqrt{b^2 - 4ac} \over 2a}$$
And, because I really have to have an Euler reference, Euler’s formula
$${e^{ix} =\cos x +i\sin x}$$
The only thing so far which doesn’t work too well is the Sigma with bounds. They should appear below and above the sigma sign, but they don’t. I’ll just ignore that for now, unless someone comes to me with a brilliant solution ;-)
Update
Seems like I was simply not doing it right! I enclosed the formulae in single dollar signs, while I should’ve used double dollar signs. Single dollar signs are for inline display, double dollar signs are for blocks. Inline display renders differently, which is why the bounds were not properly aligned. Fixed it now, thanks to this thread: http://groups.google.com/group/mathjax-users/browse_thread/thread/c7ac90a0d90e18fb