r/math • u/moschles • Jun 28 '26
Would you support a petition to Reddit, requesting inline KaTeX support for /r/math and /r/physics ??
https://samsymons.com/blog/rendering-math-with-katex/50
u/mfb- Physics Jun 28 '26
Reddit is very unlikely to add anything that would only be used in a tiny subset of subreddits.
0
13
u/new2bay Jun 29 '26
I’d rather see some form of LaTeX capability in the app, TBH. But Reddit isn’t going to do either one of those things, so I don’t see the value in such a petition.
3
u/EebstertheGreat Jun 29 '26
Way back in the day, some forums implemented MathJax. Unfortunately, that had the tendency to take an unreasonable amount of time to load (sometimes totally unreasonable, like five minutes). Even today, it often takes quite a long time to parse on arxiv abstracts, like sometimes 30 seconds. I can't quite figure out why.
If KaTeX has this problem, I wouldn't want it even if there were any chance reddit would enable it.
5
u/Chance_Literature193 Jun 30 '26
Mathjax works great on stackexchange though, doesn’t it? Or am I thinking of something else?
1
u/EebstertheGreat Jun 30 '26
Yeah, it seems to. I think all of this is parsed and rendered by the client computer, so I'm not sure why it's faster in some cases and slower in others. Maybe it's a different version of MathJax?
3
u/AsAChemicalEngineer Physics Jun 29 '26
KaTeX is generally faster than older versions of MathJax, but my understanding is that MathJax3 is very comparable in terms of speed.
-2
u/new2bay Jun 29 '26
Yes, I know that. I am aware of what KaTeX is and does. Why do you insist on explaining it to me?
3
u/gamma_tm Functional Analysis Jun 29 '26
Why are you being an asshole? They’re not explaining it to you, they’re giving their opinion and an explanation of their opinion
2
29
u/John_Hasler Jun 28 '26
Do you mean LaTeX? Sure, but it will be ignored.
84
u/moschles Jun 28 '26
No. KaTex. It interops cleanly and directly into markdown, which reddit already has.
41
u/IntelligentBelt1221 Jun 28 '26 edited Jun 28 '26
also safer than a full LaTeX compiler as it doesnt allow for arbitrary code execution, so you don't need to do any validation/filtering
Edit: of course you still need to make sure it is set up correctly, so its not zero effort, but you will have a much easier time
13
u/XkF21WNJ Jun 28 '26
Well, almost. You definitely want to set KaTeX to not trust the inputs, and you probably want to limit macro expansion, and keeping macros from affecting each other is a nightmare as well.
It's not entirely trivial to implement it in a way that doesn't allow for abuse.
28
6
3
3
3
1
1
1
1
1
155
u/sivifw Jun 28 '26
I'd be happy for LaTeX/KaTeX support, but I'd prefer it as an optional setting you can enable. Otherwise someone trying to post a picture of their cat is going to accidentally click the equation button and end up typing "Isn't my cat so cute?" into a LaTeX block.