You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在HTML中用MathJax显示带独立编号方程组遇“Multiple \tag”错误

解决MathJax中方程组多标签“Multiple \tag”错误

错误原因

cases环境在MathJax 3中属于单个数学单元,整个结构仅允许设置一个标签,在每个方程内添加\tag会触发“Multiple \tag”错误。

解决方案

方案一:手动构造带大括号的对齐环境

用align+aligned组合实现带大括号的多标签方程组,代码如下:

$$
\begin{align}
\!\!\!\left\{ 
\begin{aligned}
a_{11}x_1+a_{12}x_2+a_{13}x_3 &= b_1 \tag{eq:1a} \\
a_{21}x_1+a_{22}x_2+a_{23}x_3 &= b_2 \tag{eq:1b} \\
a_{31}x_1+a_{32}x_2+a_{33}x_3 &= b_3 \tag{eq:1c}
\end{aligned}
\right.
\end{align}
$$
其中`\!\!\!`用于消除大括号左侧多余空白,确保排版美观。

### 方案二:使用`numcases`环境(需扩展MathJax配置)
1. 修改MathJax配置,加载`cases`扩展包:
```html
<script>
  MathJax = {
    tex: {
      inlineMath: [['$', '$'], ['\\(', '\\)']],
      tags: 'ams',
      packages: {'[+]': ['cases']}
    }
  };
</script>
<script id="MathJax-script" async
    src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
</script>
  1. 编写numcases格式的方程组,支持每个方程独立设置标签:
$$
\begin{numcases}{}
a_{11}x_1+a_{12}x_2+a_{13}x_3 = b_1 \tag{eq:1a} \\
a_{21}x_1+a_{22}x_2+a_{23}x_3 = b_2 \tag{eq:1b} \\
a_{31}x_1+a_{32}x_2+a_{33}x_3 = b_3 \tag{eq:1c}
\end{numcases}
$$

内容的提问来源于stack exchange,提问作者Reza Nugraha
相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.14 09:40:26