format: docx will double up autonumbering in headings if number-sections: true is supplied in YAML and the reference-doc includes numbering.

Open
#12,095 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Domain
documentation

Research direction

Start by rendering the supplied YAML example with custom-reference-doc.docx and compare the generated DOCX headings with the attached actual and expected images. Done means headings are numbered once when number-sections: true is used with a reference document that includes numbering.

Written by the indexing model from the issue text.

Description

bug docx
Bug description

Hello Quarto devs! Thanks for the ambitious project - it's very impressive.

I'll leave this up to you if you count this as a bug or expected behaviour. When combining number-sections: true with a reference-doc with numbering included it'll double up the numbers.

Image

Steps to reproduce

Reprex making use of the attached reference doc

custom-reference-doc.docx

---
title: "Untitled"
format: 
  docx:
    reference-doc: custom-reference-doc.docx
number-sections: true
---

# First heading

# Second heading

## Subheading


---
Actual behavior

Image

Expected behavior

Image

Your environment
  • IDE: Visual Studio
  • OS: macOS 14.4 (23E214)
Quarto check output

Quarto 1.6.40
[✓] Checking environment information...
Quarto cache location: /home/vscode/.cache/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.4.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.46.3: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.6.40
Path: /opt/quarto/bin

[✓] Checking tools....................OK
TinyTeX: v2025.01
Chromium: (not installed)

[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /home/vscode/.TinyTeX/bin/x86_64-linux
Version: 2024

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
Version: 3.13.1
Path: /usr/local/bin/python3
Jupyter: 5.7.2
Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........(None)

  Unable to locate an installed version of R.
  Install R from https://cloud.r-project.org/
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quarto-dev/quarto-cli

All issues in quarto-dev/quarto-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.