### Bug description

If I specify `number-sections: false` in my yaml header for a quarto book and render to a narrow HTML page the chapter number shows up in the table of contents at the top of the page.

To see the bug, make the default book project with the RStudio IDE (I am using 2022.07.0 Build 548 on a Mac running macOS Monterey Version 12.4).  Add the `number-sections` statement to the html section:

```
project:
  type: book

book:
  title: "resize_bug"
  author: "Jane Doe"
  date: "7/31/2022"
  chapters:
    - index.qmd
    - intro.qmd
    - summary.qmd
    - references.qmd

bibliography: references.bib

format:
  html:
    theme: cosmo
    number-sections: false
  pdf:
    documentclass: scrreprt
```

Then make the page narrow enough to show the table of contents at the top of the page and go to the introduction or summary chapters. On a wide display the chapter numbers are suppressed but on a narrow page they appear.  I see this in the IDE and on Brave (Version 1.41.100 Chromium: 103.0.5060.134 (Official Build) (arm64)).

### `quarto check` Output

```bash

[✓] Checking Quarto installation......OK
      Version: 1.0.37
      Path: /Applications/quarto/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.8.9
      Path: /Applications/Xcode.app/Contents/Developer/usr/bin/python3
      Jupyter: 4.11.1
      Kernels: python3

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

[✓] Checking R installation...........OK
      Version: 4.2.0
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library
      rmarkdown: 2.14

[✓] Checking Knitr engine render......OK
```

### `quarto tools check` Output

```bash
[✓] Inspecting tools

Tool         Status         Installed     Latest  
chromium     Up to date     869685        869685  
tinytex      Up to date     v2022.07      v2022.07
```

### Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [X] included a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] documented the quarto version you're running, by pasting the output from running `quarto check` in the "Quarto Check Output" text area?
- [X] documented the version of the quarto tools you're running, by providing the output from running `quarto tools check` in the "Quarto Tools Check Output" text area?
- [X] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [X] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
cscheid
2022-07-31T16:20:40Z
RaymondBalise
bug
v1.1
closed
`number-sections: false` in _quarto.yml for a HTML book does not work consistently
https://github.com/quarto-dev/quarto-cli/issues/1611