Skip to content

Shared numbering between directives #64

Closed

Description

@TimRoith

Description / Summary

Have shared numbering for certain directives.

Value / benefit

It is very common for mathematical notes to employ shared counters for Theorems, Lemmas and Definitions, therefore it would be a great addition. It also can help structuring documents because directives that are close together in the text also have a similar counter.

Implementation details

Starting from #62 each directive has its own numbering which is useful for some situations. However, I think it is very common to have shared counters for certain directives. In LaTeX for example I usually do something like

Theorem 1
Definition 2
Remark 3
Algorithm 1
Theorem 4

where Theorem, Definition and Remark share a counter and Algorithm has its own numbering. Is it possible to have a similar mechanic for this sphinx extension?

Tasks to complete

No response

Activity

  1. added
    enhancement
    on Sep 30, 2021
  2. welcome commented on Sep 30, 2021

    @welcome

    Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

    If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

    If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

    Welcome to the EBP community! 🎉

  3. shailesh1729 commented on Mar 20, 2022

    @shailesh1729
    Contributor

    I second the use case. Another example is a corollary following a theorem. I find it odd to have theorem 15 followed by corollary 3. This happens because corollaries are fewer. Consecutive numbering for theorems and corollary is better.

  4. oremark24 commented on Apr 23, 2022

    @oremark24

    I'd like to support this feature request as well. Without ability to sync numbering of directives, the usability of the otherwise nice typesetting environment is affected a lot.

  5. Ljon4ik4 commented on Dec 18, 2025

    @Ljon4ik4
    Contributor

    I have done a rewrite of sphinx-proof for my own project, extending the above PR 64.
    The changes are rather big and I don't understand the codebase too well, so I will probably not create a PR with the bigger changes. Here is the link to the fork, in the hope that someone might find it useful.

  6. added a commit that references this issue on Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions