76

It would be really nice to be able to use MathJaX (math formulas) in chat. Not specially for formulae, but for things like $V_{CC}$ in electronics chat would be very useful.

7
  • 1
    Perhaps as an option to enable. You wouldn't want to have MathJax enabled everywhere. I think it's a big burden on the server.
    – M. Tibbits
    Commented Jul 9, 2011 at 0:33
  • 2
    Note the response by Jeff Atwood to this question.
    – M. Tibbits
    Commented Jul 9, 2011 at 2:15
  • 2
    You're asking for this to be specifically enabled on mathematics-related chatrooms, right? Not across all the chatrooms? Because it's a huge dependency, and it's utterly pointless in 95% of cases (although I can see how in that 5% it's absolutely invaluable). Commented Jul 9, 2011 at 8:08
  • 2
    @Cody Yes, math/engineering related only - it would be fairly pointless and a waste of resources on others. Having it configurable on a per-room or per site basis would be good.
    – Majenko
    Commented Jul 9, 2011 at 10:19
  • Though it would be useful for programming-related chats too. In particular it's hard to explain physical concepts (say, for game engines on GameDev's chat) without some formulas. Though for now I just screen shot TeX output and upload the results there, this works nearly as fast. Commented Sep 20, 2011 at 13:43
  • 8
    I really think that the lack of mathjax (or equivalent) support in chats created from extended comment discussions on stackexchange sites which enable that in their comments (such as maths, physics, astronomy) is decremental to the purpose of these sites. Some discussions require mathjax mark-up (or equivalnet). I would even go as far as to suggest to stop moving discussions with heavy mathjax usage to a chat room.
    – Walter
    Commented Sep 9, 2014 at 8:30
  • 2
    For mobile devices Commented Jan 4, 2019 at 12:38

5 Answers 5

40

As a workaround while this request is pending, there exist several client-side workarounds that can be used to enable LaTeX rendering in chat, including:

  • ChatJax, a set of bookmarklets by robjohn to enable dynamic MathJax support in chat. Commonly used in the Mathematics chat room.

  • Google Chrome Chat MathJax Extension: exactly what it says on the tin. Does more or less the same thing as ChatJax, but packaged as a Google Chrome extension.

  • ChatJax++, a Greasemonkey (Firefox) / Tampermonkey (Chrome) user script. Features individual rendering of new chat messages as they arrive, which should hopefully make it a bit faster and more CPU-friendly than the bookmarklet. Still lacks some planned features, but basic functionality is present. Supports site-specific MathJax features, such as mhchem in the Chemistry and Biology chat rooms.

  • A script version of ChatJax for Greasemonkey (Firefox) / Tampermonkey (Chrome), which automatically enables MathJax rendering in all chat rooms. It has no external dependencies, so people who don't want to use SOUP for some reason might find this useful.

This is a Community Wiki answer, so if you know of other scripts or extensions that do the same, feel free to add them here.

8
  • 1
    A userscript or extension for other browsers would be greatly appreciated.
    – Raphael
    Commented Nov 28, 2014 at 11:39
  • 1
    @Raphael: Actually, that's exactly what I'd been working on. I've added a link to the script above, even though it still lacks some features I'd planned. Commented Jul 28, 2015 at 14:20
  • I missed that notification; great, thanks!
    – Raphael
    Commented Sep 19, 2015 at 16:38
  • I loaded the Chrome MathJax extension linked here, but couldn't get it to work. The Chrome extension site says it has been added to Chrome. Maybe I need to trigger it somehow. I don't know what a bookmarklet is. Commented Nov 12, 2016 at 4:44
  • Installed Chatjax (script) in PaleMoon, does not work.
    – Anixx
    Commented Feb 11, 2021 at 21:10
  • ChatJax++ works
    – Anixx
    Commented Feb 11, 2021 at 21:12
  • @IlmariKaronen Can you give inputs here ? Chatjax++ is not working on Greasemonkey. Am I missing something?
    – Wolgwang
    Commented Jan 27, 2022 at 10:21
  • 2
    @Wolgwang: The current version of ChatJax++ (0.3.0) is not compatible with the API changes in Greasemonkey 4. I'll see if I can make it work; it shouldn't be a major change, but I'd rather do it without breaking compatibility with other user script managers like Tampermonkey that still use the old API if I can. (I guess in the worst case I can just make two versions of the script…) Commented Jan 27, 2022 at 12:53
