quarto-dev / quarto-dev/quarto-cli

`number-sections: True` misbehaves slightly when appendix sections are present

Open
#9,995 6 comments 0 reactions 1 assignee View on GitHub

@cderv is already working on this.

Since Jul 22, 2026.

bug html triaged-to
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

number-sections: true numbers all sections in the order in which they appear in the source markdown document.

however, this conflicts with the {.appendix} class command which sends the section to the appendix of the document.

Steps to reproduce

Here is a minimal example:

---
format: html
number-sections: true
---

# Section A

# Appendix {.appendix}

# Section B
Expected behavior

I would expect the result to render as

1. Section A
2. Section B
3. Appendix
Actual behavior

Instead the numbers are mangled

1. Section A
3. Section B
2. Appendix

Depending on the underlying code:

  • if the fix is too complex, it's probably best to just mention the poor interaction in the docs: the user can fix it by reordering their document
  • from the outside, it looks like .appendix should modify the order of the sections in the pandoc AST. If so, maybe it's possible to fix this in a flash by just re-ordering the sections
Your environment
  • IDE: vscode
  • OS: windows 11
Quarto check output

Quarto 1.5.45
[>] Checking versions of quarto binary dependencies...
Pandoc version 3.2.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.41.0: OK
Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.5.45
Path: C:\Users\Guillaume\AppData\Local\Programs\Quarto\bin
CodePage: 1252

[>] Checking tools....................OK
TinyTeX: v2024.06
Chromium: (not installed)

[>] Checking LaTeX....................OK
Using: TinyTex
Path: C:\Users\Guillaume\AppData\Roaming\TinyTeX\bin\windows
Version: 2024

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

[>] Checking Python 3 installation....OK
Version: 3.12.4
Path: d:/Desktop/Dojo/quarto_bug_report_listings/.venv/Scripts/python.exe
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/

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.