R Markdown: How to use icons

Viewed 97
1 Answers

HTML

You can use the following code to add icons:

---
title: "Untitled"
author: "Author"
date: "2022-08-15"
output: html_document
---

```{r setup, include=FALSE}
remotes::install_github("mitchelloharawild/icons")
icons::download_fontawesome()
```

# This is my title `r icons::fontawesome("markdown")`

Output:

enter image description here

PDF

You can use the latex package fontawesome5. I had to install the package rsvg (just in console) before running the following code:

---
title: "Untitled"
author: "Author"
date: "2022-08-15"
output: 
  pdf_document:
    keep_tex: true
header-includes:
  - \usepackage{fontawesome5}
---

# This is my title `r icons::fontawesome("markdown")`

Output:

enter image description here

Related