# 将 Mathjax 升级到 4 版本

**URL:** <https://meta.discourse.org/t/upgrading-mathjax-to-version-4/392669>\
**Category:** Development\
**Tags:** math\
**Created:** [2025年十一月23日 17:57 UTC](https://meta.discourse.org/t/upgrading-mathjax-to-version-4/392669 "2025-11-23T17:57:05Z")\
**Posts on this page:** 1\
**Showing post:** 33

<div class="post-metadata">

**Author:** ![Ethsim2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ethsim2/32/522255_2.png) [@Ethsim2](https://meta.discourse.org/u/Ethsim2)\
**Post date:** [2026年一月13日 10:32 UTC](https://meta.discourse.org/t/upgrading-mathjax-to-version-4/392669/33 "2026-01-13T10:32:42Z")

</div>

在使用 `$$...$$` 内部使用 `\begin{align}...\end{align}` 时，我看到了 MathJax 的“公式结构嵌套错误”（Erroneous nesting of equation structures）。这似乎是 MathJax 在 v4 升级工作中更严格地执行了“不要嵌套公式环境”的规则。

在实践中，可靠的 Discourse 模式是在 `$$` 包装器内部使用 `aligned`：

```latex
$$\n{\large\n\begin{aligned}\na \u0026= b \\\\\n \u0026= c\n\\end{aligned}\n}\n$$

```

这避免了将一个显示公式结构（align）嵌套在另一个显示包装器（`$$...$$`）内部，而这正是触发错误的原因。

---

_[View the full topic](https://meta.discourse.org/t/upgrading-mathjax-to-version-4/392669)._
