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

Đang mở
#1,304 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
markdown, rust
Lĩnh vực
documentation

Hướng nghiên cứu

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".

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Rust
Star
316
Fork
23
Merge trung bình
11 giờ 49 phút
Pull request đã merge (30 ngày)
245

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của quarto-dev/q2

Tất cả issue của quarto-dev/q2

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.