6

Does anyone know how to enforce subcaptions in RMarkdown when producing HTML output?

When producing pdf's, the following directives in the header allows subcaptions:

---
...
header-includes:
  -\usepackage{subfig}
---

Which would be implemented like this:

```{r fig.cap="My Caption", fig.subcap=c('First','Second')
base = ggplot(data=data.frame(x=0,y=0),aes(x,y)) + geom_point()
base + labs(title="1st Plot") #Print the first
base + labs(title="2nd Plot") #Print the second
```

Now when the same document is produced with html output, the sub-captions are ignored / omitted....

Is there some what to enable subcaptions when producing html?

Nicholas Hamilton
  • 10,044
  • 6
  • 57
  • 88

0 Answers0