user321627
user321627

Reputation: 2572

RMarkdown chunk output in console preview does not display latex option `\textcolor{}`

In Rmarkdown, I use the \textcolor option inside latex code, by writing:

$$
\textcolor{red}{This is Red}
$$

which when compiled will show This is Red but in red color. However, the "chunk output in console" preview option does NOT load this. Does anyone know of a quick fix? I've attached what it looks like:

enter image description here

Upvotes: 2

Views: 311

Answers (1)

cderv
cderv

Reputation: 6542

In a Rmd document in RStudio, you can use \color that is recognized in Latex equation block in RStudio

$$
\color{red}{This is Red}
$$

I got this

enter image description here

It renders in Red too in the pdf document.

Upvotes: 2

Related Questions