How can I add a table of contents to an ipython notebook?Markdown to create pages and table of contents?How to link to a named anchor in Multimarkdown?Cross-reference (named anchor) in markdownWhat happened to the TOC extension for ipython notebook?ipython notebook navigate between cellsSimultaneously edit the same ipython notebook in two tabsIs there a document map extension for Jupyter notebook?How to set the port for HTTP(S) in EC2 Security Group Inbound settings for a secure public iPython Notebook server?How to make IPython notebook matplotlib plot inlineUsing the ipython notebook to produce engineering calcsConverting to (not from) ipython Notebook formatInternal links in IPython notebook stopped working since v 2.2Show DataFrame as table in iPython NotebookHow do I add python3 kernel to jupyter (IPython)How do I comment out multiple lines in Jupyter Ipython notebook?Using both Python 2.x and Python 3.x in IPython NotebookHow to enable and access debug logging for notebook and IPython kernel

Where are they calling from?

Do liquid propellant rocket engines experience thrust oscillation?

Which museums have artworks of all four ninja turtles' namesakes?

Algorithm that spans orthogonal vectors: Python

Repeat elements in list, but the number of times each element is repeated is provided by a separate list

Asking an expert in your field that you have never met to review your manuscript

Pandas aggregate with dynamic column names

Leaving a job that I just took based on false promise of a raise. What do I tell future interviewers?

What can a pilot do if an air traffic controller is incapacitated?

Does a familiar stay the same after being true polymorphed and then dismissed and resummoned?

Would Taiwan and China's dispute be solved if Taiwan gave up being the Republic of China?

How does one calculate the distribution of the Matt Colville way of rolling stats?

Is the sentence "何でも忘れた" correct?

I reverse the source code, you negate the output!

Are actors contractually obligated to certain things like going nude/ Sensual Scenes/ Gory Scenes?

I feel like most of my characters are the same, what can I do?

How to create a grid following points in QGIS?

How do I extract code from an arduino?

What is the need of methods like GET and POST in the HTTP protocol?

Pseudo Game of Cups in Python

Should the pagination be reset when changing the order?

How do rulers get rich from war?

What did the controller say during my approach to land (audio clip)?

When does removing Goblin Warchief affect its cost reduction ability?



How can I add a table of contents to an ipython notebook?


Markdown to create pages and table of contents?How to link to a named anchor in Multimarkdown?Cross-reference (named anchor) in markdownWhat happened to the TOC extension for ipython notebook?ipython notebook navigate between cellsSimultaneously edit the same ipython notebook in two tabsIs there a document map extension for Jupyter notebook?How to set the port for HTTP(S) in EC2 Security Group Inbound settings for a secure public iPython Notebook server?How to make IPython notebook matplotlib plot inlineUsing the ipython notebook to produce engineering calcsConverting to (not from) ipython Notebook formatInternal links in IPython notebook stopped working since v 2.2Show DataFrame as table in iPython NotebookHow do I add python3 kernel to jupyter (IPython)How do I comment out multiple lines in Jupyter Ipython notebook?Using both Python 2.x and Python 3.x in IPython NotebookHow to enable and access debug logging for notebook and IPython kernel






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








78















The documentation at http://ipython.org/ipython-doc/stable/interactive/notebook.html says




You can provide a conceptual structure for your computational document as a whole using different levels of headings; there are 6 levels available, from level 1 (top level) down to level 6 (paragraph). These can be used later for constructing tables of contents, etc.




However, I can't find instructions anywhere on how to use my hierarchical headings to create such a table of contents. Is there a way to do this?



NB: I'd also be interested in other kinds of navigation using ipython notebook headings, if any exist. For instance, jumping back and forward from heading to heading in order to quickly find the start of each section, or hiding (folding) the contents of an entire section. This is my wish-list - but any kind of navigation at all would be of interest. Thanks!










share|improve this question
























  • see @Nikolay 's answer below for a general solution that works across all webpages.. this is a great answer.

    – ihightower
    Jun 21 '17 at 7:19

















78















The documentation at http://ipython.org/ipython-doc/stable/interactive/notebook.html says




You can provide a conceptual structure for your computational document as a whole using different levels of headings; there are 6 levels available, from level 1 (top level) down to level 6 (paragraph). These can be used later for constructing tables of contents, etc.




However, I can't find instructions anywhere on how to use my hierarchical headings to create such a table of contents. Is there a way to do this?



NB: I'd also be interested in other kinds of navigation using ipython notebook headings, if any exist. For instance, jumping back and forward from heading to heading in order to quickly find the start of each section, or hiding (folding) the contents of an entire section. This is my wish-list - but any kind of navigation at all would be of interest. Thanks!










share|improve this question
























  • see @Nikolay 's answer below for a general solution that works across all webpages.. this is a great answer.

    – ihightower
    Jun 21 '17 at 7:19













78












78








78


17






The documentation at http://ipython.org/ipython-doc/stable/interactive/notebook.html says




You can provide a conceptual structure for your computational document as a whole using different levels of headings; there are 6 levels available, from level 1 (top level) down to level 6 (paragraph). These can be used later for constructing tables of contents, etc.




However, I can't find instructions anywhere on how to use my hierarchical headings to create such a table of contents. Is there a way to do this?



NB: I'd also be interested in other kinds of navigation using ipython notebook headings, if any exist. For instance, jumping back and forward from heading to heading in order to quickly find the start of each section, or hiding (folding) the contents of an entire section. This is my wish-list - but any kind of navigation at all would be of interest. Thanks!










share|improve this question














The documentation at http://ipython.org/ipython-doc/stable/interactive/notebook.html says




You can provide a conceptual structure for your computational document as a whole using different levels of headings; there are 6 levels available, from level 1 (top level) down to level 6 (paragraph). These can be used later for constructing tables of contents, etc.




However, I can't find instructions anywhere on how to use my hierarchical headings to create such a table of contents. Is there a way to do this?



NB: I'd also be interested in other kinds of navigation using ipython notebook headings, if any exist. For instance, jumping back and forward from heading to heading in order to quickly find the start of each section, or hiding (folding) the contents of an entire section. This is my wish-list - but any kind of navigation at all would be of interest. Thanks!







ipython-notebook






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 16 '14 at 0:54









user2428107user2428107

9171 gold badge8 silver badges15 bronze badges




9171 gold badge8 silver badges15 bronze badges















  • see @Nikolay 's answer below for a general solution that works across all webpages.. this is a great answer.

    – ihightower
    Jun 21 '17 at 7:19

















  • see @Nikolay 's answer below for a general solution that works across all webpages.. this is a great answer.

    – ihightower
    Jun 21 '17 at 7:19
















