3

Note, I'm not requiring a numbered TOC, just any old auto generated table of contents would be great.

Background

The problem I face is I have a long notebook with many top level # .., second ## .. and third ## .. level headings, so it's a bit of a labrynth. It would be extremely convenient if there's a way to automatically generate a table of contents (similar to how it can automatically be generated with google docs). Is this possible in colab? My goal is to avoid having to write it manually, for two reasons: efficiency, and accuracy (I may make mistakes).

What I tried

I tried the obvious (looking in 'Insert', as one would with a google doc), but no luck:

enter image description here

Any ideas?

stevec
  • 41,291
  • 27
  • 223
  • 311

2 Answers2

5

If you want to add it in the notebook itself you can do the following.

  • Go to the command palette (shortcut or left bottom corner)

enter image description here

  • Type "table of contents"
  • Choose "add table of contents cell"

enter image description here

Enjoy your TOC cell

enter image description here

Createdd
  • 865
  • 11
  • 15
3

The icon with three dots/lines on the left gives an automatically generated Table of Contents.

Click here:

enter image description here



It brings up a Table of Contents on the side:

enter image description here

stevec
  • 41,291
  • 27
  • 223
  • 311