12 Things to know about Jupyter Notebook Markdown

This article is about how to write jupyter notebook markdown.

Dayal Chand Aichara
Game of Data
4 min readApr 15, 2019

--

Jupyter notebook is in trend among data enthusiasts because it is easy to use, and it allows to create and share documents that contain live code, equations, visualizations and narrative text. Jupyter notebook is used for data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more.

Markdown writing skills are necessary to represent your work in jupyter notebook to provide enough explanation to reader about code and concept. In this article, you will learn how to write a good jupyter notebook markdown. I will cover 12 important things which will make you markdown expert. Let’s start.

Press ESC key to exit jupyter notebook cell. Press M to convert jupyter code cell to jupyter markdown.

  1. Headers
# header 1
## header 2
### header 3
#### header 4

Output:

2. Horizontal Line

Use any of three to draw a horizontal line. 
***
---
___

Output:

3. Text formatting

Text formatting is important in order to highlight important keywords.

a. Text color

<span style='color:green'> message/text </span>
Example:
<span style='color:Blue'> Blue is my favorite color. </span>

Output:

b. Text background

<span style='background:yellow'> message/text  </span>
Example:
## <span style='background :yellow' > Background color is yellow </span>

Output:

c. Text font-family

<span style='font-family:font_family name'> message  </span>
Examples:
## <span style='font-family:Georgia'> It is Georgia font.## <span style='font-family:Helvetica'> It is Helvetica font.## <span style='font-family:"Times New Roman"'> <span styel=''>It is "Times New Roman" font.## <span style='font-family:serif'> It is serif font.## <span style='font-family:sans-serif'> It is sans-serif font.

Output:

d. Text Emphasis

*Italic*  or _Italic_ 
**Bold**
***Bold and Italic***
~~Scratch Me.~~

Output:

f. Text in code style

`print('Hello World')`

Output:

4. Blockquotes

> 1 Blockquotes
>> 2 Blockquotes
>>> 3 Blockquotes
>>>> 4 Blockquotes
>>>>>>>> 8 Blockquotes

Output:

5. List

1. Main list <br>
a. Sub-list <br>
b. sub list
2. Main list
* main list

Output:

6. Table

| How | To | Make | a table|
| :---: | :---: | :---: | :---: |
| in | <span style= 'background:yellow'> Jupyter </span>| <span style= 'background:yellow'> Notebook </span>| <span style= 'background:yellow'> Markdown </span> |
| It | is | really| cool |

Note: Colons can be used to align columns.
:--- Left align
---: Right align
:---: Center align

Output:

7. Image insertion

![](c0ban_logo.png)

Output:

8. Link insertion

[My LinkedIn link ](https://www.linkedin.com/in/dcaichara/)

Output:

9. YouTube Video

[![YouTube Video Link](http://img.youtube.com/vi/YOUR_YUOTUBE_VIDEO_ID/0.jpg)](http://www.youtube.com/watch?v=YOUR_YUOTUBE_VIDEO_ID)Example: [![YouTube Video Link](http://img.youtube.com/vi/jqSuaRpCnro/0.jpg)](http://www.youtube.com/watch?v=jqSuaRpCnro)

Output:

If you click on image it will redirect you to youtube link address.

10. Image Link

[![photo link](DCA.jpg)](https://www.linkedin.com/in/dcaichara)

Output will be input image. If you click on image it will redirect you to link addresses.

11. Syntax highlighting

```python
A = "Python syntax highlighting"
print(A)
for i in range(0,10):
print(A)
```

Output:

12. Creating navigation within Jupyter Notebook

# Target cell
<a id =integer> </a>
# Navigation button
[text](#integer)
Example:
<a id =6> </a> <br> Start of Notebook
[Start of NoteBook](#6)

Output:

Click on the blue text line to go where black text line starts.

That’s it. I hope, this article will help to write a better markdown in jupyter notebook. You can find complete code on GitHub. You can also download jupyter notebook markdown cheatsheet. Please, reach out to me on twitter or LinkedIn in case you have any query.

Read my other articles here.

--

--

Dayal Chand Aichara
Game of Data

Data Scientist at KPMG Ignition Tokyo , Blockchain Enthusiast, Traveller, Trekker — https://www.linkedin.com/in/dcaichara/