How to create a table of contents in a jupyter notebook ?

How to create a table of contents in a jupyter notebook ?

Daidalos April 14, 2020


Example of how to create a table of contents in a jupyter notebook

Create a table of contents

To start, lets create two markdown cells (see image below)

How to create a table of contents in a jupyter notebook ?

then, to create a table of contents, a solution is to create a markdown link to an anchor:

### Table of Contents

* [Chapter 1](#chapter1)
    * [Section 1.1](#section_1_1)
    * [Section 1.2](sSection_1_2)
        * [Section 1.2.1](#section_1_2_1)
        * [Section 1.2.2](#section_1_2_2)
        * [Section 1.2.3](#section_1_2_3)
* [Chapter 2](#chapter2)
    * [Section 2.1](#section_2_1)
    * [Section 2.2](#section_2_2)

Add the anchors to the notebook

Then, just add the anchors

### Chapter 1 <a class="anchor" id="chapter1"></a>

#### Section 1.1 <a class="anchor" id="section_1_1"></a>

#### Section 1.2 <a class="anchor" id="section_1_2"></a>

##### Section 1.2.1 <a class="anchor" id="section_1_2_1"></a>

##### Section 1.2.2 <a class="anchor" id="section_1_2_2"></a>

##### Section 1.2.3 <a class="anchor" id="section_1_2_3"></a>

### Chapter 2 <a class="anchor" id="chapter2"></a>

#### Section 2.1 <a class="anchor" id="section_2_1"></a>

#### Section 2.2 <a class="anchor" id="section_2_2"></a>

For example the TOC link

[Chapter 1](#chapter1)

will go to the:

<a class="anchor" id="chapter1"></a>

How to create a table of contents in a jupyter notebook ?

References

Links Site
How can I add a table of contents to a Jupyter / JupyterLab notebook? stackoverflow
iPython (er, Jupyter) Table of Contents medium.com
Table of Contents (2) jupyter-contrib-nbextensions.readthedocs.io