תוסף Discourse Math

סיכום מבוסס בינה מלאכותית

honeymoose introduced the Discourse Math plugin, which enables mathematical formula rendering in Discourse using MathJax (default) or KaTeX. The plugin is officially supported and hosted at https://github.com/discourse/discourse-math. Installation instructions are available at meta.discourse.org. Once enabled via admin/plugins, users can write inline math with $...$ (e.g., $E=mc^2$) or block math with $$...$$. The plugin uses heuristic parsing to avoid misinterpreting dollar signs in regular text (e.g., “I spent 20$”). With MathJax, users can also enable asciimath using %...% delimiters. Site settings include options to toggle the plugin, choose the renderer (MathJax/KaTeX), enable mouse zoom (200% on hover, MathJax only), accessibility features, and asciimath support. For Discourse-hosted sites, this plugin is pre-enabled. honeymoose also shared the official discussion thread at meta.discourse.org/t/discourse-math/65770 and invited community contributions to improve the Chinese translation via Crowdin at crowdin.com/translate/….

|||
-|-|-|
:information_source: | Overview | Discourse Math uses MathJax (default) or KaTeX to let you use math formulas in your Discourse.
:hammer_and_wrench: | Repo Link | https://github.com/discourse/discourse-math
:open_book: | Install Guide | How to install plugins in Discourse

Enabling Math

The Math plugin can be configured in the settings, accessible via the admin/plugins page:

Features

Once you have successfully enabled this plugin, you can use $ symbols to delimit the math expressions you want to render, like in the following example: $E=mc^2$.

You can also use $$ delimiters for block mode math, like this:

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


Discourse Math uses a heuristic method to ensure that the following content is not converted: “I spent 20$ and another 100$”.

When using MathJax, you can also enable asciimath to render formulas, using % as the delimiter: %E=mc^2%

Site Settings

  • See all site admin “math” settings
Name Description
Enable Discourse Math Enable the Discourse Math plugin (will recognize $ and $$ code blocks)
Discourse Math Renderer Default renderer is: [mathjax/katex]
Discourse Math Zoom Zoom in 200% when hovering over math formulas (MathJax only)
Enable Accessibility Enhancements Enable accessibility enhancements (MathJax only)
Enable Discourse Math Asciimath Enable asciimath (will use % as delimiter) (MathJax only)

If you are using Discourse’s official hosting service, the Discourse Match plugin is available for all users. Official link: Math | Discourse - Civilized Discussion

The official discussion about this plugin is at: Discourse Math.

You can directly access the official link. Our content is also translated from the official content.

If you have any confusion about the Chinese translation of this plugin or wish to change it, please visit: Crowdin

You can directly change the Chinese translation code.