Is there a way to change the font of a kable in Rmarkdown when knitting to pdf? I can find plenty on changing size or bold etc but not on changing the actual font. I would just like something sans serif.
Example markdown doc:
---
title: "R Notebook"
output:
pdf_document: default
---
Change the font in the table below:
```{r message=FALSE, warning=FALSE, echo=FALSE}
library(kableExtra)
mtcars %>% head() %>% kable()
```
You can use the Latex fontspec library, see below. Note that you can see your available fonts and their names in the Fonts page from Settings.