4

I'm using external images in an Rmarkdown document that is meant to be rendered as ioslides and I need to easily resize them.

Doing it the html way works both when I knit to ioslides and to html_document.

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

Doing it the markdown way like below works when I knit to html_document but NOT when I knit to ioslides (i.e., the image isn't resized).

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

My question is: how can I make the markdown resizing approach work when the output is ioslides?

msoftrain
  • 1,017
  • 8
  • 23

2 Answers2

3

Atongsa's solution: using 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")
```

then the imagine is ok

1

To add to Atongsa's answer, you can manage the aspect ratio using percentages.

Eg out.width='90%'

happyspace
  • 113
  • 1
  • 2
  • 12