15
+25

Perhaps we could get it only in rooms for sites that have Mathjax enabled. It's most likely to be used and needed in those rooms.

10

One option that could be implemented is client-side latex support, see here.

1
  • Mmmm... Client side - one option I hadn't thought of. I guess this could be ported (or used as a starting point) to the SE chat system... Maybe someone on stackapps would like to take this on...
    – Majenko
    Commented Jul 19, 2011 at 11:41
10

From Jeff's related answer:

This is implemented on http://math.stackexchange.com -- you can check it out there. It will never be on Stack Overflow, though, as it is an extremely heavy dependency.

MathJax is a client-side solution, but it uses a relatively large amount of bandwidth/time to load when the page is loading; I think Jeff is concerned about how this would affect the user experience.

I would prefer it be best as a per-room-per-user setting, so that users who can spare the loading time and would benefit from it can opt-in. Maybe when you hover a message using math notation it could have a button to enable math.

3
  • 7
    It should probably be enabled by default in rooms created by the system from long comment threads (on sites that support use MathJax).
    – Raphael
    Commented May 23, 2012 at 20:46
  • I believe this would be the best solution. Anyone knowing if this is being worked on? Commented Feb 13, 2014 at 16:50
  • 1
    FWIW, chat rooms load awfully slow already, in particular much, much slower than regular SE page (which load MathJax). I can't imagine that the mere loading of MathJax (which is likely to be cached for users of such rooms, anyway) adds a noticable increase in load time.
    – Raphael
    Commented Nov 28, 2014 at 11:37
3

This request was discussed by the team on April 9th, 2014. The potential rendering cost would be such that it would need to be a per-room and per-user option; this would then create a situation where users would potentially never be sure how their messages would look to other readers - in other words, little better than the user-script solution currently available.

6
  • 9
    ...huh? MathJax isn't optional on sites where it's enabled. Why does it need to be an option user-side in chat?
    – user206222
    Commented Jul 27, 2015 at 20:12
  • 4
    Other users can't remotely force your browser to re-render the page you're looking at on the main site, @Emrakul.
    – Shog9
    Commented Jul 27, 2015 at 20:13
  • 2
    Chat is heavy and slow as it is; I can't imagine that the occasional rendering of a formula can make it much worse, and it could be opt-in. I follow the reasoning brought forth here: you don't want discussion on the site, and you don't enable (meaningful) discussion in chat for some sites. So what are we to do? Since this affects 29 sites and counting, some of them quite large and active, this is not a marginal issue.
    – Raphael
    Commented Sep 19, 2015 at 16:48
  • 7
    "little better than the user-script solution currently available" -- how so? Even if the feature is opt-in, I can expect every newcomer to click a button to enable MathJax. I can not assume that they are willing and able to install a browser plugin and a user script. (Do they even have a compatible browser?) A built-in solution would be a lot better in this regard; while I don't know that the other user does render, I know they can.
    – Raphael
    Commented Sep 19, 2015 at 16:50
  • 11
    I summary, I think this decision is wrong and probably based on wrong assumptions (e.g. tech-savy target group). Please reconsider.
    – Raphael
    Commented Sep 19, 2015 at 16:51
  • 2
    At the moment it is precisely what happens - you cannot be sure how your chats render, as it depends on various bookmarklets and other highly browser-dependent things. Zulip (zulipchat.com) enables mathjax globally, noone complains it is slow... Commented May 15, 2021 at 9:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .