1

在呈现为 PDF 时,我有哪些选项可以更改动态生成的输出的字体大小?我的文档目前看起来像这样:

---
title: "Foo"
author: "Bar"
date: "`r format(Sys.time(), '%B %e, %Y')`"
output:
  pdf_document: default
  html_document:
    df_print: paged
header-includes: \usepackage{amsmath} \usepackage{color}
---

# Introduction

```{bash echo=FALSE}
perl -le 'print for 1..50'
```

我想减小字体大小以帮助更多输出适合 PDF 的单个页面。我目前还没有输出到 HTML,所以跨格式的解决方案会很酷,但不是真的必要。

4

1 回答 1

3

它就像fontsize: 12pt(或者当然fontsize: 9pt就像我们在pinp中使用的那样简单)

修改文件:

---
title: "Foo"
author: "Bar"
date: "`r format(Sys.time(), '%B %e, %Y')`"
fontsize: 12pt
output:
  pdf_document: default
  html_document:
    df_print: paged
header-includes: \usepackage{amsmath} \usepackage{color}
---

# Introduction

```{bash echo=FALSE}
perl -le 'print for 1..50'
```

如果您只想将它​​用于代码/结果片段,我建议您在其周围放置适当\begin{Large}的位置。\end{Large}过去曾定制过这里使用的默认环境——我记得 knitr 或多或少地遵循 Sweave 在这里。只需查看生成的 .tex 文件即可。

于 2018-02-15T21:42:18.413 回答