May 11
3 min

Exploring RStudio’s Visual Markdown Editor

RStudio 1.4 was released in January 2021 and switched to calendar-based versioning as of 2021.09. Starting with 1.4, the IDE includes a visual markdown editor that works on any markdown-based document, such as .md or .Rmd files. Visual editing mode provides a better experience when writing reports and analyses. You can see changes in real-time and preview what your document looks like without re-knitting.

In addition, the visual markdown editor provides extensive support for citations, scientific and technical writing features, outline navigation, and more.

In this blog post, we’d like to show how to use the visual markdown editor and highlight some features that you should know.

## Get Started With the Visual Markdown Editor

To switch into the visual mode for a markdown document:

• In RStudio v2022.02, click the “Visual” button located on the left side of the editor toolbar.
• In earlier versions, click the compass icon located on the right side of the editor toolbar.

Alternatively, use the + + F4 keyboard shortcut.

Switching into the visual markdown editor mode

You can customize various editor settings. Go to Tools -> Global Options -> R Markdown -> Visual to choose your options, such as:

• Whether your new documents use the visual markdown editor by default.
• Whether the document outline shows by default.
• How to wrap text in the document.
Editor options

## Create Content in the Visual Markdown Editor

### How to embed rich media

Once in visual editing mode, you can paste rich content (tables, images, some formatting, etc.) into a document and match it in the source document.

Dragging and dropping an image into a document in visual editing mode

### How to use keyboard and markdown shortcuts

The visual mode supports both standard keyboard shortcuts (e.g., + B for bold) and markdown syntax.

Italicizing and bolding text with markdown and keyboard shortcuts

Here are some commonly used shortcuts:

Command Keyboard Shortcut Markdown Shortcut
Bold ⌘ B bold
Italic ⌘ I italic
Code ⌘ D code
R Code Chunk ⌥⌘ I `{r}

Check out more on the Editing Shortcuts page of the Visual R Markdown site.

### How to use the catch-all shortcut to insert anything

You can also use the catch-all + / shortcut to insert headings, comments, symbols, and more.

### How to use the editor toolbar

The editor toolbar includes buttons for common commands to edit formatting or insert content.

Inserting a table using the editor toolbar

## Edit content in visual editing mode

The visual markdown editor also provides efficient tools to edit and customize content.

### How to edit a table’s rows, columns, and alignment

Right-click on a table in your document. You can set the alignment, add or delete rows and columns, add a header, and more.

Adding a row and aligning a column

### How to change an image’s height, width, and aspect ratio

Once you have an image in your document, you can edit the size and aspect ratio with the visual markdown editor. Click on the image and a small window will appear. Edit the numbers to change the height, width, and aspect ratio.