R markdown ioslides multiple figure captions not working

Here is my code and I can’t figure out why the captions are not working:

```{r, out.width = "10%",out.height= "10%", fig.cap=c("A","B","C"),fig.show='hold', echo=FALSE}

knitr::include_graphics(c("bad_graph2.jpg","bad_graph2.jpg","bad_graph2.jpg"))

1 Like

Do you need to use fig.show = 'hold' ?

This will create one div with all figures inside, and this only allows 1 caption as it is consider one figure. If you remove this chunk option, you'll get the correct 3 captions.

I tried without the fig.show = ‘hold’ and that actually puts the images one below the other and out of the screen actually. I have also tried removing the <div class="centered”> from the slide. Eventually I had to add the following as a figure heading rather than a caption. Appreciate your help!

heading <- c("----------A----------", "-----------B----------", "----------C--------")
head(heading, row.names = F)
1 Like

Nice!

If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

I don’t think my work around is really elegant enough to mark it as a solution. and hopefully the down master Yihui can help us with this! thanks again; on another note, is there a way I can pull up all three images in line at the top:

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.