When I use Rmarkdown to render github_document, I try to include figure with caption. However, I find that fig.cap does not work in the r trunk if I specify the output as github_document in the ymal. This is also shown in the Rmarkdown cheatsheet.
My code looks like below:
---
title: "This is the title of my document..."
author: "my name"
output: github_document
---
```{r, out.width='100%', fig.cap= "This is Caption", fig.align = "left", cache = FALSE}
knitr::include_graphics("XXX.png")
```
I am able to walk around this problem by adding * this is caption* right below the r trunk. But I am still don't understand why rmarkdown does not support using fig.cap directly in this specific output type.
I am sure I am missing something here, but any ideas? Many thanks!