executablebooks / sphinx-proof

A Sphinx extension for producing proof, theorem, lemma, definition, remark, conjecture, corollary and algorithm directives.
https://sphinx-proof.readthedocs.io/en/latest/
MIT License
32 stars 17 forks source link

Shared numbering between directives #64

Open TimRoith opened 3 years ago

TimRoith commented 3 years ago

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

welcome[bot] commented 3 years ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
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! :tada:

shailesh1729 commented 2 years ago

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.

oremark24 commented 2 years ago

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.