How to write text in jupyter / ipython notebook?

Jupyter NotebookIpython

Jupyter Notebook Problem Overview


Here is an example of IPython notebook in which besides the input and output cells we have a plain text. How can I do the same in my IPython notebook? At the moment I have inly In and Out cells.

Jupyter Notebook Solutions


Solution 1 - Jupyter Notebook

Change the cell type to Markdown in the menu bar, from Code to Markdown. Currently in Notebook 4.x, the keyboard shortcut for such an action is: Esc (for command mode), then m (for markdown).

Solution 2 - Jupyter Notebook

As it is written in the documentation you have to change the cell type to a markdown.

enter image description here

Solution 3 - Jupyter Notebook

Simply Enter Esc and type m it will convert to text cell.

Solution 4 - Jupyter Notebook

Step 1: Click on the '+' to create a new cell, type some text in, and select 'Markdown' in the dropdown

enter image description here

Step 2: It should now look like this:

enter image description here

Step 3: Click anywhere in the cell and click on 'Run'. Now it looks how you expect it to.

enter image description here

Solution 5 - Jupyter Notebook

Adding to Matt's answer above (as I don't have comment privileges yet), one mouse-free workflow would be:

Esc then m then Enter so that you gain focus again and can start typing.

Without the last Enter you would still be in Escape mode and would otherwise have to use your mouse to activate text input in the cell.

Another way would be to add a new cell, type out your markdown in "Code" mode and then change to markdown once you're done typing everything you need, thus obviating the need to refocus.

You can then move on to your next cells. :)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRomanView Question on Stackoverflow
Solution 1 - Jupyter NotebookMattView Answer on Stackoverflow
Solution 2 - Jupyter NotebookSalvador DaliView Answer on Stackoverflow
Solution 3 - Jupyter NotebookmlbishnoiView Answer on Stackoverflow
Solution 4 - Jupyter NotebookstevecView Answer on Stackoverflow
Solution 5 - Jupyter NotebookGauravView Answer on Stackoverflow