Open cscheid opened 1 year ago
Tracking this in the feature/7062
branch.
Currently, the knitr output for this .qmd
---
title: "Layout test"
keep-md: true
---
```{r}
#| label: fig-charts
#| fig-cap: "Charts"
#| layout: "[1, 1]"
plot(cars)
plot(pressure)
is
::: {.cell layout="[1, 1]"}
plot(cars)
plot(pressure)
::: {.cell-output-display} {#fig-charts-1 width=672} :::
::: {.cell-output-display} {#fig-charts-2 width=672} ::: :::
That confuses quarto. I think the output should be this:
::: {#fig-charts .cell layout="[1, 1]" fig-cap="Charts"}
plot(cars)
plot(pressure)
::: {.cell-output-display} {#fig-charts-1 width=672} :::
::: {.cell-output-display} {#fig-charts-2 width=672} :::
:::
Concretely:
- no caption in the inner figures (because single string in `fig-cap` denotes overall figure caption)
- figure label in outer figures (because otherwise we don't have a label to do crossref work)
- `fig-cap="Charts"` in the cell, so that we have an overall caption
This is breaking some of @andrewpbray's extensions; I'm sure that's true for other folks as well. We're short on 1.6 time but I think we need to do something about this soon.
All float (Figures, Tables, etc) emitted before Pandoc should emit the same markdown AST.
Let's start with writing tests the generate the documents so we can inspect them.
Issues that are blocked because of this:
[x] #7017.
Specifically, we need to decide what's the correct output for float layouts that have subfigures but no subcaptions:
Current status
Test documents are in
tests/docs/smoke-all/issues/7062-ast-uniformization/*.qmd
.TODO
Simple layouts
Currently, "simple layouts" (single figure, caption and label) are (by inspection) compatible with each other. Jupyter and Knitr both emit images as an "image-style" float:
OJS, mermaid, and dot all emit div-style floats:
The exact nature of the content isn't important. It is not perfectly equivalent across formats, but it doesn't have to be, since our FloatRefTarget node works well with this structure.