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

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.