# Adding Maths support for Chat

**URL:** https://meta.discourse.org/t/adding-maths-support-for-chat/252018
**Category:** Feature
**Tags:** math, chat
**Created:** [January 17, 2023, 12:46pm UTC](https://meta.discourse.org/t/adding-maths-support-for-chat/252018 "2023-01-17T12:46:00Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Anton\_Akhmerov](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/anton_akhmerov/32/169548_2.png) [@Anton\_Akhmerov](https://meta.discourse.org/u/Anton_Akhmerov)
#### Post date: [January 17, 2023, 12:46pm UTC](https://meta.discourse.org/t/adding-maths-support-for-chat/252018/1 "2023-01-17T12:46:00Z")

</div>

I have a recently upgraded discourse instance (discourse 92bb728fe5, discourse-math f9cf94d2). I have configured discourse-math to use katex, but the problem appears with mathjax too. I observe that math is rendered correctly in post previews, in posts themselves, but not in chats. Below are the screenshots:

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/e/2/de2783fb591d106601e76e8fb52e7bada8375c92.png)  
 ![image](https://global.discourse-cdn.com/meta/original/4X/2/0/f/20f8eeb7b2af5cfee7f18b849e64688def445da8.png)  
 ![image](https://global.discourse-cdn.com/meta/original/4X/c/f/b/cfb2d9c4f993f08a4a239a4a2fdf9bff64de2483.png)

---

<div class="post-metadata">

### Author: ![Alexander](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexander/32/497634_2.png) [@Alexander](https://meta.discourse.org/u/Alexander)
#### Post date: [January 17, 2023, 12:50pm UTC](https://meta.discourse.org/t/adding-maths-support-for-chat/252018/2 "2023-01-17T12:50:06Z")

</div>

I may be wrong, but I think that Discourse Chat does not use the same “rendering method” as in topics and posts, I haven’t tested it well but I think it barely supports some features of Markdown

---

<div class="post-metadata">

### Author: ![Anton\_Akhmerov](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/anton_akhmerov/32/169548_2.png) [@Anton\_Akhmerov](https://meta.discourse.org/u/Anton_Akhmerov)
#### Post date: [January 17, 2023, 1:03pm UTC](https://meta.discourse.org/t/adding-maths-support-for-chat/252018/3 "2023-01-17T13:03:38Z")

</div>

This was a topic of discussion before, and judging by the responses it is a supported feature.

> [@Introducing Discourse Chat (BETA)](https://meta.discourse.org/t/introducing-discourse-chat-beta/210734/58):
>
> It seems that discourse-math is broken in chat, at least for KaTeX, and this script fixes it: play_button script

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 17, 2023, 2:46pm UTC](https://meta.discourse.org/t/adding-maths-support-for-chat/252018/5 "2023-01-17T14:46:24Z")

</div>

Moved to #Contribute > Feature request as enabling each #Customization > Plugin or #Customization > Theme component in #chat is a new feature that needs to be planned, written and tested as we don’t automatically apply all the same markdown cooking of posts.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [January 18, 2023, 11:58am UTC](https://meta.discourse.org/t/adding-maths-support-for-chat/252018/7 "2023-01-18T11:58:02Z")

</div>

I pushed support for this in chat:

[https://github.com/discourse/discourse-math/commit/6f59c4691239223d20e0723918375b0a3ac6ede0](https://github.com/discourse/discourse-math/commit/6f59c4691239223d20e0723918375b0a3ac6ede0)

This plugin would need multiple changes to avoid jumpyness, but that will have to wait.

---

<div class="post-metadata">

### Author: ![panic](https://avatars.discourse-cdn.com/v4/letter/p/3ab097/32.png) [@panic](https://meta.discourse.org/u/panic)
#### Post date: [August 10, 2024, 5:04pm UTC](https://meta.discourse.org/t/adding-maths-support-for-chat/252018/8 "2024-08-10T17:04:20Z")

</div>

It seems that it only works for MathJax. Maybe we need another patch for KaTeX?

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [August 10, 2024, 5:29pm UTC](https://meta.discourse.org/t/adding-maths-support-for-chat/252018/9 "2024-08-10T17:29:20Z")

</div>

Indeed, that should do it:

[https://github.com/discourse/discourse-math/pull/88](https://github.com/discourse/discourse-math/pull/88)

Will merge it next week.

---

<div class="post-metadata">

### Author: ![lindsey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lindsey/32/318210_2.png) [@lindsey](https://meta.discourse.org/u/lindsey)
#### Post date: [October 7, 2024, 3:30pm UTC](https://meta.discourse.org/t/adding-maths-support-for-chat/252018/10 "2024-10-07T15:30:35Z")

</div>


