Numbered headers in jupyter notebooks

后端 未结 3 2016
时光取名叫无心
时光取名叫无心 2021-02-18 18:02

I\'d like to change the way Jupyter displays the so called heading cells. By default, heading levels are only differentiated through a different font size. I\'d like j

相关标签:
3条回答
  • 2021-02-18 18:17

    What you like is actually the default display style of jupyter notebook.

    Input cell with markdown: Input cell with markdown

    notebook display: notebook display

    tested on notebook version 5.4.0

    0 讨论(0)
  • 2021-02-18 18:20

    There is on tiny step I may overlooked:

    conda> jupyter contrib nbextension install --user      # to activate js
    

    perfectly explained in: http://jupyter-contrib-nbextensions.readthedocs.io/en/latest/

    0 讨论(0)
  • 2021-02-18 18:29

    If it's only about getting the headings and numbering, then use markdown syntax, you wouldn't need any extensions (as suggested in Xiaodong's answer).

    If you're trying to not only number your headings, but also looking for something that actually organizes and help you navigate around the notebook in addition to just numbering, then you will need ToC2 extension.

    1. Install nbextensions and it's control panel

      conda install -c conda-forge jupyter_contrib_nbextensions jupyter_nbextensions_configurator
      
    2. Enable ToC2

    1. Refresh and you now have nicely organized notebook

    0 讨论(0)
提交回复
热议问题