XD blog

blog page

table of contents


2014-10-23 Fix table of contents in a Notebook

When I have a long notebook, I find it difficult to navigate through it. Maybe I should not do that. However, some outputs are quite long sometimes and the page gets longer. I usually put a table of contents at the beginning but it means I need to go back to the top of the page anytime I want to go to a specific section. That's why I tried a table of contents in a section div with an absolute position (the notebook is here). It works nice even if the mix between markdown and HTML gives weird results sometimes. The only drawback is the conversion of the notebook into HTML or rst. The table of contents shows up at the top of the page at the expected place but disappears after the page was scrolled down.


Xavier Dupré