IBM  Data Science  Experience

Markdown for Jupyter notebooks cheatsheet

Beautiful graphs in notebooks are great, but I want my explanatory text to look good too! Somehow I can't remember all the Markdown tags, so I created this cheatsheet.

Here's how to format Markdown cells in Jupyter notebooks in the IBM Data Science Experience.

Headings: Use #s followed by a blank space for notebook titles and section headings:
# title
## major headings
### subheadings
#### 4th level subheadings

Emphasis: Use this code: Bold: __string__ or **string** Italic: _string_ or *string*

Mathematical symbols: Use this code: $ mathematical symbols $

Monospace font: surround text with a back single quotation mark. (`) Use monospace for file path and file names and for text users enter or message text users see.

Line breaks: Sometimes markdown doesn’t make line breaks when you want them. Use this code for a manual line break: <br>.

Colors: Use this code: <font color=blue|red|green|pink|yellow>Text</font> Not all markdown code works within a font tag, so review your colored text carefully!

Indenting: Use a greater than sign (>) and then a space, then type the text. Everything is indented until the next carriage return.

Bullets: Use the dash sign (- ) with two spaces after it or a space, a dash, and a space ( - ), to create a circular bullet. To create a sub bullet, use a tab followed a dash and two spaces. You can also use an asterisk instead of a dash, and it works the same.

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.

Colored note boxes: Use one of these div tags. Not all markdown code works within a div tag, so review your colored boxes carefully!
<div class="alert alert-block alert-info">Tip: Use blue boxes for Tips and notes. If it’s a note, you don’t have to include the word “Note”.</div>
<div class="alert alert-block alert-warning">Example: Use yellow boxes for examples that are not inside code cells, or use for mathematical formulas if needed.</div>
<div class="alert alert-block alert-success">Up to you: Use green boxes sparingly, and only for some specific purpose that the other boxes can't cover. For example, if you have a lot of related content to link to, maybe you decide to use green boxes for related links from each section of a notebook. </div>
<div class="alert alert-block alert-danger">Just don't: In general, just avoid the red boxes.</div>

Graphics: You can use only graphics that are hosted on the web. You can't add captions for graphics at this time. Use this code:
<img src="url.gif" alt="Alt text that describes the graphic" title="Title text" />

Geometric shapes: Use this code with a decimal or hex reference number from here: UTF-8 Geometric shapes
&#reference_number

Horizontal lines: Use three asterisks: ***

Internal links: To link to a section, you need to add an ID for it right above the section title. Use this code: <a id="section_ID"></a>
Make sure that the section_ID is unique within the notebook.

Use this code for the link and make sure to test all the links! [section title](#section_ID)

External links: Use this code and test all links! __[link text](http://url)__

Inge Halilovic

Content strategist for IBM Data Science Experience.

San Francisco, California

Subscribe to IBM Data Science Experience Blog

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!