Discourse Math

:discourse2: Summary Discourse Math uses MathJax (default) or KaTeX to render maths in your Discourse forum.
:open_book: Install Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately.

Enabling Math

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

Math settings

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 $$

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

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:
    \[
    \frac{1}{2}
    \]
    

AsciiMath (MathJax only)

When using MathJax, you can enable asciimath 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 for chemical equations
    • CopyTex extension - 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

Last edited by @sam 2026-01-16T05:05:47Z

Check documentPerform check on document:
70개의 좋아요

게시물 2개가 새 주제로 분리되었습니다: Add support for email formatting of mathjax

게시글 2개가 새 주제로 분리되었습니다: Can Mathjax be upgraded to Version 3?

6개의 게시물이 새로운 주제로 분리되었습니다: 수식을 위한 Latex 스타일 블록 및 인라인 지원 추가

게시물이 새 주제로 분리되었습니다: Equations do not render properly in blocks

게시물이 새 주제로 분리되었습니다: Math not rendering in Preview

15개의 게시물이 새 주제로 분리되었습니다: 수학과 AI 우회 방법

26개의 게시물이 새 주제로 분리되었습니다: Mathjax를 4버전으로 업그레이드하기

Discourse Math에서 새로운 MathJax(v4.1) 통합으로 전환한 후, 실용적인(긍정적인) 코멘트를 하나 남깁니다.

알고리즘의 품질을 높이는 개선 사항 중 하나는 MathJax가 입력이 잘못된 경우나 매크로가 정의되지 않은 경우 매우 구체적이고 현지화된 피드백을 제공한다는 점입니다.

  • 여전히 주변 유효한 구조를 올바르게 렌더링합니다(예: \frac{...}{...}, 괄호 등).
  • 그러나 인식되지 않은 명령어를 그대로(예: \sinc를 텍스트로 표시) 표시하여, 전체 수식이 실패하거나 혼란스러운 부분 오류를 생성하지 않습니다.

실제로 이는 이미 올바른 부분을 가리지 않고 무엇이 수정되어야 하는지 즉시 명확하게 파악할 수 있게 해주며, 이는 교육 환경이나 수학 중심의 게시물을 반복적으로 작성할 때 특히 유용합니다.

예를 들어, \sinc가 정의되어 있다는 데 의존하기보다, 다음과 같이 명시적으로 연산자로 작성하는 것이 더 견고한 접근 방식입니다:

\frac{\Delta}{T}\operatorname{sinc}\!\left(\frac{\omega_r\Delta}{2}\right)

여기서:

\operatorname{sinc}(x)=\frac{\sin x}{x}

전체적으로 이러한 "렌더링할 수 있는 것은 렌더링하고, 나머지는 명확하게 표시한다"는 동작 방식은 이전의 덜 투명한 실패 모드에 비해 사용자 경험 측면에서 큰 개선이라고 생각합니다. MathJax 업그레이드 작업에 참여해 주신 모든 분들께 감사드립니다.

3개의 좋아요

구글을 통해 이곳에 오신 분들을 위해 경고드리고 싶은데, 이 플러그인은 무료 호스팅 플랜에서는 사용할 수 없습니다. :expressionless_face:

안녕하세요,您的 frustration를 이해합니다. 그렇게 느끼신 점 죄송합니다. 앞으로는 플랜별 플러그인 디렉토리를 여기에서 확인해 보실 수 있습니다.

수학 플러그인은 이 페이지에서 프로/비즈니스/엔터프라이즈 플러그인으로 나열되어 있지 않습니다. 따라서 무료 플랜에서도 사용 가능하다고 가정할 수 있습니다. 무료로 제공해야 한다고 주장하는 것은 아닙니다. 다만, 이 부분이 좀 더 명확하게 설명되어야 한다고 생각합니다.

1개의 좋아요

네. Discourse pricing | Discourse - Civilized Discussion 페이지에서는 모든 플랜과 한도 사항, 그리고 허용되는 플러그인을 빠르게 확인할 수 있는 플러그인 목록까지 모두 확인할 수 있습니다.

1개의 좋아요

새로운 도구인 RaTeX를 발견했습니다.
Rust로 작성되었으며 KaTeX와 100% 호환됩니다.

GitHub - erweixin/RaTeX: >99.5% KaTeX syntax coverage. LaTeX math renderer in pure Rust. No JavaScript, no WebView, no DOM. One Rust core → iOS, Android, Flutter, Web, PNG. C ABI · WASM · Server-side PNG/SVG. · GitHub

좋은 대안이 될 수 있을 것 같습니다.

흥미로운 문제를 하나 발견했습니다.

물리 문제를 계산하던 중 \dot, \ddot은 정상적으로 작동하지만 \dddot은 존재하지 않다는 것을 알게 되었습니다. 이 함수에 \dddot이 포함된 경우, 그 뒤에 오는 수식들이 모두 작동하지 않습니다.

1개의 좋아요

@xiasummer $\dddot{r}$와

\dddot{r}.

을 시도해 보겠습니다. 여기서는 잘 동작하는 것 같습니다. 제 사이트에서 MathJax와 KaTeX를 모두 사용하여 테스트해 보았습니다.

2개의 좋아요

해결했습니다! discourse 시스템을 업데이트했습니다. discourse-math 플러그인 0.9를 사용 중이었으나, 이제 플러그인을 정리하고(일단 수식은 플러그인이 아닌 형태로) 시스템을 다시 빌드했습니다. 이제 $\dddot r$가 정상적으로 작동합니다.

2개의 좋아요