Open
Description
Describe the bug
The following ToC
- file: intro
- part: b
numbered: 2
chapters:
- file: chapter1
- file: chapter2
- part: a
numbered: 2
chapters:
- file: chapter3
always produces the correct chapter numbering:
Welcome to your Jupyter Book
B
1. ch1
2. ch2
A
3. ch3
However, when the parts are sourced from files the chapter numbering order depends on the lexicographical ordering of the book part file names, i.e.:
- file: intro
- part:
numbered: 2
file: a
chapters:
- file: chapter1
- file: chapter2
- part:
numbered: 2
file: b
chapters:
- file: chapter3
give the correct numbering:
Welcome to your Jupyter Book
a
1. ch1
2. ch2
b
3. ch3
but
- file: intro
- part:
numbered: 2
file: b
chapters:
- file: chapter1
- file: chapter2
- part:
numbered: 2
file: a
chapters:
- file: chapter3
reorders the numbering:
Welcome to your Jupyter Book
b
2. ch1
3. ch2
a
1. ch3
To Reproduce
- Build a Jupyter Book with the following
_toc.yml
:It is important to preserve the naming of the part files, i.e.,- file: intro - part: numbered: 2 file: b chapters: - file: chapter1 - file: chapter2 - part: numbered: 2 file: a chapters: - file: chapter3
a.md
andb.md
- The chapter numbering sequence is determined by the lexicographical ordering of the book part file names
Expected behavior
The chapter numbering should be consistent with the order given in the _toc.yml
file.
Environment
- Python Version [e.g. 3.7.1]: 3.8.2
- Package versions or output of
jupyter-book --version
: 0.1.2 (6683e3f) - Operating System: MacOS 10.15.6
Additional context
Jupyter Book: 0.9.1
MyST-NB: 0.10.1
Sphinx Book Theme: 0.0.39
MyST-Parser: 0.12.10
Jupyter-Cache: 0.4.1
NbClient: 0.5.1
Jupyter Book installed from the latest master branch commit (jupyter-book/jupyter-book@3845dd5)