Saturday, December 3, 2011

Latex in HTML (revisited)

Some time ago I published a post where I was presenting an easy tool to be integrated into web pages which allows to render LaTeX equations just embracing the code into $ sings.

I never noticed how much I used the dollar sign until I developed this script!! It has texified so much text which wasn't expected to be, that I decided to change the approach a bit. Now, Instead of parsing the whole document, I'm just parsing the divs the class of which is "latex".

So now, depending on the class of the actual container of the text I can have this behaviour:

$3 + 2 = 5$

or this one:

$3 + 2 = 5$

As easy as changing the div's class. The code in the previous post has been updated accordingly!

No comments:

Post a Comment