Edgar Alarcón
Edgar Alarcón

Reputation: 156

R Markdown chunk font color changed

Just a few days ago, when I create a R Markdown, the chunk colors were like this

Before

now it looks like this

enter image description here

The function calls are lack of color. Why is that? now it feels so "colorless"...

Upvotes: 2

Views: 987

Answers (1)

JBGruber
JBGruber

Reputation: 12470

You can change syntax highlighting in the Yaml options of an R Markdown document:

---
title: "test"
output:
  html_document:
    highlight: breezedark
---

Some Test code:

```{r results='hide'}
library(tidyr)
relig_income %>%
  pivot_longer(!religion, names_to = "income", values_to = "count")
```

enter image description here

---
title: "test"
output:
  html_document:
    highlight: pygments
---

Some Test code:

```{r results='hide'}
library(tidyr)
relig_income %>%
  pivot_longer(!religion, names_to = "income", values_to = "count")
```

enter image description here

Supported styles include default, tango, pygments, kate, monochrome, espresso, zenburn, haddock, breezedark, and textmate (Source). It's not clear why the style changed for you, but I think you have to find that out yourself :)

Upvotes: 4

Related Questions