🇨🇳 Discourse Math 插件

AI 生成的摘要

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: 概述 Discourse Math 使用 MathJax (默认) 或者 KaTeX 来让你在你的 Discourse 中使用数学公式。
:hammer_and_wrench: 仓库链接 https://github.com/discourse/discourse-math
:open_book: Install Guide 如何在 Discourse 中安装插件

启用数学(Math)

Math 插件可以在设置中进行设置,可以通过 admin/plugins 页面来进行配置:

特性

当你把这个插件启用成功后,你可以使用符号来对要表示的数学方法进行标记 $ 例如下面的代码: $E=mc^2$.

当然你也可以使用 $$ 来进行包装,如下面的格式:

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


Discourse 数学使用的是 heuristic 模式,这样的话可以保证下面的内容不会被转换: “I spent 20$ and another 100$”。

当你使用 MathJax 的时候,你还可以启用 asciimath 来显示函数,这个时候你可以使用 % 来作为分隔符: %E=mc^2%

站点设置

  • 查看所有基于站点管理员的 “math” 设置
名字 描述
启用 discourse math 启用 Discourse Math 插件(将会对 和 的代码块进行识别)
discourse math 处理插件 默认的处理插件为: [mathjax/katex]
discourse math 鼠标放大 当把鼠标放到数学函数上的时候放大 200% (仅对 MathJax 有效)
启用辅助设置 启用辅助设置 (仅对 MathJax 有效)
discourse math 启用 asciimath 启用asciimath (将会使用 % 作为分隔符)(仅对 MathJax 有效)

如果你使用的是 Discourse 官方提供的主机服务的话,有关 Discourse Match 的插件对所有的用户都有效。官方链接为:Math | Discourse - Civilized Discussion

官方有关这个插件的讨论在地址:Discourse Math 上。

可以直接访问官方的链接,我们的这个内容也是根据官方的内容翻译过来的。

如果你对这个插件的中文翻译有困惑或者希望更改的话,请访问地址:Crowdin

你可以直接对中文翻译代码进行更改。