我正在使用 rmarkdown 生成报告。编织 PDF 时
---
title: "Untitled"
output: pdf_document
---
I would like to specify the font to be used in creating the PDF. The official documentation http://rmarkdown.rstudio.com/pdf_document_format.html (see section "LaTeX Options) says I can do this.
However, I've never used LaTeX and fail to understand how such selection can be made in YAML options at the top of the .Rmd document used by rmarkdown
package.
问题:如何更改 rmarkdown 生成的 PDF 中的字体?
会话信息()
R版本3.1.0 (2014-04-10)
平台:x86_64-w64-mingw32/x64(64位)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] grid stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_1.0.0 RODBC_1.3-10 knitr_1.6 dplyr_0.2
我从来没有使用过 LaTeX,也不想在这个妈妈身上接触它
YAML 选项中的缩进是有意义的。正如说明指出的那样“请注意,这些选项不会出现在输出部分的下方,而是与标题、作者等一起出现在顶层)”。所以,
---
output:
pdf_document:
latex_engine: xelatex
sansfont: Calibri Light
---
将产生未使用的参数错误,而
---
output:
pdf_document:
latex_engine: xelatex
sansfont: Calibri Light
---
会做这项工作。此外,在 YAML 之后插入的 LaTeX 命令似乎会覆盖它:所以
---
output:
pdf_document:
latex_engine: xelatex
sansfont: Calibri Light
---
\fontsize{12}{22}
\fontseries{b}
\selectfont
使用默认字体(而不是 Calibri)生成 PDF,但是字体选项传递得很好。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)