[英]Changing font and/or margin in RStudio -> RMarkdown -> YAML -> knitr -> pandoc -> LaTex -> PDF
Can someone give me an example of a YAML header that successfully passes command line args / options to pandoc? 有人可以给我举一个成功将命令行参数/选项传递给pandoc的YAML标头的示例吗? The documentation and examples I've found, indicate that I can do this by setting the margin in the YAML header for an PDF output file with: geometry: margin=0.5in
. 我发现的文档和示例表明,可以通过以下方式为PDF输出文件的YAML标头设置边距来实现此目的: geometry: margin=0.5in
。 But I can't seem to get it to work. 但是我似乎无法使其正常工作。
After much trial an error, I was able to get the following to work 经过大量的尝试错误后,我得以完成以下工作
output:
pdf_document:
keep_tex: yes
latex_engine: xelatex
word_document: default
html_document: default
geometry: margin=0.5in
mainfont: Arial
fontsize: 12pt
But with these caveats: 但是请注意以下几点:
Arial
我找不到有效字体名称的列表,但是很幸运地与Arial
在一起 fontsize
only seems to work on the included tables, not the main text. fontsize
似乎仅适用于包含的表,而不适用于主要文本。 If anyone can point me to a more definitive description of what YAML header option gets passed to Pandoc and LaTex, I'd appreciate it. 如果有人可以指导我更明确地描述将哪些YAML标头选项传递给Pandoc和LaTex,我将不胜感激。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.