docx: `number-sections` has no effect, and `@sec-` references lose their first number

Abierto
#1,308 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
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
markdown, rust, yaml

Línea de trabajo

The docx writer is where heading numbering and the @sec- reference text get produced, so that is the place to start, and the HTML path that already gets it right is the reference for expected output. Render the repro with q2 render secnum.qmd --to docx, then inspect the document XML to see whether heading numbers are emitted at all. Done means headings read "1. One" and "2.1.1 Deep" and the references read "Section 2.1.1", matching the HTML output.

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

Descripción

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.

With number-sections: true, docx headings are not numbered. Section cross-references do get a number, but its first component is missing: section 2 becomes "Section " (no number), 2.1 becomes "Section 1" and 2.1.1 becomes "Section 1.1". The same document renders correctly to HTML. Quarto 1 and pandoc -N both number the docx headings.

Repro

---
number-sections: true
---

# One {#sec-one}

See @sec-two and @sec-two-a.

# Two {#sec-two}

## Two A {#sec-two-a}

### Deep {#sec-deep}

See @sec-deep.

q2 render secnum.qmd --to docx

Actual: headings "One", "Two", "Two A", "Deep" without numbers; references "Section ", "Section 1", "Section 1.1".

Expected (Quarto 1): headings "1. One", "2. Two", "2.1 Two A", "2.1.1 Deep"; references "Section 2", "Section 2.1", "Section 2.1.1". HTML output from q2 already gives this.

The dropped first component looks like docx treats level-1 headings as chapters. Possibly related to #1304.

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.