Markdown Syntax Reference
On this page
This reference covers the core Markdown syntax including the features added by Notebooks. It then goes over the extensions offered by Notebooks’ two included converters, Discount (the default) and MultiMarkdown, which bring their own set of extensions as well.
Markdown Syntax with Notebooks Extensions#
The standard Markdown syntax as defined by John Gruber is documented on his Markdown website. This chapter is a summary and includes the extensions added by Notebooks.
Paragraphs and Newlines#
By Markdown standards, a single newline won’t create a line break. Instead, you need to end a line with two consecutive spaces to see a line break in the rendered output.
Make Every Newline a Line Break#
While requiring two spaces at the end of a line improves readability in plain text, it can be a hassle. That is why Notebooks provides a setting called Make every newline a line break. When you turn it on, Notebooks automatically adds two spaces at the end of each line, making sure that a return in your text always creates a line break in the rendered output.
Headers#
To define a header, start a line with 1–6 hash (#) characters, without any leading spaces. You can optionally terminate the header with the same number of hash characters. These are called atx style headers.
# This is a level one header (H1)
## This is a level two header (H2) ##
###### This is a level six header (H6)
The row of extra keyboard keys includes a dedicated ## key, which you can use to adjust the heading level of the current line or selection. Tap the button to increase the heading level, tap and hold it to reset.
Use the keyboard shortcuts cmd-1 to cmd-5 to assign the corresponding heading level to the current line or selection. Use cmd-0 to reset.
Notebooks uses headers to create the Table of Contents, and you can use them as cross references, too. If Notebooks is set to highlight Markdown syntax, headings appear colorized with hanging indents, so the text is left aligned and easier to read.
Headers – Setext Style#
An alternative notation for headings of level one and two is Setext style: just use = or - to underline the corresponding heading. The number of underline characters does not need to match the title; a single character is already sufficient.
This is a level one header
==========================
And this is level two
---------------------
This is level two, too
-
Anchors and Cross References#
Markdown uses your headers for its Table of Contents and automatically creates anchors for this purpose. However, the anchors’ format depends on the Markdown converter you choose. For the chapter Anchors and Cross References, for example, the anchors would look like this:
Default Converter: Anchors-and-Cross-References
MultiMarkdown: anchorsandcrossreferences
To eliminate dependence on the selected converter or to create shorter, more memorable anchors, you can define them yourself. Append the anchor to the heading and enclose it in square brackets:
## Anchors and Cross References [anchors]
So you can reference [the chapter](#anchors) like this.
Emphasis (Bold and Italic)#
Use asterisks * and underscores _ as indicators of emphasis. Text wrapped with one of these characters appears italic, text wrapped with two characters appears bold.
this is *italic* and this is **bold**, and this is ***bold and italic***
this is _italic_, too, if you prefer
The row of extra keyboard keys includes the Markdown formatting keys BIUS, which add the corresponding formatting characters to selected text. To remove a format, select the text without its leading and trailing formatting characters, then use the same key again.
Use cmd-B for bold, cmd-I for italic, cmd-U for underline and cmd-— for strike through. (Depending on your selected Markdown converter, strike through uses a different syntax.) To remove a format, select the text without its leading and trailing formatting characters, then use the same command again.
Highlight Text#
Text highlighting is not supported by standard Markdown, but it is a convenient and frequently used way of emphasizing text, so Notebooks adopts a commonly used syntax.
To ==highlight text==, just place it between double equal signs.
When using an external keyboard, you can use shift-alt-cmd-H to add the equal signs to the selected text; if the selected text is already enclosed by equal signs, the shortcut removes them.
Lists: Bulleted, Ordered and Checklists#
Bulleted Lists#
Bulleted or unordered lists use asterisk *, plus + or hyphen - as list markers.
- Red
- Green
- Blue
Ordered Lists#
Ordered lists use a number followed by a period. The actual number you use has no effect on the result; lists always start at 1.
1. Red
2. Green
3. Blue
To prevent accidentally starting an ordered list, escape the period like this: 10\. Anniversary
Checklists#
Checklists are an extension of standard Markdown. In the rendered output, Notebooks displays them as clickable checkboxes, and when you click a checkbox, Notebooks updates the Markdown text to set the task’s state.
- [ ] Red
- [ ] Green
- [x] Blue ... this renders as a "done" item in the list
This is what the rendered checklist looks like with any of Notebooks’ document styles, or a custom style that inherits from one of them:
- Red
- Green
- Blue … this renders as a “done” item in the list
Notebooks provides a dedicated extra keyboard key to cycle through the list styles.
On a Mac or when using an external keyboard, use cmd-L to cycle through the list style for the current line or selection. Use shift-cmd-L to cycle in reverse order.
Notebooks can detect and automatically align lists, which makes creating and managing lists a breeze.
- Turn on this option in Settings > Editing > Markdown.
- When editing a list, press
returnto create a new list entry on the next line. - To indent or outdent list items, use
TABandshift-TAB, orcmd-]andcmd-[on an external keyboard. On iPhone or iPad, tap or tap and hold the⇥extra keyboard key. - Press
returnon a line which contains nothing but a list marker to outdent the line if possible, or terminate the list.
To enhance readability, Notebooks displays multiline paragraphs with hanging indents: the text aligns with the first character’s left edge, while list markers remain outdented.
Definition Lists (Description Lists)#
Definition lists, also known as description lists, group a set of terms and their definitions. You can see an example in the section about Footnotes below. Again, Notebooks supports multiple flavors.
PHP Markdown style definition lists look like this:
Apple
: Pomaceous fruit of plants of the genus Malus in the family Rosaceae.
Orange
: The fruit of an ~~evergreen~~ tree of the genus Citrus
If you use Notebooks’ default converter, you can also use the following notation:
=Apple=
Pomaceous fruit of plants of the genus Malus in the family Rosaceae.
=Orange=
The fruit of an ~~evergreen~~ tree of the genus Citrus
Blockquotes#
Blockquotes by default are indented paragraphs, similar to quotes in email replies.
> This is quoted text.
>> With a nested quote.
John Gruber describes more variations for blockquotes. Depending on their style and layout, blockquotes can also serve as boxes or callouts. The Autodetect and Align Lists box above is actually a Markdown blockquote.
Code Blocks#
The Markdown samples throughout this reference are formatted as code blocks. Text in code blocks is displayed verbatim, usually in a fixed width font and without extra formatting or line breaks.
The Markdown default is to indent a line with one tab or four spaces. You can further indent the code with more spaces and tabs.
While this is a regular paragraph,
this is a code block
Fenced Code Blocks#
With longer blocks, indenting the text may become tedious. Instead, use fenced code blocks by enclosing the lines with three backtick characters:
```
This text appears as a code block, in back tick notation.
```
Fenced code blocks are especially convenient for code samples, as they allow you to specify the programming language. When using Notebooks’ Source Code document style (or one inheriting from it), the code is highlighted accordingly.
``` html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
...
</html>
```
Inline Code#
To format just a few words or characters as code without giving them a separate block (to display them inline), enclose them in backticks `.
Use the shortcut `cmd-S` to save a version in Notebooks for Mac.
To use a single backtick in code, add `` ` ``.
Horizontal Line#
To insert a horizontal line as thematic break, add three or more asterisks *, hyphens - or underscores _ on a line:
***
Links and Wiki Links#
Standard Markdown supports inline links and reference-style links, and Notebooks adds support for wiki-style links as well.
Inline Links#
Inline links define text and URL in one place, with the link’s text in square brackets, immediately followed by the URL in parentheses. The URL can be any absolute or relative URL, including a reference to an anchor in the same document.
An inline link to [Notebooks](https://notebooksapp.com) looks like this.
A link to a [section](#section) looks like that.
Reference-style Links#
If you need to reuse the same URL multiple times in a document, reference-style links may be more convenient. They use a label instead of the URL, which results in more readable Markdown text. The label can be defined anywhere in the text.
This is a reference style link to [Notebooks][nbks].
[nbks]: https://notebooksapp.com "Notebooks"
Another shortcut is to use the link text as label, in which case you can add empty square brackets instead of the label.
This is a reference style link to [Notebooks][].
[Notebooks]: https://notebooksapp.com "Notebooks"
Again, John Gruber provides more examples.
Wiki Links#
Wiki links use a simpler, more consistent notation than standard Markdown: usually one phrase in double square brackets, which is both the link’s label and its target.
Learn more about [[Link Management in Notebooks]].
Wiki links are flexible, with a variety of options, and they are covered in more detail in a separate chapter.
Images#
The notation for images is very similar to that of links, except for the leading !:

![another image][img]
[img]: media/screenshot.jpeg
Comments#
One of Notebooks’ Markdown settings allows you to use comments in your Markdown text. Comments are lines or paragraphs of text which do not appear in the rendered output, so they are great for notes, revisions etc. To define a comment, start a line with //.
// This is a comment which will not appear in the rendered output.
Notebooks handles comments like lists: when you press return on a line starting with //, Notebooks prefixes the next line with // to continue the comment. If you press return again without typing any text, Notebooks terminates the comment section.
Footnotes#
Notebooks supports multiple flavors of footnotes. None of them is part of standard Markdown, but all notations are supported by both of Notebooks’ Markdown converters.
- PHP Markdown Extra Notation
- This is some text with a footnote
[^1]. The footnote itself can be defined anywhere in the text, but it needs to start at the beginning of a line:[^1]: Here is the footnote. - MultiMarkdown Inline Notation
- MultiMarkdown lets you define footnotes in place, which may make them easier to manage:
[^Here is the text which becomes your footnote.] - Obsidian Style Inline Notation
- A variation of the MultiMarkdown inline footnote (watch the position of the caret):
^[Here is the footnote.] - Refnotes Notation
- For compatibility with footnote and reference management tools, Notebooks supports the Refnotes notation as well:
<<fnote "This is a Refnote style footnote">>
Class Blocks#
Class blocks assign a specific class to the subsequent block of text:
> %class-name%
This text will be enclosed in <div class="class-name">.
Class blocks are an extension added by Discount, but they are so convenient that Notebooks supports them in both converters.
Pagebreak#
When preparing a document for print or PDF output, proper page breaks are essential. There is no standard syntax in Markdown, so Notebooks uses its own notation:
{{pagebreak}}
Internally, Notebooks uses Discount’s class block syntax to implement page breaks, so you could also use:
> %pagebreak%
On screen, this page break produces a horizontal line labeled “Page Break”; in print it produces a page break.
The Document Style you use should inherit from one of Notebooks’ predefined styles to guarantee that page breaks work as expected.
Table of Contents#
The table of contents is a structured list of clickable links to the headers in the document. One way to add it to a Markdown document is to select Show TOC from the document’s action menu. By default, this adds the table of contents at the top of the document – or just below the Pandoc header, in case you use one.
Notebooks gives you more control over position and content of the Table of Contents with the following notations. Please note that you need to add an empty line above and below:
| Notation | Output |
|---|---|
<TOC> | Insert the full TOC at this position |
{{TOC}} | Same as above, but more standard |
{{TOC:2}} | TOC for level 2 headers only |
{{TOC:2-}} | TOC for level 2 and higher |
{{TOC:2-3}} | TOC for level 2 and level 3 only |
Tables#
Tables in Notebooks follow Michel Fortin’s PHP Markdown definition. Here is an example of a table with two columns:
First Header | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell
Standard HTML Code#
For any formatting that is not available in Markdown, you can use HTML. There’s no need for special prefixes or delimiters — just use the HTML tags directly.
Markdown Syntax Extensions Provided by Discount#
Notebooks’ default Markdown converter Discount adds a few extras which are neither available in standard Markdown nor in MultiMarkdown, Notebooks’ alternative converter.
Struck Through Text#
To render text as struck through, enclose it with ~~.
This is the code for ~~struck through~~ text.
When using an external keyboard, you can use the keyboard shortcut cmd-—. If you use MultiMarkdown as converter, this shortcut inserts the HTML code instead.
Centered Alignment#
To center a paragraph, wrap it with -> and <-:
->This is a centered paragraph.<-
Fenced Blocks – Alternative#
As an alternative to the backtick notation, enclose the lines of text with at least three ~ characters.
~~~
This text appears as a code block
~~~
Pandoc Style Document Headers#
If the first three lines in your document begin with a % character, Notebooks recognizes them as document header:
% Title
% Author
% Date
When creating the rendered version, Notebooks uses the document header to produce a formatted title.
Notebooks’ built-in document styles define a specific layout for this header, using H1.title, H2.author and H3.date.
Markdown Syntax Extensions Provided by MultiMarkdown#
MultiMarkdown is a very capable Markdown converter with many additional options like glossaries, abbreviations, file transclusion, and much more. The detailed and most up to date documentation is available on the MultiMarkdown website; here is a summary of the most important options for quick reference.
These extensions are only supported with MultiMarkdown selected as Markdown converter.
Abbreviations#
[>NBKS] is an abbreviation, defined further down.
[>(MD) Markdown] is another abbreviation, defined inline.
[>NBKS]: Notebooks
Citations#
You can use reference style citations to attribute a source [p. 23][#NB:2018],
but you can also use them inline [#Notebooks. *The Joy of Writing*. 2016.]
[#NB:2018]: Notebooks. *Don't Fear the Blank Page*. 2018.
Citations are appended at the end of the document, in their own section, similar to footnotes.
CriticMarkup#
With CriticMarkup, editors and authors can track changes in plain text documents. It uses five types of marks to denote changes:
- Addition
{++ ++} - Deletion
{-- --} - Substitution
{~~ ~> ~~} - Comment
{>> <<} - Highlight
{== ==}{>> <<}
By default, Notebooks incorporates (accepts) the tracked changes in the rendered output, so the marks are invisible. You can toggle their visibility from the document’s ••• menu.
Glossaries#
By default, the glossary is appended at the end of the document, similar to footnotes and citations. When used with LaTeX (by duplicating a Markdown document as LaTeX), you can build a glossary chapter at the end of the document.
As usual, you can define an inline [?(glossary) The glossary collects information
about important terms used in your document], or you can use the [?Reference Style].
[?reference style]: Reference style adds the definition of the glossary term elsewhere in the document.