Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to include a listing as a subfigure in a figure? #423

Open
charmoniumQ opened this issue Jan 26, 2024 · 1 comment
Open

How to include a listing as a subfigure in a figure? #423

charmoniumQ opened this issue Jan 26, 2024 · 1 comment

Comments

@charmoniumQ
Copy link

charmoniumQ commented Jan 26, 2024

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants