🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

LaTeX math via MathJax?

Started by
1 comment, last by Bacterius 10 years, 11 months ago

A few weeks ago I tried to make a post in the math forum with a bit of LaTeX mixed in. A sticky post said to use the "eqn" tag. The tag seems to query a server to render the latex and serve an image. However it seemed quite easy to break the server so it wouldn't output an image at all.

The other day I was stumbling across the internet and found http://www.mathjax.org/ which renders latex into HTML elements. It seems to function quite well. Has anyone considered this for use in the forums / journals? I did a quick search of the forums and couldn't find any mention of it. So I thought I'd post it here.

Advertisement
I have used (mainly maths related) forums featuring the insertion of LaTeX equations using MathJax and it works quite well. The only problem I have had is that, being written in JavaScript, the images are created during page loading and it can become slow when a lot of equations are used. The main advantage of MathJax is in my opinion that it is possible to copy the LaTeX code of the formula. When JavaScript is not enabled I think it simply shows the LaTeX code.

That would be nice to add, indeed. I agree it can make things slower when loading a page but I think it is worth it, especially for the Math & Physics subforum, and the developer journals, as well as for articles which contain a lot of math (like the vector tutorials published a couple months ago).

It's really easy to implement, too, all I had to do on my website was paste the loading code into a header file and serve it with every page sent to the user, worked perfectly. There's no server load given everything is rendered by a remote CDN and then sent to the client directly. And as apatriarca says, the fact that only the formula is stored on the server makes this very future-proof.

PS: if this is done, please make [eqn] a MathJax tag (I think there is a way) or at least do a search & replace to convert them to dollar signs, I'd hate to see all the posts using [eqn] lost forever sad.png

*imaginary +1*

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

This topic is closed to new replies.

Advertisement