Subfigures are numbered as separate figures, and `layout-ncol` has no effect in HTML

未关闭
#1,309 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
html, markdown, rust
领域
cli, documentation

调研方向

Start with the figure and subfigure handling in the q2 Rust crates, then compare HTML output for layout-ncol against the docx writer, which already lays subfigures side by side. Run the render from the repro on a small two-image document and check whether the subfigure ids get (a) and (b) numbering. Done means the cross-references resolve as in Quarto 1 and the HTML output includes the layout panel and row markup.

由索引模型根据 Issue 内容生成。

描述

Tested with q2 0.47.0 and pandoc 3.14 (via QUARTO_PANDOC) on Windows 11, compared with Quarto 1.11.9 and plain pandoc 3.14.

A figure div with subfigures (the example from the q2 Figures guide) gives each subfigure its own top-level number instead of "(a)" and "(b)". The parent figure gets the next number. In HTML, layout-ncol is only written out as a data-layout-ncol attribute: there's no layout panel or CSS, so the images stack. In docx, the subfigures sit side by side in a table, but each image keeps its full width (5.56 in), where Quarto 1 scales them to the column (3.25 in).

Repro

::: {#fig-pair layout-ncol=2}
![Left](fig-a.png){#fig-l}

![Right](fig-b.png){#fig-r}

Two figures
:::

See @fig-pair, @fig-l and @fig-r.

q2 render sub.qmd --to html (and --to docx)

Actual: captions "Figure 1: Left", "Figure 2: Right", "Figure 3: Two figures"; text "See Figure 3, Figure 1 and Figure 2". In HTML, no quarto-layout-panel or quarto-layout-row.

Expected (Quarto 1): subcaptions "(a) Left" and "(b) Right" under "Figure 1: Two figures"; text "See Figure 1, Figure 1 (a) and Figure 1 (b)"; a two-column layout.

A layout panel without subfigure ids (::: {layout-ncol=2} with two captioned images) has the same HTML problem.

主要语言
Rust
星标
316
派生
23
平均合并
11 小时 49 分钟
30 天内合并 PR
245

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

quarto-dev/q2 的其他 Issue

查看 quarto-dev/q2 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。