Search code examples
rr-markdownioslides

Text colour in R markdown ioslides/js. reveal slides


I see from the R Markdown website that the colour of text can be changed like so:

<div class="red2">
This text is red
</div>

But this doesn't seem to work for text formatted with `, like "If in doubt, use ?dplyr::filter", for example. Besides using css or html tags, is there a simpler way to do this?


Solution

  • Well, after poking around it seems that the quickest way to do this is with a html <style> tag. I was looking for something that avoided css or html, but this seems to be the best way to do this. There are plenty of options, but a simple one is:

    If in doubt, use <bdi style="color:red;">`?dplyr::filter`</bdi> to get help.