Skip to content

nbconvert -Number Headings when exporting from jupyter ipython to html #1586

@oracle1987

Description

@oracle1987

Im trying to export a ipynb notebook to html while maintaining the headers numbered with # in markdown cells, however, when i export using the following terminal command, the numbering of the sections is ignored.

Note: Headings auto-generated using toc nbextension.

terminal command:
jupyter nbconvert --TemplateExporter.exclude_input=True --no-prompt --to html sample.ipynb

To generate the numbered headings content of notebook is as follows(please ignore brackets below):

(#) SectionA

(##) SubsectionA1

(##) SubsectionA2

Please advise how can the numbering be maintained as per the defined hashtags when exporting to html.

Activity

gitcuz

gitcuz commented on Dec 11, 2021

@gitcuz

Any progress? I'm also interested in this feature.

oracle1987

oracle1987 commented on Dec 11, 2021

@oracle1987
Author

Try adding '_toc'as follows:
jupyter nbconvert --TemplateExporter.exclude_input=True --no-prompt --to html_toc filename.ipynb

DheemanthBhat

DheemanthBhat commented on Jan 14, 2023

@DheemanthBhat

+1

JingyiShi

JingyiShi commented on Aug 26, 2023

@JingyiShi

Following. Still have the same issue in 2023. The command above did not work for me.

guigoruiz1

guigoruiz1 commented on Dec 12, 2023

@guigoruiz1

Hello,

I have the same problem

letian-w

letian-w commented on Apr 4, 2024

@letian-w

Same problem.

linked a pull request that will close this issue on Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @DheemanthBhat@letian-w@JingyiShi@guigoruiz1@gitcuz

      Issue actions

        nbconvert -Number Headings when exporting from jupyter ipython to html · Issue #1586 · jupyter/nbconvert