In rmarkdown, how to add icon in sentence?
For instance as below, how to add markdown icon between word 'Markdown' and 'is'
In rmarkdown, how to add icon in sentence?
For instance as below, how to add markdown icon between word 'Markdown' and 'is'
There's a nice R package that makes it easy to download and add icons to RMarkdown documents, icons. First, just install and download the necessary icons.
remotes::install_github("mitchelloharawild/icons")
icons::download_fontawesome()
Then we can easily use the icon in RMarkdown.
---
title: "Example"
output: html_document
---
Markdown `r icons::fontawesome("markdown")` is a simple formatting syntax
for authoring HTML, PDF, and MS Word documents.
You can play around with the styling using the style argument to fontawesome() or with more complex styles with font_styles().
You can use
```{r include=FALSE}
library(fontawesome)```
(The fontawesome package is available from CRAN.)
And then to insert an icon:
r fa(name = "markdown", fill = "green", height = "1em")
Example:
Markdown `r fa(name = "markdown", fill = "green", height = "1em")` is
a simple formatting syntax for authoring HTML, PDF,
and MS Word documents.
You can find the available icons at:
Another solution is to use shiny function icon:
---
title: "Example"
output: html_document
---
Markdown `r shiny::icon("markdown")` is a simple formatting syntax for authoring HTML, PDF, and MS Word documents.