quarto-dev / quarto-dev/quarto-cli
Conditional content doesn't apply to chapter headings in books
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
I have a book with just an index.qmd and the following _quarto.yml.
project:
type: book
book:
title: "test-book"
chapters:
- index.qmd
format:
html: default
pdf: default
The contents of index.qmd is as follows:
::: {.content-hidden unless-format="html"}
# This header should not appear in PDF {.unnumbered}
:::
This page should not have a header when rendered to PDF.
I would expect the header to appear in the HTML output but not the PDF output, however it shows up in both.
Conditional content for headers works as expected when in a single document, but not in a book.
I'm using Quarto 1.5.33.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue using the shown _quarto.yml and index.qmd files with a book project, then render both HTML and PDF using the reported Quarto 1.5.33 setup. Compare how the conditional chapter heading is handled in each output; done means the heading appears in HTML but not PDF, while the rest of the page remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100