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.
To switch into the visual mode for a markdown document:
Alternatively, use the ⇧ + ⌘ + F4 keyboard shortcut.
You can customize various editor settings. Go to Tools -> Global Options -> R Markdown -> Visual to choose your options, such as:
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.
The visual mode supports both standard keyboard shortcuts (e.g., ⌘ + B for bold) and markdown syntax.
Here are some commonly used shortcuts:
Command | Keyboard Shortcut | Markdown Shortcut |
---|---|---|
Bold | ⌘ B | bold |
Italic | ⌘ I | italic |
Code | ⌘ D | code |
Link | ⌘ K | |
Heading 1 | ⌥⌘ 1 | # |
Heading 2 | ⌥⌘ 2 | ## |
Heading 3 | ⌥⌘ 3 | ### |
R Code Chunk | ⌥⌘ I | ```{r} |
Check out more on the Editing Shortcuts page of the Visual R Markdown site.
You can also use the catch-all ⌘ + / shortcut to insert headings, comments, symbols, and more.
The editor toolbar includes buttons for common commands to edit formatting or insert content.
The visual markdown editor also provides efficient tools to edit and customize content.
Right-click on a table in your document. You can set the alignment, add or delete rows and columns, add a header, and more.
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.
The visual markdown editor has many other features for efficient report writing.