[英]How to put floating image (wrapped around text) aligned to the right with a centered caption in RMarkdown?
到目前为止,这给了我想要的结果。
<img align="right" src="images/cobre.png">
但我想在图像下方放置居中的标题。 我怎样才能做到这一点?
HTML输出可以通过CSS设置样式。 这些样式既可以直接包含在文本中,也可以放入单独的CSS样式表中。
这是使用内联CSS的方法:
```{=html}
<style type="text/css">
.figure {
float: right;
text-align: center;
}
</style>
```
``` {r fig.cap = "Insert caption here", echo=FALSE}
knitr::include_graphics("images/cobre.png")
```
与原始HTML相比,使用knitr::include_graphics
的优势在于include_graphics
也可以用于其他输出格式,如word和pdf(尽管该数字不适用于这些格式)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.