RMarkdown: How to change the font color?

The answer given at the link provided by @Ben Bolker:

Roses are <span style="color:red">red</span>, 
violets are <span style="color:blue">blue</span>.

does work if you select HTML (ioslides) as the output format.

However, it does not work if you select pdf (beamer) as output format. If you want to create a pdf, use LaTeX syntax:

    Roses are \textcolor{red}{red}, violets are \textcolor{blue}{blue}.

Leave a Comment