see @Nikolay 's answer below for a general solution that works across all webpages.. this is a great answer.

– ihightower
Jun 21 '17 at 7:19





see @Nikolay 's answer below for a general solution that works across all webpages.. this is a great answer.

– ihightower
Jun 21 '17 at 7:19












9 Answers
9






active

oldest

votes


















42
















There is an ipython nbextension that constructs a table of contents for a notebook. It seems to only provide navigation, not section folding.






share|improve this answer



























  • Thanks, I assume this is what the documentation was referring to.

    – user2428107
    Jan 18 '14 at 4:54






  • 2





    For who want to install it in jupyter 4, this post may help.

    – Syrtis Major
    Oct 10 '15 at 8:33






  • 8





    Just to update this: there is now an nbextensions extension, which bundles a whole lot of extensions together and allows you to manage them via jupyter itself. I think it's now the easiest way to get ToC2. And it provides other relevant extensions such as section folding. It's at github.com/ipython-contrib/jupyter_contrib_nbextensions

    – user2428107
    Mar 30 '17 at 4:55


















67
















You can add a TOC manually with Markdown and HTML. Here's how I have been adding:



Create TOC at top of Jupyter Notebook:



## TOC:
* [First Bullet Header](#first-bullet)
* [Second Bullet Header](#second-bullet)


Add html anchors throughout body:



## First Bullet Header <a class="anchor" id="first-bullet"></a>

code blocks...

## Second Bullet Header <a class="anchor" id="second-bullet"></a>

code blocks...


It may not be the best approach, but it works. Hope this helps.






share|improve this answer






















  • 11





    This does not work for me anymore, but a similar approach does.

    – joelostblom
    May 24 '17 at 2:27












  • also same "similar approach" as this: stackoverflow.com/questions/5319754/… tl;dr: use <a name="pookie"></a> for anchor and for link use: Take me to [pookie](#pookie)

    – michael
    May 24 '17 at 19:12











  • also duplicate here: stackoverflow.com/a/7015050/127971

    – michael
    May 24 '17 at 19:13


















27
















Here is one more option without too much JS hassle: https://github.com/kmahelona/ipython_notebook_goodies






share|improve this answer

























  • This is super useful for notebooks shared with other people!

    – rerx
    Jan 19 '18 at 12:00


















15
















How about using a Browser plugin that gives you an overview of ANY html page. I have tried the following:




  • HTML 5 Outliner for Chrome


  • Headings Map for Firefox

They both work pretty well for IPython Notebooks. I was reluctant to use the previous solutions as they seem a bit unstable and ended up using these extensions.






share|improve this answer






















  • 1





    Very helpful! But some built-in functions would be make so much sense - especially in the combination with markdown

    – dmeu
    Feb 15 '16 at 14:11


















10
















I recently created a small extension to Jupyter named jupyter-navbar. It searches for headers written in markdown cells, and displays links to them in the sidebar in a hierarchical fashion. The sidebar is resizable and collapsible. See screenshot below.



It is easy to install, and takes advantage of the 'custom' JS and CSS codes that get executed whenever a notebook is opened, so you don't need to manually run it.



enter image description here






share|improve this answer
































    10
















    There are now two packages that can be used to handle Jupyter extensions:



    1. jupyter_contrib_nbextensions that installs extensions, including table of contents;


    2. jupyter_nbextensions_configurator that provides graphical user interfaces for configuring which nbextensions are enabled (load automatically for every notebook) and provides controls to configure the nbextensions' options.


    UPDATE:



    Starting from recent versions of jupyter_contrib_nbextensions, at least with conda you don't need to install jupyter_nbextensions_configurator because it gets installed together with those extensions.






    share|improve this answer


































      4
















      Here is my approach, clunky as it is and available in github:



      Put in the very first notebook cell, the import cell:



      from IPythonTOC import IPythonTOC

      toc = IPythonTOC()


      Somewhere after the import cell, put in the genTOCEntry cell but don't run it yet:



      ''' if you called toc.genTOCMarkdownCell before running this cell, 
      the title has been set in the class '''

      print toc.genTOCEntry()


      Below the genTOCEntry cell`, make a TOC cell as a markdown cell:



      <a id='TOC'></a>

      #TOC


      As the notebook is developed, put this genTOCMarkdownCell before starting a new section:



      with open('TOCMarkdownCell.txt', 'w') as outfile:

      outfile.write(toc.genTOCMarkdownCell('Introduction'))

      !cat TOCMarkdownCell.txt

      !rm TOCMarkdownCell.txt


      Move the genTOCMarkdownCell down to the point in your notebook where you want to start a new section and make the argument to genTOCMarkdownCell the string title for your new section then run it. Add a markdown cell right after it and copy the output from genTOCMarkdownCell into the markdown cell that starts your new section. Then go to the genTOCEntry cell near the top of your notebook and run it. For example, if you make the argument to genTOCMarkdownCell as shown above and run it, you get this output
      to paste into the first markdown cell of your newly indexed section:



      <a id='Introduction'></a>

      ###Introduction


      Then when you go to the top of your notebook and run genTocEntry, you get the output:



      [Introduction](#Introduction)


      Copy this link string and paste it into the TOC markdown cell as follows:



      <a id='TOC'></a>

      #TOC

      [Introduction](#Introduction)


      After you edit the TOC cell to insert the link string and then you press shift-enter, the link to your new section will appear in your notebook Table of Contents as a web link and clicking it will position the browser to your new section.



      One thing I often forget is that clicking a line in the TOC makes the browser jump to that cell but doesn't select it. Whatever cell was active when we clicked on the TOC link is still active, so a down or up arrow or shift-enter refers to still active cell, not the cell we got by clicking on the TOC link.






      share|improve this answer
































        2
















        As Ian already pointed out, there is a table-of-contents extension by minrk for the IPython Notebook. I had some trouble to make it work and made this IPython Notebook which semi-automatically generates the files for minrk's table of contents extension in Windows. It does not use the 'curl'-commands or links, but writes the *.js and *.css files directly into your IPython Notebook-profile-directory.



        There is a section in the notebook called 'What you need to do' - follow it and have a nice floating table of contents : )



        Here is an html version which already shows it:
        http://htmlpreview.github.io/?https://github.com/ahambi/140824-TOC/blob/master/A%20floating%20table%20of%20contents.htm






        share|improve this answer
































          2
















          Introduction



          As @Ian and @Sergey have mentioned, nbextensions is a simple solution. To elaborate their answer, here is a few more information.



          What is nbextensions?




          The nbextensions contains a collection of extensions
          that add functionality to your Jupyter notebook.




          For example, just to cite a few extensions:




          • Table of Contents






          • Collapsible headings





          Install nbextensions



          The installation can be done through Conda or PIP



          # If conda:
          conda install -c conda-forge jupyter_contrib_nbextensions
          # or with pip:
          pip install jupyter_contrib_nbextensions


          Copy js and css files



          To copy the nbextensions' javascript and css files into the jupyter server's search directory, do the following:



          jupyter contrib nbextension install --user


          Toggle extensions



          Note that if you are not familiar with the terminal, it would be better to install nbextensions configurator (see the next section)



          You can enable/disable the extensions of your choice. As the documentation mentions, the generic command is:



          jupyter nbextension enable <nbextension require path>


          Concretely, to enable the ToC (Table of Contents) extension, do:



          jupyter nbextension enable toc2/main


          Install Configuration interface (optional but useful)



          As its documentation says, nbextensions_configurator provides config interfaces for nbextensions.



          It looks like the following:
          nbextensions configurators



          To install it if you use conda:



          conda install -c conda-forge jupyter_nbextensions_configurator


          If you don't have Conda or don't want to install through Conda, then do the following 2 steps:



          pip install jupyter_nbextensions_configurator
          jupyter nbextensions_configurator enable --user





          share|improve this answer



























          • This is a great and detailed answer. I guess enabling toc2/main is the same as checking "Table of Contents (2)" on localhost:8888/tree#nbextensions_configurator.

            – flow2k
            Aug 20 at 7:22













          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f21151450%2fhow-can-i-add-a-table-of-contents-to-an-ipython-notebook%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          9 Answers
          9






          active

          oldest

          votes








          9 Answers
          9






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          42
















          There is an ipython nbextension that constructs a table of contents for a notebook. It seems to only provide navigation, not section folding.






          share|improve this answer



























          • Thanks, I assume this is what the documentation was referring to.

            – user2428107
            Jan 18 '14 at 4:54






          • 2





            For who want to install it in jupyter 4, this post may help.

            – Syrtis Major
            Oct 10 '15 at 8:33






          • 8





            Just to update this: there is now an nbextensions extension, which bundles a whole lot of extensions together and allows you to manage them via jupyter itself. I think it's now the easiest way to get ToC2. And it provides other relevant extensions such as section folding. It's at github.com/ipython-contrib/jupyter_contrib_nbextensions

            – user2428107
            Mar 30 '17 at 4:55















          42
















          There is an ipython nbextension that constructs a table of contents for a notebook. It seems to only provide navigation, not section folding.






          share|improve this answer



























          • Thanks, I assume this is what the documentation was referring to.

            – user2428107
            Jan 18 '14 at 4:54






          • 2





            For who want to install it in jupyter 4, this post may help.

            – Syrtis Major
            Oct 10 '15 at 8:33






          • 8





            Just to update this: there is now an nbextensions extension, which bundles a whole lot of extensions together and allows you to manage them via jupyter itself. I think it's now the easiest way to get ToC2. And it provides other relevant extensions such as section folding. It's at github.com/ipython-contrib/jupyter_contrib_nbextensions

            – user2428107
            Mar 30 '17 at 4:55













          42














          42










          42









          There is an ipython nbextension that constructs a table of contents for a notebook. It seems to only provide navigation, not section folding.






          share|improve this answer















          There is an ipython nbextension that constructs a table of contents for a notebook. It seems to only provide navigation, not section folding.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 16 '14 at 9:56

























          answered Jan 16 '14 at 8:36









          IanIan

          1,11410 silver badges13 bronze badges




          1,11410 silver badges13 bronze badges















          • Thanks, I assume this is what the documentation was referring to.

            – user2428107
            Jan 18 '14 at 4:54






          • 2





            For who want to install it in jupyter 4, this post may help.

            – Syrtis Major
            Oct 10 '15 at 8:33






          • 8





            Just to update this: there is now an nbextensions extension, which bundles a whole lot of extensions together and allows you to manage them via jupyter itself. I think it's now the easiest way to get ToC2. And it provides other relevant extensions such as section folding. It's at github.com/ipython-contrib/jupyter_contrib_nbextensions

            – user2428107
            Mar 30 '17 at 4:55

















          • Thanks, I assume this is what the documentation was referring to.

            – user2428107
            Jan 18 '14 at 4:54






          • 2





            For who want to install it in jupyter 4, this post may help.

            – Syrtis Major
            Oct 10 '15 at 8:33






          • 8





            Just to update this: there is now an nbextensions extension, which bundles a whole lot of extensions together and allows you to manage them via jupyter itself. I think it's now the easiest way to get ToC2. And it provides other relevant extensions such as section folding. It's at github.com/ipython-contrib/jupyter_contrib_nbextensions

            – user2428107
            Mar 30 '17 at 4:55
















          Thanks, I assume this is what the documentation was referring to.

          – user2428107
          Jan 18 '14 at 4:54





          Thanks, I assume this is what the documentation was referring to.

          – user2428107
          Jan 18 '14 at 4:54




          2




          2





          For who want to install it in jupyter 4, this post may help.

          – Syrtis Major
          Oct 10 '15 at 8:33





          For who want to install it in jupyter 4, this post may help.

          – Syrtis Major
          Oct 10 '15 at 8:33




          8




          8





          Just to update this: there is now an nbextensions extension, which bundles a whole lot of extensions together and allows you to manage them via jupyter itself. I think it's now the easiest way to get ToC2. And it provides other relevant extensions such as section folding. It's at github.com/ipython-contrib/jupyter_contrib_nbextensions

          – user2428107
          Mar 30 '17 at 4:55





          Just to update this: there is now an nbextensions extension, which bundles a whole lot of extensions together and allows you to manage them via jupyter itself. I think it's now the easiest way to get ToC2. And it provides other relevant extensions such as section folding. It's at github.com/ipython-contrib/jupyter_contrib_nbextensions

          – user2428107
          Mar 30 '17 at 4:55













          67
















          You can add a TOC manually with Markdown and HTML. Here's how I have been adding:



          Create TOC at top of Jupyter Notebook:



          ## TOC:
          * [First Bullet Header](#first-bullet)
          * [Second Bullet Header](#second-bullet)


          Add html anchors throughout body:



          ## First Bullet Header <a class="anchor" id="first-bullet"></a>

          code blocks...

          ## Second Bullet Header <a class="anchor" id="second-bullet"></a>

          code blocks...


          It may not be the best approach, but it works. Hope this helps.






          share|improve this answer






















          • 11





            This does not work for me anymore, but a similar approach does.

            – joelostblom
            May 24 '17 at 2:27












          • also same "similar approach" as this: stackoverflow.com/questions/5319754/… tl;dr: use <a name="pookie"></a> for anchor and for link use: Take me to [pookie](#pookie)

            – michael
            May 24 '17 at 19:12











          • also duplicate here: stackoverflow.com/a/7015050/127971

            – michael
            May 24 '17 at 19:13















          67
















          You can add a TOC manually with Markdown and HTML. Here's how I have been adding:



          Create TOC at top of Jupyter Notebook:



          ## TOC:
          * [First Bullet Header](#first-bullet)
          * [Second Bullet Header](#second-bullet)


          Add html anchors throughout body:



          ## First Bullet Header <a class="anchor" id="first-bullet"></a>

          code blocks...

          ## Second Bullet Header <a class="anchor" id="second-bullet"></a>

          code blocks...


          It may not be the best approach, but it works. Hope this helps.






          share|improve this answer






















          • 11





            This does not work for me anymore, but a similar approach does.

            – joelostblom
            May 24 '17 at 2:27












          • also same "similar approach" as this: stackoverflow.com/questions/5319754/… tl;dr: use <a name="pookie"></a> for anchor and for link use: Take me to [pookie](#pookie)

            – michael
            May 24 '17 at 19:12











          • also duplicate here: stackoverflow.com/a/7015050/127971

            – michael
            May 24 '17 at 19:13













          67














          67










          67









          You can add a TOC manually with Markdown and HTML. Here's how I have been adding:



          Create TOC at top of Jupyter Notebook:



          ## TOC:
          * [First Bullet Header](#first-bullet)
          * [Second Bullet Header](#second-bullet)


          Add html anchors throughout body:



          ## First Bullet Header <a class="anchor" id="first-bullet"></a>

          code blocks...

          ## Second Bullet Header <a class="anchor" id="second-bullet"></a>

          code blocks...


          It may not be the best approach, but it works. Hope this helps.






          share|improve this answer















          You can add a TOC manually with Markdown and HTML. Here's how I have been adding:



          Create TOC at top of Jupyter Notebook:



          ## TOC:
          * [First Bullet Header](#first-bullet)
          * [Second Bullet Header](#second-bullet)


          Add html anchors throughout body:



          ## First Bullet Header <a class="anchor" id="first-bullet"></a>

          code blocks...

          ## Second Bullet Header <a class="anchor" id="second-bullet"></a>

          code blocks...


          It may not be the best approach, but it works. Hope this helps.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Oct 2 '16 at 13:10

























          answered Oct 2 '16 at 12:56









          Matt DanchoMatt Dancho

          2,80619 silver badges17 bronze badges




          2,80619 silver badges17 bronze badges










          • 11





            This does not work for me anymore, but a similar approach does.

            – joelostblom
            May 24 '17 at 2:27












          • also same "similar approach" as this: stackoverflow.com/questions/5319754/… tl;dr: use <a name="pookie"></a> for anchor and for link use: Take me to [pookie](#pookie)

            – michael
            May 24 '17 at 19:12











          • also duplicate here: stackoverflow.com/a/7015050/127971

            – michael
            May 24 '17 at 19:13












          • 11





            This does not work for me anymore, but a similar approach does.

            – joelostblom
            May 24 '17 at 2:27












          • also same "similar approach" as this: stackoverflow.com/questions/5319754/… tl;dr: use <a name="pookie"></a> for anchor and for link use: Take me to [pookie](#pookie)

            – michael
            May 24 '17 at 19:12











          • also duplicate here: stackoverflow.com/a/7015050/127971

            – michael
            May 24 '17 at 19:13







          11




          11





          This does not work for me anymore, but a similar approach does.

          – joelostblom
          May 24 '17 at 2:27






          This does not work for me anymore, but a similar approach does.

          – joelostblom
          May 24 '17 at 2:27














          also same "similar approach" as this: stackoverflow.com/questions/5319754/… tl;dr: use <a name="pookie"></a> for anchor and for link use: Take me to [pookie](#pookie)

          – michael
          May 24 '17 at 19:12





          also same "similar approach" as this: stackoverflow.com/questions/5319754/… tl;dr: use <a name="pookie"></a> for anchor and for link use: Take me to [pookie](#pookie)

          – michael
          May 24 '17 at 19:12













          also duplicate here: stackoverflow.com/a/7015050/127971

          – michael
          May 24 '17 at 19:13





          also duplicate here: stackoverflow.com/a/7015050/127971

          – michael
          May 24 '17 at 19:13











          27
















          Here is one more option without too much JS hassle: https://github.com/kmahelona/ipython_notebook_goodies






          share|improve this answer

























          • This is super useful for notebooks shared with other people!

            – rerx
            Jan 19 '18 at 12:00















          27
















          Here is one more option without too much JS hassle: https://github.com/kmahelona/ipython_notebook_goodies






          share|improve this answer

























          • This is super useful for notebooks shared with other people!

            – rerx
            Jan 19 '18 at 12:00













          27














          27










          27









          Here is one more option without too much JS hassle: https://github.com/kmahelona/ipython_notebook_goodies






          share|improve this answer













          Here is one more option without too much JS hassle: https://github.com/kmahelona/ipython_notebook_goodies







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 5 '14 at 19:42









          AnaderiAnaderi

          5444 silver badges8 bronze badges




          5444 silver badges8 bronze badges















          • This is super useful for notebooks shared with other people!

            – rerx
            Jan 19 '18 at 12:00

















          • This is super useful for notebooks shared with other people!

            – rerx
            Jan 19 '18 at 12:00
















          This is super useful for notebooks shared with other people!

          – rerx
          Jan 19 '18 at 12:00





          This is super useful for notebooks shared with other people!

          – rerx
          Jan 19 '18 at 12:00











          15
















          How about using a Browser plugin that gives you an overview of ANY html page. I have tried the following:




          • HTML 5 Outliner for Chrome


          • Headings Map for Firefox

          They both work pretty well for IPython Notebooks. I was reluctant to use the previous solutions as they seem a bit unstable and ended up using these extensions.






          share|improve this answer






















          • 1





            Very helpful! But some built-in functions would be make so much sense - especially in the combination with markdown

            – dmeu
            Feb 15 '16 at 14:11















          15
















          How about using a Browser plugin that gives you an overview of ANY html page. I have tried the following:




          • HTML 5 Outliner for Chrome


          • Headings Map for Firefox

          They both work pretty well for IPython Notebooks. I was reluctant to use the previous solutions as they seem a bit unstable and ended up using these extensions.






          share|improve this answer






















          • 1





            Very helpful! But some built-in functions would be make so much sense - especially in the combination with markdown

            – dmeu
            Feb 15 '16 at 14:11













          15














          15










          15









          How about using a Browser plugin that gives you an overview of ANY html page. I have tried the following:




          • HTML 5 Outliner for Chrome


          • Headings Map for Firefox

          They both work pretty well for IPython Notebooks. I was reluctant to use the previous solutions as they seem a bit unstable and ended up using these extensions.






          share|improve this answer















          How about using a Browser plugin that gives you an overview of ANY html page. I have tried the following:




          • HTML 5 Outliner for Chrome


          • Headings Map for Firefox

          They both work pretty well for IPython Notebooks. I was reluctant to use the previous solutions as they seem a bit unstable and ended up using these extensions.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 3 '15 at 23:34









          Community

          11 silver badge




          11 silver badge










          answered Jul 3 '15 at 16:36









          NikolayNikolay

          8309 silver badges8 bronze badges




          8309 silver badges8 bronze badges










          • 1





            Very helpful! But some built-in functions would be make so much sense - especially in the combination with markdown

            – dmeu
            Feb 15 '16 at 14:11












          • 1





            Very helpful! But some built-in functions would be make so much sense - especially in the combination with markdown

            – dmeu
            Feb 15 '16 at 14:11







          1




          1





          Very helpful! But some built-in functions would be make so much sense - especially in the combination with markdown

          – dmeu
          Feb 15 '16 at 14:11





          Very helpful! But some built-in functions would be make so much sense - especially in the combination with markdown

          – dmeu
          Feb 15 '16 at 14:11











          10
















          I recently created a small extension to Jupyter named jupyter-navbar. It searches for headers written in markdown cells, and displays links to them in the sidebar in a hierarchical fashion. The sidebar is resizable and collapsible. See screenshot below.



          It is easy to install, and takes advantage of the 'custom' JS and CSS codes that get executed whenever a notebook is opened, so you don't need to manually run it.



          enter image description here






          share|improve this answer





























            10
















            I recently created a small extension to Jupyter named jupyter-navbar. It searches for headers written in markdown cells, and displays links to them in the sidebar in a hierarchical fashion. The sidebar is resizable and collapsible. See screenshot below.



            It is easy to install, and takes advantage of the 'custom' JS and CSS codes that get executed whenever a notebook is opened, so you don't need to manually run it.



            enter image description here






            share|improve this answer



























              10














              10










              10









              I recently created a small extension to Jupyter named jupyter-navbar. It searches for headers written in markdown cells, and displays links to them in the sidebar in a hierarchical fashion. The sidebar is resizable and collapsible. See screenshot below.



              It is easy to install, and takes advantage of the 'custom' JS and CSS codes that get executed whenever a notebook is opened, so you don't need to manually run it.



              enter image description here






              share|improve this answer













              I recently created a small extension to Jupyter named jupyter-navbar. It searches for headers written in markdown cells, and displays links to them in the sidebar in a hierarchical fashion. The sidebar is resizable and collapsible. See screenshot below.



              It is easy to install, and takes advantage of the 'custom' JS and CSS codes that get executed whenever a notebook is opened, so you don't need to manually run it.



              enter image description here







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Jan 30 '18 at 8:42









              ShovaltShovalt

              2,8621 gold badge17 silver badges36 bronze badges




              2,8621 gold badge17 silver badges36 bronze badges
























                  10
















                  There are now two packages that can be used to handle Jupyter extensions:



                  1. jupyter_contrib_nbextensions that installs extensions, including table of contents;


                  2. jupyter_nbextensions_configurator that provides graphical user interfaces for configuring which nbextensions are enabled (load automatically for every notebook) and provides controls to configure the nbextensions' options.


                  UPDATE:



                  Starting from recent versions of jupyter_contrib_nbextensions, at least with conda you don't need to install jupyter_nbextensions_configurator because it gets installed together with those extensions.






                  share|improve this answer































                    10
















                    There are now two packages that can be used to handle Jupyter extensions:



                    1. jupyter_contrib_nbextensions that installs extensions, including table of contents;


                    2. jupyter_nbextensions_configurator that provides graphical user interfaces for configuring which nbextensions are enabled (load automatically for every notebook) and provides controls to configure the nbextensions' options.


                    UPDATE:



                    Starting from recent versions of jupyter_contrib_nbextensions, at least with conda you don't need to install jupyter_nbextensions_configurator because it gets installed together with those extensions.






                    share|improve this answer





























                      10














                      10










                      10









                      There are now two packages that can be used to handle Jupyter extensions:



                      1. jupyter_contrib_nbextensions that installs extensions, including table of contents;


                      2. jupyter_nbextensions_configurator that provides graphical user interfaces for configuring which nbextensions are enabled (load automatically for every notebook) and provides controls to configure the nbextensions' options.


                      UPDATE:



                      Starting from recent versions of jupyter_contrib_nbextensions, at least with conda you don't need to install jupyter_nbextensions_configurator because it gets installed together with those extensions.






                      share|improve this answer















                      There are now two packages that can be used to handle Jupyter extensions:



                      1. jupyter_contrib_nbextensions that installs extensions, including table of contents;


                      2. jupyter_nbextensions_configurator that provides graphical user interfaces for configuring which nbextensions are enabled (load automatically for every notebook) and provides controls to configure the nbextensions' options.


                      UPDATE:



                      Starting from recent versions of jupyter_contrib_nbextensions, at least with conda you don't need to install jupyter_nbextensions_configurator because it gets installed together with those extensions.







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Mar 28 at 15:03

























                      answered May 16 '17 at 13:09









                      Sergey ZakharovSergey Zakharov

                      4652 gold badges7 silver badges22 bronze badges




                      4652 gold badges7 silver badges22 bronze badges
























                          4
















                          Here is my approach, clunky as it is and available in github:



                          Put in the very first notebook cell, the import cell:



                          from IPythonTOC import IPythonTOC

                          toc = IPythonTOC()


                          Somewhere after the import cell, put in the genTOCEntry cell but don't run it yet:



                          ''' if you called toc.genTOCMarkdownCell before running this cell, 
                          the title has been set in the class '''

                          print toc.genTOCEntry()


                          Below the genTOCEntry cell`, make a TOC cell as a markdown cell:



                          <a id='TOC'></a>

                          #TOC


                          As the notebook is developed, put this genTOCMarkdownCell before starting a new section:



                          with open('TOCMarkdownCell.txt', 'w') as outfile:

                          outfile.write(toc.genTOCMarkdownCell('Introduction'))

                          !cat TOCMarkdownCell.txt

                          !rm TOCMarkdownCell.txt


                          Move the genTOCMarkdownCell down to the point in your notebook where you want to start a new section and make the argument to genTOCMarkdownCell the string title for your new section then run it. Add a markdown cell right after it and copy the output from genTOCMarkdownCell into the markdown cell that starts your new section. Then go to the genTOCEntry cell near the top of your notebook and run it. For example, if you make the argument to genTOCMarkdownCell as shown above and run it, you get this output
                          to paste into the first markdown cell of your newly indexed section:



                          <a id='Introduction'></a>

                          ###Introduction


                          Then when you go to the top of your notebook and run genTocEntry, you get the output:



                          [Introduction](#Introduction)


                          Copy this link string and paste it into the TOC markdown cell as follows:



                          <a id='TOC'></a>

                          #TOC

                          [Introduction](#Introduction)


                          After you edit the TOC cell to insert the link string and then you press shift-enter, the link to your new section will appear in your notebook Table of Contents as a web link and clicking it will position the browser to your new section.



                          One thing I often forget is that clicking a line in the TOC makes the browser jump to that cell but doesn't select it. Whatever cell was active when we clicked on the TOC link is still active, so a down or up arrow or shift-enter refers to still active cell, not the cell we got by clicking on the TOC link.






                          share|improve this answer





























                            4
















                            Here is my approach, clunky as it is and available in github:



                            Put in the very first notebook cell, the import cell:



                            from IPythonTOC import IPythonTOC

                            toc = IPythonTOC()


                            Somewhere after the import cell, put in the genTOCEntry cell but don't run it yet:



                            ''' if you called toc.genTOCMarkdownCell before running this cell, 
                            the title has been set in the class '''

                            print toc.genTOCEntry()


                            Below the genTOCEntry cell`, make a TOC cell as a markdown cell:



                            <a id='TOC'></a>

                            #TOC


                            As the notebook is developed, put this genTOCMarkdownCell before starting a new section:



                            with open('TOCMarkdownCell.txt', 'w') as outfile:

                            outfile.write(toc.genTOCMarkdownCell('Introduction'))

                            !cat TOCMarkdownCell.txt

                            !rm TOCMarkdownCell.txt


                            Move the genTOCMarkdownCell down to the point in your notebook where you want to start a new section and make the argument to genTOCMarkdownCell the string title for your new section then run it. Add a markdown cell right after it and copy the output from genTOCMarkdownCell into the markdown cell that starts your new section. Then go to the genTOCEntry cell near the top of your notebook and run it. For example, if you make the argument to genTOCMarkdownCell as shown above and run it, you get this output
                            to paste into the first markdown cell of your newly indexed section:



                            <a id='Introduction'></a>

                            ###Introduction


                            Then when you go to the top of your notebook and run genTocEntry, you get the output:



                            [Introduction](#Introduction)


                            Copy this link string and paste it into the TOC markdown cell as follows:



                            <a id='TOC'></a>

                            #TOC

                            [Introduction](#Introduction)


                            After you edit the TOC cell to insert the link string and then you press shift-enter, the link to your new section will appear in your notebook Table of Contents as a web link and clicking it will position the browser to your new section.



                            One thing I often forget is that clicking a line in the TOC makes the browser jump to that cell but doesn't select it. Whatever cell was active when we clicked on the TOC link is still active, so a down or up arrow or shift-enter refers to still active cell, not the cell we got by clicking on the TOC link.






                            share|improve this answer



























                              4














                              4










                              4









                              Here is my approach, clunky as it is and available in github:



                              Put in the very first notebook cell, the import cell:



                              from IPythonTOC import IPythonTOC

                              toc = IPythonTOC()


                              Somewhere after the import cell, put in the genTOCEntry cell but don't run it yet:



                              ''' if you called toc.genTOCMarkdownCell before running this cell, 
                              the title has been set in the class '''

                              print toc.genTOCEntry()


                              Below the genTOCEntry cell`, make a TOC cell as a markdown cell:



                              <a id='TOC'></a>

                              #TOC


                              As the notebook is developed, put this genTOCMarkdownCell before starting a new section:



                              with open('TOCMarkdownCell.txt', 'w') as outfile:

                              outfile.write(toc.genTOCMarkdownCell('Introduction'))

                              !cat TOCMarkdownCell.txt

                              !rm TOCMarkdownCell.txt


                              Move the genTOCMarkdownCell down to the point in your notebook where you want to start a new section and make the argument to genTOCMarkdownCell the string title for your new section then run it. Add a markdown cell right after it and copy the output from genTOCMarkdownCell into the markdown cell that starts your new section. Then go to the genTOCEntry cell near the top of your notebook and run it. For example, if you make the argument to genTOCMarkdownCell as shown above and run it, you get this output
                              to paste into the first markdown cell of your newly indexed section:



                              <a id='Introduction'></a>

                              ###Introduction


                              Then when you go to the top of your notebook and run genTocEntry, you get the output:



                              [Introduction](#Introduction)


                              Copy this link string and paste it into the TOC markdown cell as follows:



                              <a id='TOC'></a>

                              #TOC

                              [Introduction](#Introduction)


                              After you edit the TOC cell to insert the link string and then you press shift-enter, the link to your new section will appear in your notebook Table of Contents as a web link and clicking it will position the browser to your new section.



                              One thing I often forget is that clicking a line in the TOC makes the browser jump to that cell but doesn't select it. Whatever cell was active when we clicked on the TOC link is still active, so a down or up arrow or shift-enter refers to still active cell, not the cell we got by clicking on the TOC link.






                              share|improve this answer













                              Here is my approach, clunky as it is and available in github:



                              Put in the very first notebook cell, the import cell:



                              from IPythonTOC import IPythonTOC

                              toc = IPythonTOC()


                              Somewhere after the import cell, put in the genTOCEntry cell but don't run it yet:



                              ''' if you called toc.genTOCMarkdownCell before running this cell, 
                              the title has been set in the class '''

                              print toc.genTOCEntry()


                              Below the genTOCEntry cell`, make a TOC cell as a markdown cell:



                              <a id='TOC'></a>

                              #TOC


                              As the notebook is developed, put this genTOCMarkdownCell before starting a new section:



                              with open('TOCMarkdownCell.txt', 'w') as outfile:

                              outfile.write(toc.genTOCMarkdownCell('Introduction'))

                              !cat TOCMarkdownCell.txt

                              !rm TOCMarkdownCell.txt


                              Move the genTOCMarkdownCell down to the point in your notebook where you want to start a new section and make the argument to genTOCMarkdownCell the string title for your new section then run it. Add a markdown cell right after it and copy the output from genTOCMarkdownCell into the markdown cell that starts your new section. Then go to the genTOCEntry cell near the top of your notebook and run it. For example, if you make the argument to genTOCMarkdownCell as shown above and run it, you get this output
                              to paste into the first markdown cell of your newly indexed section:



                              <a id='Introduction'></a>

                              ###Introduction


                              Then when you go to the top of your notebook and run genTocEntry, you get the output:



                              [Introduction](#Introduction)


                              Copy this link string and paste it into the TOC markdown cell as follows:



                              <a id='TOC'></a>

                              #TOC

                              [Introduction](#Introduction)


                              After you edit the TOC cell to insert the link string and then you press shift-enter, the link to your new section will appear in your notebook Table of Contents as a web link and clicking it will position the browser to your new section.



                              One thing I often forget is that clicking a line in the TOC makes the browser jump to that cell but doesn't select it. Whatever cell was active when we clicked on the TOC link is still active, so a down or up arrow or shift-enter refers to still active cell, not the cell we got by clicking on the TOC link.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Aug 15 '15 at 1:19









                              upandacrossupandacross

                              3222 silver badges7 bronze badges




                              3222 silver badges7 bronze badges
























                                  2
















                                  As Ian already pointed out, there is a table-of-contents extension by minrk for the IPython Notebook. I had some trouble to make it work and made this IPython Notebook which semi-automatically generates the files for minrk's table of contents extension in Windows. It does not use the 'curl'-commands or links, but writes the *.js and *.css files directly into your IPython Notebook-profile-directory.



                                  There is a section in the notebook called 'What you need to do' - follow it and have a nice floating table of contents : )



                                  Here is an html version which already shows it:
                                  http://htmlpreview.github.io/?https://github.com/ahambi/140824-TOC/blob/master/A%20floating%20table%20of%20contents.htm






                                  share|improve this answer





























                                    2
















                                    As Ian already pointed out, there is a table-of-contents extension by minrk for the IPython Notebook. I had some trouble to make it work and made this IPython Notebook which semi-automatically generates the files for minrk's table of contents extension in Windows. It does not use the 'curl'-commands or links, but writes the *.js and *.css files directly into your IPython Notebook-profile-directory.



                                    There is a section in the notebook called 'What you need to do' - follow it and have a nice floating table of contents : )



                                    Here is an html version which already shows it:
                                    http://htmlpreview.github.io/?https://github.com/ahambi/140824-TOC/blob/master/A%20floating%20table%20of%20contents.htm






                                    share|improve this answer



























                                      2














                                      2










                                      2









                                      As Ian already pointed out, there is a table-of-contents extension by minrk for the IPython Notebook. I had some trouble to make it work and made this IPython Notebook which semi-automatically generates the files for minrk's table of contents extension in Windows. It does not use the 'curl'-commands or links, but writes the *.js and *.css files directly into your IPython Notebook-profile-directory.



                                      There is a section in the notebook called 'What you need to do' - follow it and have a nice floating table of contents : )



                                      Here is an html version which already shows it:
                                      http://htmlpreview.github.io/?https://github.com/ahambi/140824-TOC/blob/master/A%20floating%20table%20of%20contents.htm






                                      share|improve this answer













                                      As Ian already pointed out, there is a table-of-contents extension by minrk for the IPython Notebook. I had some trouble to make it work and made this IPython Notebook which semi-automatically generates the files for minrk's table of contents extension in Windows. It does not use the 'curl'-commands or links, but writes the *.js and *.css files directly into your IPython Notebook-profile-directory.



                                      There is a section in the notebook called 'What you need to do' - follow it and have a nice floating table of contents : )



                                      Here is an html version which already shows it:
                                      http://htmlpreview.github.io/?https://github.com/ahambi/140824-TOC/blob/master/A%20floating%20table%20of%20contents.htm







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Aug 24 '14 at 13:42









                                      Anna ChristineAnna Christine

                                      4091 gold badge4 silver badges10 bronze badges




                                      4091 gold badge4 silver badges10 bronze badges
























                                          2
















                                          Introduction



                                          As @Ian and @Sergey have mentioned, nbextensions is a simple solution. To elaborate their answer, here is a few more information.



                                          What is nbextensions?




                                          The nbextensions contains a collection of extensions
                                          that add functionality to your Jupyter notebook.




                                          For example, just to cite a few extensions:




                                          • Table of Contents






                                          • Collapsible headings





                                          Install nbextensions



                                          The installation can be done through Conda or PIP



                                          # If conda:
                                          conda install -c conda-forge jupyter_contrib_nbextensions
                                          # or with pip:
                                          pip install jupyter_contrib_nbextensions


                                          Copy js and css files



                                          To copy the nbextensions' javascript and css files into the jupyter server's search directory, do the following:



                                          jupyter contrib nbextension install --user


                                          Toggle extensions



                                          Note that if you are not familiar with the terminal, it would be better to install nbextensions configurator (see the next section)



                                          You can enable/disable the extensions of your choice. As the documentation mentions, the generic command is:



                                          jupyter nbextension enable <nbextension require path>


                                          Concretely, to enable the ToC (Table of Contents) extension, do:



                                          jupyter nbextension enable toc2/main


                                          Install Configuration interface (optional but useful)



                                          As its documentation says, nbextensions_configurator provides config interfaces for nbextensions.



                                          It looks like the following:
                                          nbextensions configurators



                                          To install it if you use conda:



                                          conda install -c conda-forge jupyter_nbextensions_configurator


                                          If you don't have Conda or don't want to install through Conda, then do the following 2 steps:



                                          pip install jupyter_nbextensions_configurator
                                          jupyter nbextensions_configurator enable --user





                                          share|improve this answer



























                                          • This is a great and detailed answer. I guess enabling toc2/main is the same as checking "Table of Contents (2)" on localhost:8888/tree#nbextensions_configurator.

                                            – flow2k
                                            Aug 20 at 7:22















                                          2
















                                          Introduction



                                          As @Ian and @Sergey have mentioned, nbextensions is a simple solution. To elaborate their answer, here is a few more information.



                                          What is nbextensions?




                                          The nbextensions contains a collection of extensions
                                          that add functionality to your Jupyter notebook.




                                          For example, just to cite a few extensions:




                                          • Table of Contents






                                          • Collapsible headings





                                          Install nbextensions



                                          The installation can be done through Conda or PIP



                                          # If conda:
                                          conda install -c conda-forge jupyter_contrib_nbextensions
                                          # or with pip:
                                          pip install jupyter_contrib_nbextensions


                                          Copy js and css files



                                          To copy the nbextensions' javascript and css files into the jupyter server's search directory, do the following:



                                          jupyter contrib nbextension install --user


                                          Toggle extensions



                                          Note that if you are not familiar with the terminal, it would be better to install nbextensions configurator (see the next section)



                                          You can enable/disable the extensions of your choice. As the documentation mentions, the generic command is:



                                          jupyter nbextension enable <nbextension require path>


                                          Concretely, to enable the ToC (Table of Contents) extension, do:



                                          jupyter nbextension enable toc2/main


                                          Install Configuration interface (optional but useful)



                                          As its documentation says, nbextensions_configurator provides config interfaces for nbextensions.



                                          It looks like the following:
                                          nbextensions configurators



                                          To install it if you use conda:



                                          conda install -c conda-forge jupyter_nbextensions_configurator


                                          If you don't have Conda or don't want to install through Conda, then do the following 2 steps:



                                          pip install jupyter_nbextensions_configurator
                                          jupyter nbextensions_configurator enable --user





                                          share|improve this answer



























                                          • This is a great and detailed answer. I guess enabling toc2/main is the same as checking "Table of Contents (2)" on localhost:8888/tree#nbextensions_configurator.

                                            – flow2k
                                            Aug 20 at 7:22













                                          2














                                          2










                                          2









                                          Introduction



                                          As @Ian and @Sergey have mentioned, nbextensions is a simple solution. To elaborate their answer, here is a few more information.



                                          What is nbextensions?




                                          The nbextensions contains a collection of extensions
                                          that add functionality to your Jupyter notebook.




                                          For example, just to cite a few extensions:




                                          • Table of Contents






                                          • Collapsible headings





                                          Install nbextensions



                                          The installation can be done through Conda or PIP



                                          # If conda:
                                          conda install -c conda-forge jupyter_contrib_nbextensions
                                          # or with pip:
                                          pip install jupyter_contrib_nbextensions


                                          Copy js and css files



                                          To copy the nbextensions' javascript and css files into the jupyter server's search directory, do the following:



                                          jupyter contrib nbextension install --user


                                          Toggle extensions



                                          Note that if you are not familiar with the terminal, it would be better to install nbextensions configurator (see the next section)



                                          You can enable/disable the extensions of your choice. As the documentation mentions, the generic command is:



                                          jupyter nbextension enable <nbextension require path>


                                          Concretely, to enable the ToC (Table of Contents) extension, do:



                                          jupyter nbextension enable toc2/main


                                          Install Configuration interface (optional but useful)



                                          As its documentation says, nbextensions_configurator provides config interfaces for nbextensions.



                                          It looks like the following:
                                          nbextensions configurators



                                          To install it if you use conda:



                                          conda install -c conda-forge jupyter_nbextensions_configurator


                                          If you don't have Conda or don't want to install through Conda, then do the following 2 steps:



                                          pip install jupyter_nbextensions_configurator
                                          jupyter nbextensions_configurator enable --user





                                          share|improve this answer















                                          Introduction



                                          As @Ian and @Sergey have mentioned, nbextensions is a simple solution. To elaborate their answer, here is a few more information.



                                          What is nbextensions?




                                          The nbextensions contains a collection of extensions
                                          that add functionality to your Jupyter notebook.




                                          For example, just to cite a few extensions:




                                          • Table of Contents






                                          • Collapsible headings





                                          Install nbextensions



                                          The installation can be done through Conda or PIP



                                          # If conda:
                                          conda install -c conda-forge jupyter_contrib_nbextensions
                                          # or with pip:
                                          pip install jupyter_contrib_nbextensions


                                          Copy js and css files



                                          To copy the nbextensions' javascript and css files into the jupyter server's search directory, do the following:



                                          jupyter contrib nbextension install --user


                                          Toggle extensions



                                          Note that if you are not familiar with the terminal, it would be better to install nbextensions configurator (see the next section)



                                          You can enable/disable the extensions of your choice. As the documentation mentions, the generic command is:



                                          jupyter nbextension enable <nbextension require path>


                                          Concretely, to enable the ToC (Table of Contents) extension, do:



                                          jupyter nbextension enable toc2/main


                                          Install Configuration interface (optional but useful)



                                          As its documentation says, nbextensions_configurator provides config interfaces for nbextensions.



                                          It looks like the following:
                                          nbextensions configurators



                                          To install it if you use conda:



                                          conda install -c conda-forge jupyter_nbextensions_configurator


                                          If you don't have Conda or don't want to install through Conda, then do the following 2 steps:



                                          pip install jupyter_nbextensions_configurator
                                          jupyter nbextensions_configurator enable --user






                                          share|improve this answer














                                          share|improve this answer



                                          share|improve this answer








                                          edited Jun 16 at 14:55

























                                          answered Jun 15 at 9:38









                                          KeyMaker00KeyMaker00

                                          2,17528 silver badges31 bronze badges




                                          2,17528 silver badges31 bronze badges















                                          • This is a great and detailed answer. I guess enabling toc2/main is the same as checking "Table of Contents (2)" on localhost:8888/tree#nbextensions_configurator.

                                            – flow2k
                                            Aug 20 at 7:22

















                                          • This is a great and detailed answer. I guess enabling toc2/main is the same as checking "Table of Contents (2)" on localhost:8888/tree#nbextensions_configurator.

                                            – flow2k
                                            Aug 20 at 7:22
















                                          This is a great and detailed answer. I guess enabling toc2/main is the same as checking "Table of Contents (2)" on localhost:8888/tree#nbextensions_configurator.

                                          – flow2k
                                          Aug 20 at 7:22





                                          This is a great and detailed answer. I guess enabling toc2/main is the same as checking "Table of Contents (2)" on localhost:8888/tree#nbextensions_configurator.

                                          – flow2k
                                          Aug 20 at 7:22


















                                          draft saved

                                          draft discarded















































                                          Thanks for contributing an answer to Stack Overflow!


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid


                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.

                                          To learn more, see our tips on writing great answers.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function ()
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f21151450%2fhow-can-i-add-a-table-of-contents-to-an-ipython-notebook%23new-answer', 'question_page');

                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown







                                          Popular posts from this blog

                                          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                                          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                                          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript