I'm trying to create a nested numbered list within a Jupyter Notebook Markdown cell for use as a table of contents which links to titles in the document. However the items in the list which should be nested/indented just appear on the same line when the cell has been executed.
I have tried using four spaces before the numbers I want indenting (which is what I've seen people suggesting). This didn't work so I also tried 1-3 spaces and using a tab but none seem to work. Thought it may be an issue with the numbering itself and the use of fullstops (i.e. "1." and "1.1" , and not "1.1." etc), but this doesn't fix the issue either.
The indent does work if i use an asterisk in place of 1.1, 1.2 etc., but this is not the format I want.
Markdown code example:
1. [Intro](#intro)
1.1 [Part A](#pA)
1.2 [Part B](#pB)
1.3 [Part C](#pC)
2. [Main](#main)
This code outputs:
1. Intro 1.1 Part A 1.2 Part B 1.3 Part C
2. Main
Desired output:
1. Intro
1.1 Part A
1.2 Part B
1.3 Part C
2. Main
Thank you in advance for any help.
Just add <br> where you would like to make the new line. Because jupyter notebook markdown cell is a superset of HTML.
You can mix ordered and unordered lists. To nest a paragraph or blockquote, indent by either 4 spaces or one tab. To nest a code block, indent by either 8 spaces or two tabs, or use a ``` code block.
Numbered lists: Start with 1. followed by a space, then it starts numbering for you. Start each line with some number and a period, then a space. Tab to indent to get subnumbering.
Both ! and % allow you to run shell commands from a Jupyter notebook. % is provided by the IPython kernel and allows you to run "magic commands", many of which include well-known shell commands. ! , provided by Jupyter, allows shell commands to be run within cells.
You need to add one of the following:
<br>
tag at the end of each line.for instance:
1. [Intro](#intro)<br>
1.1 [Part A](#pA)<br>
1.2 [Part B](#pB)<br>
1.3 [Part C](#pC)<br>
2. [Main](#main)<br>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With