Leo
Leo

Reputation: 509

How to number the equations in Sphinx consecutively (Different rst files)

I have different chapters (e.g. Different rst files). I want to number my equations consecutively. For example in the first chapter the first equation is:

.. math:: 
  :name: eq.1

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

It appears like:

enter image description here

I have 4 more equations in the first chapter. The second chapter which is a new rst file starts with an equation as:

.. math::
  :name: eq.6

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

I want the number of the above equation to be 6 but it starts again from 1 as shown here:

enter image description here

How can I do the equation numbering consecutively with respect to the previous chapters?

Upvotes: 0

Views: 562

Answers (1)

mzjn
mzjn

Reputation: 51012

The numbering works if the numfig and math_numfig configuration options are enabled (true).

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

Upvotes: 1

Related Questions