markdown - Are knitr subcaptions only for Latex? -


i using rstudio/knitr/markdown/pandoc/docx in windows 7. having trouble getting captions on plots when print 2 of them side side.
in following example, no caption in docx middle graphic. figure number correct in last plot though.

btw, don't caption when don't include fig.subcap option either.
thank you!

title ========================================================   ```{r setup, include=false} opts_chunk$set(comment=na)  fig.caption.num = local({   = 0   function(x) {     <<- + 1     paste('fig. ', i, ': ', x, sep = '')   } }) ```  text:    ```{r fig.width=7, fig.height=6, fig.cap=fig.caption.num('my first plot')} plot(cars) ```   2 plots:    ```{r fig.width=3, fig.height=7, fig.cap=fig.caption.num('two plots'), fig.show='hold', fig.subcap=c('one plot', 'the other one')} plot(cars) plot(1:10) ```   more text:    ```{r fig.width=7, fig.height=7, fig.cap=fig.caption.num('my last plot')} plot(cars) ```   finish text   

sessioninfo()
r version 2.15.3 (2013-03-01) platform: x86_64-w64-mingw32/x64 (64-bit)

locale: [1] lc_collate=spanish_argentina.1252  lc_ctype=spanish_argentina.1252    [3] lc_monetary=spanish_argentina.1252 lc_numeric=c                       [5] lc_time=spanish_argentina.1252      attached base packages: [1] stats     graphics  grdevices utils     datasets  methods   base       loaded via namespace (and not attached): [1] digest_0.6.3   evaluate_0.4.3 formatr_0.7    knitr_1.2      stringr_0.6.2  [6] tools_2.15.3   

this mark question answered. please see yihui's comment above confirms latex-only feature.


Comments