FAQ Discussion: How to format your code

This topic is for discussing questions, suggestions, and other feedback about the following FAQ:

How do you insert a quote from the thread above (or elsewhere) that appears as a nicely formatted indented box in a reply?

1 Like

If you highlight the content and click quote it will automatically populate the reply with the formatted code:

[quote="stephhazlitt, post:5, topic:6246, full:true"]
How do you insert a quote from the thread above (or elsewhere) that appears as a nicely formatted indented box in a reply?
[/quote]

You can also select text and click the quote button (highlighted below):

Using > also works:

This is a quote.

from ⇩

> This is a quote.
3 Likes

R Markdown Source

Use four backticks and the "markdown" syntax hint to surround the source of R Markdown documents:

Type this:

````markdown
---
title: "It's full of cars!"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents.

```{r cars}
summary(cars)
```
````

See this:

---
title: "It's full of cars!"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. 

```{r cars}
summary(cars)
```
9 Likes