Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 更改封面中的页边距大小_R_Pdf_Latex_Knitr_R Markdown - Fatal编程技术网

R 更改封面中的页边距大小

R 更改封面中的页边距大小,r,pdf,latex,knitr,r-markdown,R,Pdf,Latex,Knitr,R Markdown,我正在尝试添加一个已创建为PDF格式的封面 ```{r echo=FALSE,out.width='8.27in',out.height='11.69in'} knitr::include_graphics('CoverPage.pdf') ``` 我只想更改第一页的页边距。你能帮我做这个吗 尝试了以下操作,但更改了整个文档的页边: geometry: "left=3cm,right=3cm,top=2cm,bottom=2cm" 如果您对RMD文件中的一些裸露乳胶没有意见,那么可以使用。只

我正在尝试添加一个已创建为PDF格式的封面

```{r echo=FALSE,out.width='8.27in',out.height='11.69in'}
knitr::include_graphics('CoverPage.pdf')
```
我只想更改第一页的页边距。你能帮我做这个吗

尝试了以下操作,但更改了整个文档的页边:

geometry: "left=3cm,right=3cm,top=2cm,bottom=2cm"

如果您对RMD文件中的一些裸露乳胶没有意见,那么可以使用。只需在封面之前定义一个新的几何图形,然后再进行恢复性测量,读起来就像英语一样

---
output:
  pdf_document
---
```{r, echo = FALSE, results = "asis"}
cat("\\newgeometry{left=3cm,right=3cm,top=2cm,bottom=2cm}")
knitr::include_graphics("CoverPage.pdf")
cat("\\restoregeometry")
```

\clearpage

Note the position of the page number. Restoring the margins was successful!
使用chunk选项results=asis和cat打印未经加工的乳胶,并使用额外的反斜杠避开反斜杠,这一点很重要