avatar

Centered images and MathJax support


19-09-2015 16:53 by depado

Centered images and MathJax support !

Baby

MarkDownBlog now officially supports MathJax. It also works when you preview your mardkown on the new/edit page.
Oh also, the images are now alway centered.
Oh and I changed the markdown engine from Misaka (GitHub) to Mistune (GitHub) as it is easier to declare a new grammar and/or new blocks in Mistune. I'll write an article later about how to achieve the MathJax parsing + syntax highlighter and custom image renderer using Mistune.


MathJax Block

In order to create a MathJax block, the syntax is $$ your mathjax code here $$. You can see an example below :

$$ ├ętat(u) = \sum_{p \in POP(u)} (\int_{REL(u)} DDL(p,u,x)^{r} dx)^{i} $$

MathJax Inline Block

In order to create an inline MathJax block, the syntax is $ your mathjax code here $. Using that syntax you can put math expressions in the middle of a sentence. You can see an example below :

When $a \ne 0$, there are two solutions to $ax^2 + bx + c = 0$ and they are : $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$

(Don't hesitate to click on the upper-right eye icon to see the raw markdown)