Have this cheat sheet at your fingertips
Download PDFFormatting Text Spans
Surround text with a single asterisk or underscore for emphasis (italics)
she thought in *italics* she thought in _italics_ |
she thought in italics |
Surround text with double asterisks or underscores to make it bold
to **boldly** go |
to boldly go |
Boldness and emphasis can be nested for bold-italic text
**Boldness has *genius*, _power_, and *magic*** in it |
Boldness has genius, power, and magic in it |
Surround text with one of more backticks to make it code
Should I use `pandas` or `dplyr`? |
Should I use |
Surround text with one of more tildes to strike it through
Every strike brings me ~closer to~ the next home run |
Every strike brings me closer to the next home run |
Surround text with a single dollar sign to make it a LaTeX equation
$e^{\pi i} + 1 = 0$ |
|
Formatting Text Blocks
Start a line with greater than then space to make it a quote
> Without data you're just > another person with an opinion |
|
Surround a block of text with lines starting with three backticks to make it a code block
``` x = (1 + sqrt(5)) / 2 ``` |
|
Optionally specify the language of the code after the backticks to highlight syntax
``` python x = (1 + sqrt(5)) / 2 ``` |
|
Lists
Start lines with hyphens, plus or asterisks then a space to make an unordered list
(Be consistent about which punctuation is used)
- bread - milk - eggs - teabags |
|
Start lines with a number followed by a period then a space to make an ordered list.
(Numbering is automatic and follows from the first element.)
3. three 1. four 1. five 1. six |
|
Inside a list, include square brackets filled with a space or character (conventionally 'x') to create a checklist
- [x] bread - [ ] milk - [x] eggs - [ ] teabags |
Use space indentation to nest lists
* The Lord of the Rings 1. The Fellowship of the Ring 1. The Ring Sets Out 1. The Ring Goes South 1. The Two Towers 1. The Treason of Isengard 1. The Ring Goes East 1. The Return of the King 1. The War of the Ring 1. The End of the Third Age |
|
Headings
Start a line with one to six hashes then a space to make it a heading
# Constitution of the United States ## Articles ### Article I: The Legislative Branch #### Section 1: The Legislature |
Constitution of the United StatesArticlesArticle I: The Legislative BranchSection 1: The Legislature |
For level one headings, you can also follow the line with a line of equals signs
Constitution of the United States ================================= |
Constitution of the United States |
For level two headings, you can also follow the line with a line of hyphens
Articles -------- |
Articles |
Links, Images and Footnotes
Use square brackets containing link text followed by parentheses containing a URL to include a hyperlink
[Build data and AI skills with DataCamp](https://www.datacamp.com) |
Use square brackets containing link text followed by a reference number, then (usually at the bottom of the doc) square brackets containing the reference number followed by a colon then a space then a URL to include reference-style hyperlinks.
[Listen to DataFramed][1] [1]: https://www.datacamp.com/podcast |
Use an exclamation mark followed by square brackets containing alt text followed by parentheses containing a URL or path to a file to include an image
 |
|
Use square brackets containing a caret then a number (both within the content and at the foot of the page) to create a footnote.
Literature is the original Internet – every footnote, every citation, every allusion is essentially a hyperlink to another text, to another mind.[^1] [^1]: Attributed to Maria Popova |
Tables
Use pipes to delimit columns in a table. Use hyphens to separate the header from the content. Use a colon to the left or right of those hyphens to indicate column alignment.
| Sepal Length| Sepal Width| Petal Length| Petal Width| Species |
|-----------------:|----------------:|-----------------:|---------------:|:---------------|
| 5.1| 3.3| 1.7| 0.5| setosa |
| 4.8| 3.0| 1.4| 0.1| setosa |
| 6.1| 2.8| 4.7| 1.2| versicolor |
| 6.1| 3.0| 4.6| 1.4| versicolor |
Sepal Length |
Sepal Width |
Petal Length |
Petal Width |
Species |
5.1 |
3.3 |
1.7 |
0.5 |
setosa |
4.8 |
3.0 |
1.4 |
0.1 |
setosa |
6.1 |
2.8 |
4.7 |
1.2 |
versicolor |
6.1 |
3.0 |
4.6 |
1.4 |
versicolor |
Breaks
Have a line with only three or more hyphens, asterisks, or underscores (plus optional spaces) to include a horizontal rule.
--- *** ___ |
|
By default, text on consecutive lines flows as a single line.
Writing one line, then another without a break, results in text flowing as a single line. |
Writing one line, then another without a break, results in text flowing as a single line. |
Two spaces at the end of a line result in a line break.
Appending two spaces to the end of the line¶¶ creates a line break. |
Appending two spaces to the end of the line creates a line break. |
Blank lines create a new paragraph.
Including a blank line in between two lines of text creates a paragraph break. |
Including a blank line in between two lines of text creates a paragraph break. |