Skip to content

Figure numbers don't restart  #8170

@brechtm

Description

@brechtm

Figure numbering isn't restarted when encountering a new top-level toctree directive, even when :numbered: is set on the directives and numfig = True and numfig_secnum_depth = 1.

For example, with this index.rst:

.. toctree::
   :hidden:
   :caption: General
   :numbered:

   definitions
   procedures

.. toctree::
   :hidden:
   :caption: User Manual
   :numbered:

   manual_section1
   manual_section2

If there's a figure somewhere in/under definitions.rst or procedures.rst, figure numbering in the user manual will not start at 1.

I'm not sure this is a bug per sé, but it's something that I experienced as unexpected. It's hard to say what the correct behavior would be because it's not clear in general how multiple top-level toctree directives should be interpreted/represented (see #4733 and #4977, for example).

Environment info

  • Python version: 3.6.9
  • Sphinx version: 3.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions