作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想在 R markdown 脚本中的标题开头包含图标。我找到了一个这样做的女孩的简历模板,但这对我不起作用:
https://github.com/loreabad6/R-CV/blob/master/CV.Rmd
'library(fontawesome)'
\faIcon{university}
我也试过:In `rmarkdown`, how to add icon in sentence?
`r icons::fontawesome("markdown")`
我需要做什么?
最佳答案
HTML
您可以使用以下代码添加图标
:
---
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")`
输出:
您可以使用 latex 包 fontawesome5
。在运行以下代码之前,我必须安装包 rsvg
(仅在控制台中):
---
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")`
输出:
关于R Markdown : How to use icons,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73362511/
我是一名优秀的程序员,十分优秀!