如何自定义四开本pdf文档的字体?我意识到
mainfont
和 fontfamily
选项的存在,但文档没有提供如何使用它们以及哪些字体可用的示例。另外,monofont
有什么字体?
这里是文档:https://quarto.org/docs/reference/formats/pdf.html#fonts
如文档中所述,您可以使用系统字体(即系统中安装的字体)。因此,将系统字体的字体系列指定为
mainfont
和/或 monofont
yaml 键,同时使用 xelatex
或 lualatex
作为 pdf-engine
.
现在,如果您想获取系统中安装的字体列表,可以使用 system_fonts()
包中的
{systemfonts}
函数。
---
title: "Fonts in Quarto"
format: pdf
pdf-engine: xelatex
mainfont: Lato
monofont: Roboto
---
## Fonts
- mainfont: For LaTeX output, the main font
family for use with xelatex or lualatex.
Takes the name of any system font.
- monofont: For LaTeX output, the monospace
font family for use with xelatex or lualatex:
take the name of any system font.
## Fonts available in system
```{r}
# install.packages("systemfonts")
systemfonts::system_fonts()
```
另请注意,如果您使用
fontfamily
设置字体系列,则需要使用pdflatex
作为pdf-engine
.