Discourse Math

:discourse2: Summary Discourse Math uses MathJax (default) or KaTeX to render maths in your Discourse forum.
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-math
:open_book: Install Guide How to install plugins in Discourse

Features

You can render blocks of maths by wrapping with $$

$$
\hat{H}\Psi=E\Psi
$$

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 converted.

When using MathJax, you can also enable asciimath processing which uses % as a delimiter: %E=mc^2%

Configuration

:warning: This plugin is disabled by default, after installing be sure to enable it via site settings.

CHANGELOG

TODO

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

Extras

What about the old plugin?

There is a plugin maintained by @Kasper/ @masda70 called Discourse MathJax. This plugin is a ground up re-write 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 or KaTeX renderer so you do not need to use a CDN

  • It only loads the math renderer if it detects equations on the page.

  • It surgically applies renderer as opposed to performing full page scans.

  • It is well specified using specs

60 Likes

3 posts were split to a new topic: Is it possible to include TikZ package?

5 posts were split to a new topic: Is there a way to relieve the pressure on the browser with many mathjax equations?