Supplemental subfigures in docx #11444
-
DescriptionI'm trying to create a set of subfigures in an appendix in docx format, and I can't quite get it to work. The following reprex works as I hoped in html format but not in docx: ---
title: "supplemental subfigures - full"
format:
docx:
echo: false
html:
echo: false
crossref:
custom:
- kind: float
key: suppfig
reference-prefix: Figure S
space-before-numbering: false
---
See @suppfig-subfigs-1 and @suppfig-subfigs-2:
::: {#suppfig-subfigs layout-ncol="2"}
:::: {#suppfig-subfigs-1}
```{r}
plot(cars)
```
Cars
::::
:::: {#suppfig-subfigs-2}
```{r}
plot(pressure)
```
Pressure
::::
Charts
::: HTML output (looks good): docx output (I manually added the table borders to help clarify what's happening): It looks like the docx file has created a second cell in the first row for the second graph, but that graph instead ends up on a second row. This seems to be an instance of #9623 and might be solvable by #7665, but since I'm particularly interested in combining custom floats and subfigures in docx, I thought it might be worth creating a separate discussion for this case. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think your assessment wrt #9623 is correct, but #7665 doesn't come up here: knitr only gets involved in code cells, and not div crossreferences. |
Beta Was this translation helpful? Give feedback.
I think your assessment wrt #9623 is correct, but #7665 doesn't come up here: knitr only gets involved in code cells, and not div crossreferences.