如何连续编号 Sphinx 中的方程(不同的 rst 文件)

时间:2021-06-08 05:31:33

标签: python-sphinx equation

我有不同的章节(例如不同的 rst 文件)。我想连续给我的方程编号。例如第一章的第一个方程是:

.. math:: 
  :name: eq.1

   W=W(I_1 (C)),I_2 (C)),I_3 (C)))

看起来像:

enter image description here

我在第一章还有 4 个等式。第二章是一个新的 rst 文件,以等式开头:

.. math::
  :name: eq.6

   F=\begin{bmatrix} \lambda_1 & 0 & 0\\0 & \lambda_2 & 0\\0 & 0 & \lambda_3\end{bmatrix}

我希望上述等式的数字为 6,但它又从 1 开始,如下所示:

enter image description here

关于前面的章节,我怎样才能对等式进行连续编号?

1 个答案:

答案 0 :(得分:1)

如果启用了 numfigmath_numfig 配置选项 (true),则编号有效。

https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-math_numfig