![](/img/trans.png)
[英]Change font size for output in a single chunk in R Markdown PDF document
[英]Adjust spacing between text and chunk output in a R Markdown PDF document
我在理解如何控制R Markdown PDF文档中文本和块输出之间的间距时遇到了麻烦。 下面是一个文档示例:
---
output: pdf_document
---
\setlength\lineskip{0pt}
\begin{center}
Random Text
\end{center}
```{r echo = FALSE, message=FALSE}
library(tidyverse)
p1 <- ggplot(mtcars, aes(x = row.names(mtcars), mpg)) +
geom_bar(stat = "identity") +
theme(panel.border = element_rect(colour = "black", fill=NA, size=1),
plot.margin=grid::unit(c(0,0,0,0), "mm")) +
coord_flip()
p1
```
删除文本“ Random Text”和块输出之间的空间的最佳方法是什么,以便“ Random Text”与图表的黑色边框齐平放置。
其次,如果我想在“随机文本”和图表的黑色边框之间留出1厘米的距离,我该怎么做?
谢谢
不知道为什么要这么做,但是可以在本地更改\\parskip
:
\begingroup
\parskip=0pt
\begin{center}
Random Text
\end{center}
```{r echo = FALSE, message=FALSE}
library(tidyverse)
p1 <- ggplot(mtcars, aes(x = row.names(mtcars), mpg)) +
geom_bar(stat = "identity") +
theme(panel.border = element_rect(colour = "black", fill=NA, size=1),
plot.margin=grid::unit(c(0,0,0,0), "mm")) +
coord_flip()
p1
```
\endgroup
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.