Question

I am building a Q&A site for a university, and in order to ask and answer questions, it should be trivial to write equations and/or latex. Does anyone know of a good library that does this? It would be more than sufficient to use something like this (StackOverFlow) answering box, as everyone is familiar with it, and it's really easy to use.

UPDATE

I ended up using django-pagedown with MathJax and that's working pretty well. With some customization, I have pretty much SO's answering module with a LaTeX extension.

Was it helpful?

Solution

There's no Django way™ of displaying math equations. There's an HTML and JS way though. And you will be forced to do some of the work by hand.

As you can see in these SO questions from 2008 and 2010, the best way to embed latex equations in a webpage seems to be MathJax (used by math.stackexchange.com), the replacement and evolution of jsMath by the same developers. Read the MathJax documentation to get a hang of it.

The complex part is that you want the output panel to be dynamic. I never used math.stackexchange.com myself, but you could try to mimic what they do. Or just call MathJax after each keystroke if it's not too heavy.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top