Repo: GitHub  discourse/discoursemath: Official MathJax support for Discourse
Screenshot
Usage
The math plugin uses MathJax to render maths.
You can render blocks of maths by wrapping with $$
$$
E=MC^2
$$
You can render inline math by wrapping with a single $
like so: $E=MC^2$
.
Discourse math uses a heuristic to ensure that sentences such as: “I spent 20$ and another 100$” do not get MathJax treatment.
Note
This plugin only works with the latest version of Discourse with experimental markdown it enabled.
This plugin is disabled by default, after installing be sure to enable it via site settings.
Future work

We would love to support server side rendering, there is already an online sample.

We need to discuss a syntax for asciimath. Once a syntax is picked support will be very easy to add.

We are open to adding optional support for Katex.
What about the old plugin?
There is a plugin maintained by @Kasper/ @masda70 called Discourse MathJax. This plugin is a ground up rewrite to support the new markdown it engine. The main differences are:

It is much stricter about block and inline syntax, only $ and $$ blocks are supported

It embeds MathJax so you do not need to use a CDN

It only loads MathJax if it detects equations on the page.

It surgically applies MathJax as opposed to performing full page scans.

It is well specified using specs