Markdown Syntax

This document describes some of the more important parts of Markdown (for writers, that is). There's a lot more to the syntax than is mentioned here, though. To get the full syntax documentation, go to John Gruber's Markdown Syntax page

Headers

For top-level headers underline the text with equal signs. For second-level headers use dashes to underline.

Markdown
This is an H1
=============
Result

This is an H1

Markdown
This is an H2
-------------
Result

This is an H2

If you would rather, you can prefix headers with a hash (#) symbol instead. The number of hash symbols indicates the header level. For example, a single hash indicates a header level of one while two indicates the second header level:

Markdown
# This is an H1
## This is an H2
### This is an H3
Result

This is an H1

This is an H2

This is an H3

Which you choose is a matter of style. Whichever you thinks looks better in the text document. In both cases, the final, fully formatted, document looks the same.

Paragraphs

Paragraphs are surrounded by blank lines.

Markdown
This is paragraph one.

This is paragraph two.
Result

This is paragraph one.

This is paragraph two.

Formatting

To indicate bold text surround the text with two star (*) symbols or two underscore (_) symbols:

Markdown
**This is bold**
__This is also bold__
Result

This is bold

This is also bold

To indicate italicized text surround the text with a single star (*) symbol or underscore (_) symbol:

Markdown
*This is italics*
_This is also italics_
Result

This is italics

This is also italics

To indicate italicized and bold text surround the text with three star (*) symbol or underscore (_) symbol:

Markdown
***This is bold and italics***
___This is also bold and italics___
Result

This is bold and italics

This is also bold and italics

Blockquotes

To create an indented area use the right angle bracket (>) character before each line to be included in the blockquote.

Markdown
> This is part of a blockquote.
> This is part of the same blockquote.
Result
This is part of a blockquote.
This is part of the same blockquote.

Rather than putting it in front of each line to include in the block quote you can put it at the beginning and end the quote with a newline.

Markdown
> This is part of a blockquote.
This continues the blockquote even though there's no bracket.

The blank line ends the blockquote.
Result
This is part of a blockquote. This continues the blockquote even though there's no bracket.

The blank line ends the blockquote.

Lists

To create a numbered list in Markdown, prefix each item in the list with a number followed by a period and space. The number you use actually doesn't matter.

Markdown
1. Item 1
2. Item 2
3. Item 3
Result
  1. Item 1
  2. Item 2
  3. Item 3

To create a bulleted list, prefix each item in the list with a star (*) character.

Markdown
* A list item
* Another list item
* A third list item
Result
  • A list item
  • Another list item
  • A third list item

Code

Surround code within a sentence with backticks (`). For a block of code, put three backticks on the lines before and after it; the name of the language after the first three gives it the right colours.

Markdown
Use the `read.csv()` function:

```r
data <- read.csv("plots.csv")
```
Result

Use the read.csv() function:

data <- read.csv("plots.csv")

Tables

Separate the cells with vertical bars (|) and put a line of dashes under the header row. A colon on the right of the dashes aligns the column to the right, on both sides centres it.

Markdown
| Plot | Trees |
| ---- | ----: |
| A1   |    12 |
| B2   |     7 |
Result
PlotTrees
A112
B27

The editor

The buttons above the text box add the Markdown for you. Their keyboard shortcuts (Cmd instead of Ctrl on a Mac):

KeysDoes
Ctrl+BBold
Ctrl+IItalic
Ctrl+KLink
Ctrl+EInline code
Ctrl+Z, Ctrl+YUndo, redo
Ctrl+Shift+VPaste as plain text
Ctrl+EnterPost
Tab, Shift+TabIndent or outdent list items and code
Esc, then TabLeave the text box (Tab elsewhere leaves it too)

In the toolbar, the arrow keys move between the buttons. Enter after a list item starts the next one; Enter on an empty item ends the list.

Paste or drop images into the text box to upload them, or use the image button. Text pasted from a web page or a document keeps its links, bold and italic text, lists, headings, code and tables, written as Markdown.

A Lot More

There's a lot more to the Markdown syntax than is mentioned here. But for creative writers, this covers a lot of the necessities. To find out more about Markdown than you'd ever want to really know, go to the Markdown page where it all started.

Keyboard shortcuts

Anywhere

?
Show this list
/
Search
g h
Go to the home page
g q
Go to the questions
g t
Go to the tags
g u
Go to the users
a
Ask a question

Lists of questions

j k
Next or previous question
Enter
Open the question

Question pages

j k
Next or previous post

Shortcuts never apply while you type in a text field. Members can turn them off in their preferences.