Skip to content

Make it possible to disable numfig for certain elements #10316

@choldgraf

Description

@choldgraf

Is your feature request related to a problem? Please describe.

Numfig is a useful way to automatically add numbering to many kinds of elements. However, by default it automatically adds numbers to many different kinds of elements, not just Figures. There are many cases where you'd want to number one element (e.g. Figures) but not other elements (e.g., code blocks). It is not currently possible to do this.

Describe the solution you'd like

I'd like to be able to configure numfig to disable automatic numbering for certain directives. For example, something like:

# Only apply numfig numbering to figures and tables
numfig_enabled_classes = ["figure", "table"]

Describe alternatives you've considered

Alternatively you could just "live with" the numbering for all these different types of directives But this creates some awkward patterns (e.g. it adds Listing N before each code block caption, which doesn't make sense if you're following the common pattern of using the caption block to show the file name for a code snippet).

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:enhancementenhance or introduce a new feature

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions