How to select a profile based on the format? #13307
-
DescriptionIs there a way to somehow always use a specific profile together with certain formats? I.e., I want one profile used when rendering to epub and another profile for everything else. I thought something like this should work: # _quarto.yml
project:
type: book
book:
title: "Some title"
# no chapters
profile:
group:
# the profiles are mutually exclusive
- [default, epub]
# always render with both profiles so I get all 3 formats that I need
default: default,epub # _quarto-default.yml
book:
chapters:
- index.qmd
- part: part1.qmd
chapters:
- 01_chapter.qmd
- 02_chapter.qmd
- part: part2.qmd
chapters:
- 03_chapter.qmd
- 04_chapter.qmd
format:
html: default
pdf: default # _quarto-epub.yml
book:
chapters:
- index.qmd
- part1.qmd
- 01_chapter.qmd
- 02_chapter.qmd
- part2.qmd
- 03_chapter.qmd
- 04_chapter.qmd
format:
epub: default but somehow now both chapter lists are included in the outputs instead of only picking the correct list based on the current format (even though based on the documentation I thought by using I also tried to only have the chapter lists in the respective profile config files, and keep the formats in the main config and then only reference the specific profile per format, i.e., # _quarto.yml
profile:
default: default
format:
html: default
pdf: default
epub:
profile:
default: epub but this just resulted in the default profile being chosen for all. It would be really great the if the render command without any options would just correctly render all formats with the corresponding profile settings and if I specify an individual format (e.g., |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Default profile is supposed to be one profile, here you are merging the two as one default. Use
|
Beta Was this translation helpful? Give feedback.
Default profile is supposed to be one profile, here you are merging the two as one default.
Specifying multiple profiles means to apply them all at once as documented.
Use
quarto render --profile NAME
. This will render the formats defined by the profile.Currently, it means you have to run the command twice:
quarto render
quarto render --profile epub