Keyboard shortcuts shown use Mac keys. On Windows or Linux, use Ctrl in place of ⌘ (Command).
Text formatting
GitBook supports all the classic inline Markdown formatting options:| Formatting | Markdown | Keyboard shortcut |
|---|---|---|
| Bold | **Bold** | ⌘ + B |
| Italic | _Italic_ | ⌘ + I |
~~Strikethrough~~ | ⇧ + ⌘ + S | |
Code | `Code` | ⌘ + E |
Examples
- Visual editor
- Markdown
Select text and choose formatting from the context menu, or use keyboard shortcuts while typing.
Links
Keyboard shortcut: ⌘ + K When you add a link, you’ll be prompted to provide the URL. You can add any URL, but for links to other pages in your space, use relative links to keep references up to date automatically.Link types
Relative links connect to other pages in your GitBook space. If the page’s URL, name, or location changes, the reference stays up to date—resulting in fewer broken links. Absolute links are external URLs you can paste directly into your content. Perfect for linking to resources outside your documentation. Email links use themailto: protocol to open the user’s email client with a pre-filled address.
Examples
This is a link to an external page. This is a link to another page in this space. This is a link to a section on this page. This is a link that starts an email.Color and background color
Click the color icon in the context menu to choose a color for text or its background.Inline content
The inline palette lets you quickly add extra content to your text without moving your hands away from the keyboard. Press/ in any text block to open it.
Annotations
Annotations add extra context to your words without breaking the reader’s flow. Use them to explain terms, insert additional information, or provide references. Readers can hover over annotated text to see the annotation. Create an annotation:- Select the text you want to annotate
- Click Annotate in the context menu
- Write your annotation
- Click outside to continue writing
In Markdown, annotations are written as footnotes. Place footnote indicators immediately after the word—not after punctuation.
Inline images
Inline images sit alongside your text on the page. By default, they’re set to their original size with a maximum width of 300px. Size options:- Inline size — Proportionally sized to the font (great for icons and badges)
- Original size — Original size with 300px maximum width
- Convert to block — Turns the image into a full-width image block
Emojis
Add emojis by pressing/ to open the inline palette, or type : and start typing an emoji name for autocomplete suggestions.
Math and TeX
Create inline math formulas using KaTeX syntax:You can also insert block-level math formulas by opening the command palette in an empty block.
Buttons
Buttons are perfect for calls to action. Use them to send users to other pages in GitBook or external URLs. Buttons have both primary and secondary styles:Primary button
Use for main actions
Secondary button
Use for alternative actions
Icons
Add visual indicators inline with your text. Icons use the visual style from your customization settings and support Font Awesome icons.Expressions
Expressions display content dynamically from variables. Insert them from the/ menu, then click to open the expression editor where you can reference and conditionally format variables.
Pasting Markdown
When pasting Markdown content into the editor, use Paste and Match Style (⇧ + ⌘ + V on Mac, ⇧ + Ctrl + V on Windows).Using standard paste for Markdown copied from another editor may insert it as a code block instead of formatted text.
Markdown syntax reference
Headings
Code blocks
```⏎creates a new code block```py⏎creates a code block with Python syntax highlighting
Lists
GitBook automatically detects and creates lists as you type:- Begin with
-or*for bullet lists - Begin with
1.for numbered lists - Begin with
- [ ]for task lists
Press Tab to indent and Shift+Tab to outdent in any list.
Quotes
Begin a line with> to create a block quote. Select an entire paragraph and type > to wrap it in a block quote.
This is a block quote.
Dividers
Type--- then press Enter to create a horizontal divider.
This is an example of a divider.