r语言 - 使用软件包时如何更改"rticles"字体?



我最近在R中安装了"rticles"包,以便在RMarkdown中自动设置期刊文章模板。到目前为止,我对它印象深刻,但我希望能够更改字体。当然,这在某种程度上是可能的,但是我一直找不到任何在线资源来解释如何做到这一点。

我对编织成PDF感兴趣。

这是我的 RMarkdown 脚本顶部的 YAML:

---
title: This title
author:
- name: This author
email: t.author@thisPlace.com
affiliation: This institute
address:
- code: This institute
address: Street, City, State, etc.
abstract: |
This is the abstract.
It consists of two paragraphs.
keywords: "fun, happiness"
journal: "This Elsevier Journal"
date: "`r Sys.Date()`"
output: rticles::elsevier_article
---

我通过在 R 中运行以下代码行来生成它:

rmarkdown::draft("Test.Rmd", template = "elsevier_article", package = "rticles")

那么在所有这些中,我可以在哪里控制字体呢?在使用"rticles"之前,我曾经通过更改乳胶引擎然后指定字体来更改字体,如下所示:

---
title: This title
author: "This author"
date: "`r Sys.Date()`"
output:
pdf_document:
toc: yes
toc_depth: 4
fig_caption: TRUE
df_print: kable
latex_engine: xelatex
mainfont: Calibri Light
---

是否有可能在"rticles"中做类似的事情?

控制字体的方式类似于您之前所做的:

---
title: This title
author:
- name: This author
email: t.author@thisPlace.com
affiliation: This institute
address:
- code: This institute
address: Street, City, State, etc.
abstract: |
This is the abstract.
It consists of two paragraphs.
keywords: "fun, happiness"
journal: "This Elsevier Journal"
date: "`r Sys.Date()`"
output:
rticles::elsevier_article:
latex_engine: xelatex
mainfont: Calibri Light        
---

相关内容

最新更新