Change font of Kable in Rmarkdown pdf

馋奶兔 提交于 2019-12-05 21:35:12

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.

---
title: "R Notebook"
output:
  pdf_document: 
    latex_engine: xelatex
header-includes:
  \usepackage{fontspec}
---

Change the font in the table below:
## using the Arial font as an example
\fontspec{Arial}

```{r message=FALSE, warning=FALSE, echo=FALSE}
library(kableExtra)

mtcars %>% head() %>% kable()

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!