# Discourse Math

**URL:** https://meta.discourse.org/t/discourse-math/65770
**Category:** Plugin
**Tags:** official, math, included-in-core
**Created:** [July 6, 2017, 9:27pm UTC](https://meta.discourse.org/t/discourse-math/65770 "2017-07-06T21:27:02Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [July 6, 2017, 9:27pm UTC](https://meta.discourse.org/t/discourse-math/65770/1 "2017-07-06T21:27:02Z")

</div>

| | | |
| --- | --- | --- |
| :discourse2: | **Summary** | **Discourse Math** uses [MathJax](https://www.mathjax.org/) (default) or [KaTeX](https://katex.org/) to render maths in your Discourse forum. |
| 📖 | **Install Guide** | **This plugin is bundled with Discourse core**. There is no need to install the plugin separately. |

> [@](#):
>
> :discourse2: As this is an #official plugin maintained by the Discourse team, #Support, #Contribute > Bug, #Contribute > UX, and #Contribute > Feature requests can be made in the respective categories here on Meta, and tagged with the appropriate plugin tag. Click on a link below to get one started. 👍
> 
> [❓&nbsp; **Support**](https://meta.discourse.org/new-topic?category_id=6&body=%3E%20Before%20asking,%20did%20you%20search%20first%3F%20Press%20%F0%9F%94%8D%20at%20the%20upper%20right%20to%20search.&tags=math "Ask for support on configuring and using Discourse Math") [🐛&nbsp; **Bug**](https://meta.discourse.org/new-topic?category_id=1&tags=math "A bug report means something is broken, preventing normal/typical use of the plugin") [👀&nbsp; **UX**](https://meta.discourse.org/new-topic?category_id=9&tags=math "Discussion about the user interface of Discourse Math, and how features are presented (including language and UI elements)") [💡&nbsp; **Feature**](https://meta.discourse.org/new-topic?category_id=2&tags=math "Discussion about how existing Discourse Math features can be improved or enhanced, and how proposed new features could work")

### Enabling Math

The Math plugin can be enabled from its settings, accessed from your `admin/plugins` page:

![Math settings](https://global.discourse-cdn.com/meta/original/4X/0/7/8/0783e5858f4219b6624393a8e9ffad5ecdfec133.png)

### Features

Once enabled, you can render inline math by wrapping with a single `$` like so: `$E=mc^2$`.

You can render blocks of math by wrapping with `$$`

```plaintext
$$
\sqrt{(-1)} \; 2^3 \; \sum \; \pi
$$

```

 ![I am the math plugin](https://global.discourse-cdn.com/meta/original/4X/a/f/8/af8a522f78267c2d96eb7b3366c65e6a95fb55f5.png)

Discourse Math uses a heuristic to ensure that sentences such as: “I spent 20$ and another 100$” do not get converted.

#### LaTeX Delimiters

When enabled via site settings, you can also use standard LaTeX delimiters:

- **Inline:** `\(...\)` - Example: `\(E=mc^2\)`
- **Block:** `\[...\]` - Example:

```plaintext
\[
\frac{1}{2}
\]

```

#### AsciiMath (MathJax only)

When using MathJax, you can enable [asciimath](http://asciimath.org/) processing which uses `%` as a delimiter: `%E=mc^2%`

### Composer Integration

The composer includes an **Insert Math** button in the toolbar with keyboard shortcut Shift+M. This opens a modal where you can:

- Toggle between inline and block mode
- Write your LaTeX expression
- Preview and insert into your post

In the rich text editor, math expressions appear as editable nodes with an edit button to modify the expression.

### Chat Support

Math expressions are also rendered in Discourse Chat messages using the same settings and rendering engine.

### Rendering Engines

#### MathJax (Default)

- **Version:** 4.1
- **Output formats:** HTML (default) or SVG
- **Features:**
  - Contextual menu (right-click on math)
  - Accessibility enrichment for screen readers
  - Zoom on alt-click (175% zoom)
  - AsciiMath support

#### KaTeX (Alternative)

- **Features:**
  - Fast rendering
  - [Mhchem extension](https://mhchem.github.io/MathJax-mhchem/) for chemical equations
  - [CopyTex extension](https://github.com/KaTeX/KaTeX/tree/main/contrib/copy-tex) - click math to copy LaTeX source to clipboard
  - Cross-reference support with `\label`, `\ref`, and `\eqref` macros

### Site Settings

See all relevant site settings by searching your admin settings for “math”.

| Name | Description |
| --- | --- |
| discourse math enabled | Enable Discourse Math plugin (adds special processing to $ and $$ blocks) |
| discourse math provider | Math rendering provider: `mathjax` (default) or `katex` |
| discourse math enable latex delimiters | Enable LaTeX-style delimiters: `\(...\)` for inline and `\[...\]` for block math |
| discourse math mathjax output | MathJax output format: `html` (default) or `svg` (MathJax only) |
| discourse math enable menu | Enable contextual menu for math expressions (MathJax only) |
| discourse math enable accessibility | Enable accessibility features like text enrichment (MathJax with menu only) |
| discourse math zoom on click | Zoom 175% on alt-click interaction (MathJax with menu only) |
| discourse math enable asciimath | Enable asciimath processing with `%` delimiter (MathJax only) |

> :discourse2: Hosted by us? This plugin is available on all of our hosting tiers [Math | Discourse - Civilized Discussion](https://www.discourse.org/plugins/math.html)

> Last edited by @sam 2026-01-16T05:05:47Z
> 
> > **Check document**
> >
> > Perform check on document:

---

_[View the full topic](https://meta.discourse.org/t/discourse-math/65770)._
