quarto-dev / quarto-dev/quarto-cli

Conditional content doesn't apply to chapter headings in books

Open
#9,630 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

books documentation
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.

Screenshot 2024-05-09 at 8 19 11 AM Screenshot 2024-05-09 at 8 19 40 AM

Conditional content for headers works as expected when in a single document, but not in a book.

Screenshot 2024-05-09 at 8 22 26 AM

I'm using Quarto 1.5.33.

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.