Skip to content

number-sections: True misbehaves slightly when appendix sections are present #9995

Description

@GuillaumeDehaene

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/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghtmlIssues with HTML and related web technology (html/css/scss/js)triaged-toIssues that were not self-assigned, signals that an issue was assigned to someone.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions