fonts - R markdown-如何将字体切换到Times New Roman?

标签 fonts markdown

我放弃。在我的R Markdown文档中找不到更改字体类型的有效解决方案。我尝试了很多东西,例如:

---
output: word_document    
sansfont: Calibri Light
---

但是RStudio只是忽略了它。你能帮助我吗?我的pdf/word文件中需要Times New Roman字体。

问候

最佳答案

这对我有用。尝试使用mainfont而不是sansfont
并将latex_engine设置为xelatexlualatex

---
output: 
  pdf_document:
    latex_engine: xelatex
mainfont: Times New Roman
---

关于fonts - R markdown-如何将字体切换到Times New Roman?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36960600/

相关文章:

regex - 如何使用 Google S2 Converter 将 markdown() 中的链接转换为与网站图标链接?

markdown - Gatsby : how to implement advanced image styling with gatsby-remark-images and markdown?

markdown - 在markdown中插入图片乱码latex背景图片

github - 如何在 GitHub 风格的 Markdown 内部链接/标题 anchor 中转义符号?

android - 默认自定义字体

silverlight - 如何知道 Silverlight 中的本地字体名称

css - 去除网页上冒号符号的跳跃

wpf - 如何将渲染文本精确居中在边框内

android - 使用 Calligraphy 全局设置默认字体后,是否可以清除某些 TextView 的默认字体?

pdf - 如何使用 pandoc 将 Markdown 方程转换为 pdf