clay icon indicating copy to clipboard operation
clay copied to clipboard

Not all headings appear in the Quarto table of contents

Open daslu opened this issue 1 year ago • 1 comments

This is probably a Quarto problem. We mention it here first, and may open a Quarto issue after learning the situation a little more.

Following a report of jason1903 in Slack, we see the following. (using Quarto version 1.5.10 pre-release)

The following Quarto document:

---
format:
  html:
    toc: true
---

# A

## AB

### ABC

renders as follows (not showing ABC in the table of contents): image

daslu avatar May 06 '24 05:05 daslu

Verified this behavior in Quarto pre-release version 1.5.32 (the most recent one at the moment).

daslu avatar May 06 '24 05:05 daslu

What about setting toc-depth 3?

genmeblog avatar Jun 11 '24 14:06 genmeblog

Updating following the the Slack thread:

  • Some of the problems I experienced (e.g. the one above) were not because the toc items were hidden, but because they were collapsed (and then can be expended when scrolling to the relevant region in the page). :toc-expand 4 makes sure they are expanded by default.

  • There is another problem that happens when mixing markdown headings and inline html headings, as Jason commented in Slack.

E.g.,

# One Hash

## Two Hashes

### Three Hashes As Clj Comment

### Three Hashes In `kind/md`

```{=html}
<div><h3>An H3 In `kind/hiccup`</h3></div>

This is simply not supposed to be handled by Quarto, as discussed here: https://github.com/quarto-dev/quarto-cli/issues/9738

Many thanks to Jason and the Quarto devs for clarifying this.

daslu avatar Jun 15 '24 19:06 daslu