quarto-dev / quarto-dev/quarto-cli

PDF: Erroneous interaction between project type `book` and `{.content-visible when-profile="<PROFILE>"}`

Open
#3,673 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug documentation
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

Using 1.2.269 on linux, bioconductor_docker.
cat /etc/os-release:

NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
...

Includes:

RStudio 2022.07.1+554 "Spotted Wakerobin" Release (7872775ebddc40635780ca1ed238934c3345c5de, 2022-07-22) for Ubuntu Bionic
Mozilla/5.0 (X11; Linux x86_64; rv:107.0) Gecko/20100101 Firefox/107.0

Consider the following:

  1. _quarto.yml:

     profile:
       group:
          - [A, B]
    
  2. index.qmd:

     ::: {.content-visible when-profile="A"}
     # Print in profile A only
     :::
     
     ::: {.content-visible when-profile="B"}
     # Print in profile B only
     :::
    
  3. Call quarto render --to=pdf --profile=A or quarto render --to=pdf --profile=B
    ==> all works as expected. Profile specific content rendered as requested.

  4. Change _quarto.yml to:

     project: 
       type: book
     
     book:
       chapters:
         - index.qmd
     
     profile:
       group:
          - [A, B]
    
  5. Call quarto render --to=pdf --profile=A
    ==> all works as expected. Profile specific content rendered as requested.

  6. Call quarto render --to=pdf --profile=B
    ==> quarto ignores the .content-visible stanzas and renders BOTH!?

Checklist
  • Please include 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.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.

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

Start with the minimal _quarto.yml and index.qmd configuration in the report, then run the two quarto render --to=pdf --profile commands for profiles A and B to reproduce the discrepancy. Trace PDF book rendering and .content-visible when-profile handling; done means profile B renders only its B-specific content, as profile A already does.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.