Skip to main content
GitBook’s visual editor makes it easy to format your content. Simply select text and choose a format from the context menu, use keyboard shortcuts, or write Markdown directly in the editor.
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:
FormattingMarkdownKeyboard shortcut
Bold**Bold**⌘ + B
Italic_Italic_⌘ + I
Strikethrough~~Strikethrough~~⇧ + ⌘ + S
Code`Code`⌘ + E

Examples

Select text and choose formatting from the context menu, or use keyboard shortcuts while typing.
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. 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 the mailto: 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:
  1. Select the text you want to annotate
  2. Click Annotate in the context menu
  3. Write your annotation
  4. 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: f(x)=xe2piiξxf(x) = x * e^{2 pi i \xi x}
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

# Heading 1
## Heading 2
### Heading 3

Code blocks

  • ```⏎ creates a new code block
  • ```py⏎ creates a code block with Python syntax highlighting
Syntax highlighting uses Prism.

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.

Build docs developers (and LLMs) love