将R Markdown中的图像和文本居中以生成PDF报告 [英] Centering image and text in R Markdown for a PDF report
本文介绍了将R Markdown中的图像和文本居中以生成PDF报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用R Markdown居中放置图像和/或文本,并从中编织出PDF报告.
I want to center an image and/or text using R Markdown and knit a PDF report out of it.
我尝试使用:
->Text<-
->![](image1.jpg)<-
那不行!还有其他方法可以做到这一点吗?
That does not do the trick! Any other way of getting this done?
推荐答案
如果将R代码块(例如绘图)的输出居中,则可以使用fig.align
knitr中的选项.
If you are centering the output of an R code chunk, e.g., a plot, then you can use the fig.align
option in knitr.
```{r fig.align="center"}
plot(mtcars)
```
这篇关于将R Markdown中的图像和文本居中以生成PDF报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文