Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make a new line in a jupyter markdown cell

md $S$: a set of shops $I$: a set of items M wants to get

I'd like to make a new line between this two sentences. We usually put " (space)" after the first sentence before a new line, but it doesn't work in Jupyter.

How can I do this? Should I put "enter" twice after the first sentence?

like image 402
hrsma2i Avatar asked Jan 28 '17 04:01

hrsma2i


People also ask

How do you add a new markdown cell below an existing cell?

Press M whilst in command mode (highlight around the selected cell should be blue, not green), use Esc to switch to command mode and Enter to switch back to edit mode. So, if you're editing a cell, the key presses to change the cell to a markdown cell are Esc , M , Enter .

How do you write multiple lines in a jupyter notebook?

In order to enter more than one statements in a single input cell, press ctrl+enter after the first line. Subsequently, just pressing enter will go on adding new line in the same cell. To stop entering new lines and running cell, press enter key one more time at the end.

How do you go down a line in jupyter notebook?

You can select the line with mouse in jupyter notebook. Drag it up or down before the line where you want to move it. Press > button on keyboard while your text is still selected. This will bring the cursor to end of selected line, but before the text of line being replaced.


2 Answers

Just add <br> where you would like to make the new line.

$S$: a set of shops <br> $I$: a set of items M wants to get 

Because jupyter notebook markdown cell is a superset of HTML.
http://jupyter-notebook.readthedocs.io/en/latest/examples/Notebook/Working%20With%20Markdown%20Cells.html

Note that newlines using <br> does not persist when exporting or saving the notebook to a pdf (using "Download as > PDF via LaTeX"). It is probably treating each <br> as a space.

like image 90
Woooody Amadeus Avatar answered Sep 23 '22 02:09

Woooody Amadeus


"We usually put ' (space)' after the first sentence before a new line, but it doesn't work in Jupyter."

That inspired me to try using two spaces instead of just one - and it worked!!

(Of course, that functionality could possibly have been introduced between when the question was asked in January 2017, and when my answer was posted in March 2018.)

like image 29
violet Avatar answered Sep 22 '22 02:09

violet