如何正确输入说明以扩大 RMarkdown 页面的页边距 pdf.doc

How t o enter properly instructions to widen margins a page for RMarkdown pdf.doc

由于我在 RMarkdown 中遇到错误的页面报告,正如您在此处看到的那样:

有人建议我在应该打印 table 的行周围输入这些命令。

<span style='font-size: 0.8em'>
```{r model, echo = FALSE, results = 'asis'}
iwalk(tables_models, ~ cat(knitr::knit_print(.x)))
```
</span>

因为我已经尝试将其重新放入我的文档中,如下所示

产生红色标记,我发现正确设置它们的唯一方法是:

这并没有解决问题,我想寻求帮助以正确设置这些说明。谢谢

如果你想在你的文件中做一个特殊的边距(编织成 pdf),那么试试这个 LaTeX-solution:

将此包添加到 header:

header-includes: 
 \usepackage{geometry}

部分页面留出特殊边距(也可以使用mm、cm):

\newgeometry{top=1in,left=1in,bottom=1in,right=1in}

在 return 到你以前的风格之后:

\restoregeometry  

给你举个例子:

---
title: "R"
header-includes:
- \usepackage{geometry}
output:
  pdf_document: default
---  

\newgeometry{top=1in,left=5in,bottom=1in,right=1in}

```{r}
options(width = 100)
matrix(runif(100), ncol = 20)
```
\restoregeometry      

\newpage
\newgeometry{top=1in,left=0in,bottom=1in,right=1in}

```{r}
options(width = 100)
matrix(runif(100), ncol = 20)
```
\restoregeometry  

\newpage
\newgeometry{top=5in,left=1in,bottom=1in,right=1in}

```{r}
options(width = 100)
matrix(runif(100), ncol = 20)
```
\restoregeometry