Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested numbered list do not break line in Jupyter Notebook Markdown

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.

like image 860
MatthewCarterIO Avatar asked Jul 28 '18 17:07

MatthewCarterIO


People also ask

How do you break a line in Jupyter markdown?

Just add <br> where you would like to make the new line. Because jupyter notebook markdown cell is a superset of HTML.

How do you indent a numbered list in markdown?

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.

How do I make a numbered list in Jupyter notebook?

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.

What does %% do in Jupyter notebook?

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.


1 Answers

You need to add one of the following:

  • two white spaces at the end of each line, or
  • a <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>
like image 175
Reblochon Masque Avatar answered Sep 28 '22 12:09

Reblochon Masque