【问题标题】:Resizing external image in Rmarkdown: html vs. ioslides output在 Rmarkdown 中调整外部图像的大小:html 与 ioslides 输出
【发布时间】:2017-07-25 14:27:07
【问题描述】:

我在 Rmarkdown 文档中使用外部图像,该文档旨在呈现为 ioslide,我需要轻松调整它们的大小。

当我knit 到 ioslides 和 html_document 时,以 html 方式进行操作。

<img src="image.png" style="height: 200px"/>

当我 knit 到 html_document 时,像下面这样的降价方式有效,但当我 knit 到 ioslides 时无效(即,图像未调整大小)。

![](image.png){width=200px}

我的问题是:当输出为 ioslides 时,如何使 markdown 调整大小的方法起作用?

【问题讨论】:

标签: html image r-markdown image-resizing ioslides


【解决方案1】:

Atongsa 的解决方案:使用 chunkoptions

```{r, out.width = "900px", out.height= "500px", fig.cap= "cite from 
NATURE REVIEW_Deep_learning", echo=FALSE}

knitr::include_graphics("/home/atongsa/Pictures/Screenshot")
```

那么想象就OK了

【讨论】:

    【解决方案2】:

    要添加到Atongsa's answer,您可以使用百分比管理纵横比。

    例如out.width='90%'

    【讨论】:

      猜你喜欢
      • 2015-01-09
      • 1970-01-01
      • 1970-01-01
      • 2016-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-30
      • 1970-01-01
      相关资源
      最近更新 更多