How to include a listing as a subfigure in a figure?
Opened this issue · 1 comments
charmoniumQ commented
Is it possible to create a subfigure grid, where one of the cells of the grid is a code listing? The following snippet doesn't quite do the trick. The listing does not get a label or a caption and the fourth subfigure gets labeled "c".
<div id="fig:prov">
![Application-level prov](app-lvl-prov.svg){#fig:app-lvl-prov width=24%}
![Workflow-level prov](wf-lvl-prov.svg){#fig:wf-lvl-prov width=24%}
```{#lst:sys-lvl-log caption="Sys-level log" width=24%}
read A
write B
read C
write D
write E
```
![System-level prov](sys-lvl-prov.svg){#fig:sys-lvl-prov width=24%}
Several provenance graphs collected at different levels.
</div>
lierdakil commented
Yeah, unfortunately subfigures only work for figures as Pandoc understands them, that is, images. There are a few reasons for that, the main one being pdf/latex needs quite a few hacks to handle heterogenous subfloats, and even with the hacks it's wonky. In terms of workarounds, the best I can suggest at the moment is to write the listing to an SVG and use that.