TheRPGSite

The Lounge => Help Desk => Topic started by: Wtrmute on February 20, 2023, 12:31:15 PM

Title: Allow maths expressions in forum posts?
Post by: Wtrmute on February 20, 2023, 12:31:15 PM
I know this is a long shot, but sometimes I would like to include mathematical expressions in forum posts, typically to express dice probability etc. Generally, on the Web, this is done by including the MathJax javascript library and letting it render on the client side, so it does not place any undue burden on the server.

I took the liberty of looking up whether there was a prepackaged solution for the forum software this site uses, and found this one (https://custom.simplemachines.org/index.php?mod=4077). I'm not affiliated with it in any way, but it seems to do the job adequately well.

Thanks for your time in any case!
Title: Re: Allow maths expressions in forum posts?
Post by: brettmb on February 20, 2023, 04:24:16 PM
I'll look into it, but I'm trying to keep the load times as low as possible, and this library would likely just add to the burden.
Title: Re: Allow maths expressions in forum posts?
Post by: Wtrmute on February 20, 2023, 06:14:09 PM
Thanks! I don't think it will make much of a difference in load times; these libraries are massively optimised, being used in Wikipedia and StackExchange and all sorts of huge sites (although I generally prefer KaTeX (https://katex.org) since it's even faster, the SMF mod only has MathJax). And since the rendering is on the client-side, the most that could happen is that in threads where there are a whole lot of formulas, the later ones might not immediately show up as rendered formulas and instead as the LaTeX source.

Still, if you decide it's too much trouble, I'll understand. It's not a dealbreaker by any means. In the very worst case I can always attach a PNG with the rendered formulas to a post, if they are absolutely necessary for understanding what the heck I'm talking about.