Change numbering styles in different parts
See original GitHub issueDescribe the problem/need and solution
Sphinx allows you to add numbers to chapters via the :numbered:
flag in a TOCtree. In addition, sphinx-multitoc-numbering
allows you to continue numbering across parts.
However, many books have an appendix that should both restart numbering and use a different numbering style. A common example of this is:
Introduction
1. First chapter
2. Second chapter
3. Third chapter
A. Appendix 1
B. Appendix 2
It would be useful if people could do two things:
- Re-start numbering for some parts of their book
- Choose a different numbering style
Guide for implementation
There’s a Sphinx issue that already exists about this: https://github.com/sphinx-doc/sphinx/issues/6614
But perhaps we could implement something via sphinx-multitoc-numbering
, for example supporting some extra toctree
metadata like:
```{toctree}
:numbered:
:numbered_group:
```
Along with a config like numbered_group_styles = {"group1": "123", "group2": "ABC"}
.
I wonder if @mmcky has thought about that possibility?
Tasks and updates
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Define new bullets, numbers, and multilevel lists
To change the style, click the down arrow next to Number style and choose numbers, letters, or another chronological format. Specify a level...
Read more >Q. How do I number pages differently in the various sections of ...
Open the "Format Page Numbers" window by going to the Header & Footer Tools – Design tab on the menu, and in the...
Read more >How do you change bullet/numbered list format of only certain ...
You apply the numbering by applying the styles, not by using the numbering controls in the ribbon. Note that this dialog shows numbering...
Read more >How to create numbered headings or outline numbering in ...
Right-click the thumbnail for the Headings list style and choose Modify. Format > Numbering (Figure 8). You can how change any or all...
Read more >Customizing numbered lists - Microsoft Word 2016
Word displays the number formatting you've chosen in the Enter Formatting For Number text box. Type any changes for the text of the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks to https://github.com/executablebooks/MyST-Parser/issues/188 I found a workaround that allows me to build a latex/pdf article with appendix numbered A:
I’d like to do this with a
raw
directive and skip the role definition, but for some reason that doesn’t work.This week I managed to render a pandoc-Markdown into DOCX and PDF that look really good. For the PDF I even got partially numbered headings working: https://boisgera.github.io/pandoc/markdown/#heading-identifiers
Maybe one can adopt their approach?
Are there examples (tests?) where
_toc.yml
is bypassed? I looked into the code and it seems to be mostly a big codebase parsing the YAML and making a dict of objects from it. I’d much rather create those TocTree objects myself, interacting with their API directly and having access to attributes that are not supported in the_toc.yml
“schema”. (Such as the numbered/unnumbered thing.)