Monday 21 July 2014

Adding equations into Blogger

I've been enjoying working through the implementation of filters from STK into C# and putting the RBJ filters into the same code. I had a bit of a play over the weekend to make a bunch of other usual filters which I want to blog about as I get time. As I didn't want to just drop in the code without some explanation and it's been fun revisiting the theory I wanted to blog that first.

So far I've been writing the equations in Word, then getting an image capture and posting which is pretty tedious and thought that there should be a better way so had a look at that quickly this morning. There are quite a few approaches and I haven't comprehensively looked through them but jumped at the first one that seems to do the job easily enough. I've chosen to use MathJax.

A bunch of different bloggers have explained how to get this setup which is pretty easy. This one is a nice step-by-step description. I'm  a bit concerned with the comment on JavaScript variables and that I have to put this into the global layout, but rather than holding off until I've looked into all the details I'm keen to get going. 

The equations look like this inline \(y = \sum_{k=0}^m {a_k}{x_k}{z}^{-k}\) and \( H(s) = \frac {1}{s^2 + \frac {s}{Q} + 1}\). And can also be put standalone which displays slightly differently:

$$ y = \sum_{k=0}^m {a_k}{x_k}{z}^{-k} $$ $$H(s) = \frac {1}{s^2 + \frac {s}{Q} + 1}$$

The text for each of these is:

y = \sum_{k=0}^m {a_k}{x_k}{z}^{-k}

and  

H(s) = \frac {1}{s^2 + \frac {s}{Q} + 1} 

There's a good summary tutorial on the syntax here.

No comments:

Post a Comment