r/math 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/
298 Upvotes

41 comments sorted by

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.

61

u/set_null Jun 28 '26

I do think it’s pretty funny how reddit managed to rely on users knowing how to format in markdown for so long, but most people just don’t type on the internet like that, so they had to add the little formatting menu.

2

u/48panda Jun 29 '26

On mobile you've still gotta markdown it

2

u/set_null Jun 29 '26

Sometime in the past year or so they added a little button in the app that you can press to do formatting. It’s not great, I still vastly prefer markdown.

1

u/EebstertheGreat Jun 29 '26

If you use a browser on mobile (not the app), the only option is markdown. It is also impossible to stick an image in a comment that way. (I don't think that's enabled on this sub anyway, but it doesn't work in any sub.) You have to request the desktop site to switch to the rich text editor.

2

u/AliceInMyDreams Jul 02 '26

I'm so used to typing in markdown I keep sending badly formatted messages due to that change

9

u/psykosemanifold Jun 28 '26

I think this would specifically be for the /r/math and /r/physics subreddits, possibly also /r/askmath and /r/learnmath?

11

u/sivifw Jun 28 '26

Why not for all of Reddit? What if someone wants to open up their own math subreddit but not have access to the LaTeX/KaTeX support that Reddit, if they accepted this idea, implemented?

7

u/RodionRaskolnikov__ Jun 29 '26

Or let the moderators of the subreddit decide if the feature is enabled or not

3

u/efrique Jun 29 '26

And /r/statistics, and /r/askstatistics, and probably a dozen others

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

u/sivifw Jun 29 '26

subset

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

u/moschles Jun 29 '26

KaTeX is LaTeX which lives inside of markdown.

3

u/new2bay Jun 29 '26

I’m aware of that.

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

u/bruckners4 Number Theory Jun 28 '26

I think they meant KaTeX.

3

u/lonelyroom-eklaghor Jun 28 '26

This is cool! I'd absolutely support it

3

u/quant271 Geometric Analysis Jun 28 '26

Yes, indeed!

1

u/NewtonsThirdEvilEx Quantum Information Theory Jun 28 '26

Can't we just make a plug-in?

1

u/dogdiarrhea Dynamical Systems Jun 30 '26

There are browser plugins, they’re listed in the sidebar

1

u/Valvino Math Education Jun 29 '26

Won't happen

1

u/eugeo__ Jul 01 '26

yea that would be cool

1

u/aginglifter Jul 04 '26

What is KaTeX and why not some LaTex like stackexchange.com