How do I do chapter numbering without numbering the index page? #2308
-
|
The UC Berkeley Data 8 Textbook uses Jupyter Book 1 to deliver its content. The root page was not required to be in the table of contents displayed on the LHS. While upgrading to Jupyter Book 2, I noticed that the chapter numbering is off by +1. Jupyter Book 2 requires that the first entry of We need the numbering to be consistent with the previous delivery of the textbook. We have 10 years of publicly available course materials that link to the textbook's original numbering. I am requesting that there be a way to have more control over TOC numbering. For example, being able to choose if numbering starts at 0 or 1. If the root page must be shown in the TOC, we'd like it to be numbered with 0 instead of 1. Other workarounds that have to do with the restrictions on the first TOC entry (either having children or being able to hide the first entry) may also meet our needs. Appreciate any and all help on this. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
On the intro page you can turn on/off title numbering as well as set the https://mystmd.org/guide/cross-references#title-numbering For your case, on the index page remove the title numbering: ---
numbering:
title: false
---
Your contentThen turn it back on on your chapter 1: ---
numbering:
title:
enabled: true
start: 0 # Might be 1...
---
Your contentThere are a few other things like |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Playing around with your example: In myst.yml project:
# ... existing stuff
numbering:
title: trueIn the first index file That should be it for the numbering changes. However, some of the pages which are notebooks are not numbered because they do not have a title found, this is because the first cell is a code cell (which is hidden) and not a markdown cell. Creating a script to reorganize your notebook cells to have the markdown be the first one results in:
Which I think is the same as your current setup. The script I used to move the cells around is: |
Beta Was this translation helpful? Give feedback.


Playing around with your example:
In myst.yml
In the first index file
chapters/intro.md:That should be it for the numbering changes.
However, some of the pages which are notebooks are not numbered because they do not have a title found, this is because the first cell is a code cell (which is hidden) and not a markdown cell.
Creating a script to reorganize your notebook cells to have the markdown be the first one results in:
Which I think is the same as your current setup.
The script I used to move the cells arou…