docx: chapter cross-reference numbers don't restart per chapter (crossref: chapters: true)

Abierto
#1,304 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
markdown, rust

Línea de trabajo

The bug is in how docx output numbers captioned figures with chapter cross-references (crossref: chapters: true). Start by finding where the chapter prefix and per-figure counter are computed in the Rust crossref or docx writer code, and check why the counter is not reset at each level-1 heading. Run the repro from the issue (two level-1 headings, one figure each) with --to docx and confirm the second figure reads "Figure 2.1".

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

With crossref: chapters: true, docx output numbers figures across chapters instead of restarting the count in each chapter: the first figure of chapter 2 becomes "Figure 2.2". Quarto 1 (1.11.9) gives "Figure 2.1" for the same document.

Repro (q2 0.47.0, pandoc 3.14 via QUARTO_PANDOC, Windows):

---
crossref:
  chapters: true
---

# One

![First](img.svg){#fig-a}

# Two

![Second](img.svg){#fig-b}

See @fig-a and @fig-b.

q2 render xref.qmd --to docx

Actual: captions "Figure 1.1: First" and "Figure 2.2: Second"; the references read "Figure 1.1" and "Figure 2.2".

Expected: "Figure 2.1" for the second figure, as in Quarto 1.

The chapter prefix is right, but the counter after it isn't reset at each level-1 heading.

Lenguaje dominante
Rust
Estrellas
316
Forks
23
Merge medio
11 h 49 min
PR fusionados (30 d)
245

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de quarto-dev/q2

Todos los issues de quarto-dev/q2

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.