### 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

- [X] 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.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
jjallaire
2022-12-14T18:05:47Z
r-cheologist
bug documentation
v1.4
open
PDF: Erroneous interaction between project type  `book` and `{.content-visible when-profile="<PROFILE>"}`
https://github.com/quarto-dev/quarto-cli/issues/3673