-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom section numbering (Letters, numbers) #6614
Comments
+1 Reasonable. But I don't know best way to represent it in reST document. I feel |
hey @yves-chevallier +1 for this feature. I am looking at ways to support Do you see a project being organised with I was thinking something along the lines of the frontmatter in a .. toctree::
:frontmatter:
preface and then standard
and then
an alternative idea is also documented here but it is a bit more clumsy having a single @tk0miya love your work on Sphinx. Thank you! |
@mmcky I had exactly the same request for my project (https://github.com/heig-tin-info/handout) and I wrote a small extension available here: https://github.com/heig-tin-info/handout/blob/master/extensions/appendix.py |
thanks @yves-chevallier |
I prefer the idea to add a new directive |
thanks @tk0miya -- I think a specialised
As a general rule |
Traditionally in a book, you have the In Sphinx, usually all TOCs in the In LaTeX as sphinx doesn't generate the table of content, all TOCs are gathered under the same table of content which is acceptable in my case. |
thanks @yves-chevallier I have seen that style commonly used also. I guess this highlights the need for flexibility so authors can choose a style for I am currently doing some work with the executable books project looking at closer harmony between |
56: Add support for appendices r=pietroalbini a=pietroalbini Sphinx itself [lacks support for appendices](sphinx-doc/sphinx#6614), which resulted in our appendices being names something like "2. Appendix B: Glossary" rather than "B. Glossary". To solve the problem, this PR adds a custom extension that, right after section numbers are assigned, goes through all appendices and replaces the section numbers. Co-authored-by: Pietro Albini <pietro.albini@ferrous-systems.com>
Any progress for this, or some solutions to have |
I have written this Stackoverflow question which also explain this feature request.
Goal
The goal is to customise the toctree numbering method. So use
i., ii, ...
for frontmatter,1, 2, 3.1.2
for the content andA., A1, A1.1, B1.2
for the appendix.By looking at the code, it seems it is easy to add a kludge on the
_walk_toc
method located in theTocTreeCollector
class. However I don't see how I can easily extend this class.The goal would be to add
.. toctree::
directives the options:numbering-format: letters
Considerations
Before I try to implement this feature, I would like to get some feedback. Perhaps it is already possible to do this in a different manner.
The text was updated successfully, but these errors were encountered: