Quarto profiles

Profiles let a Quarto project reuse source documents while changing render settings for a particular audience or product.

Base configuration

Install callout-solution and/or strip-solution and list the filters used by the project in _quarto.yml:

filters:
  - callout-solution
  - strip-solution

callout-solution is appropriate for instructor-only answer callouts; strip-solution is appropriate when student and instructor versions select different divs or code cells.

Profile files

The profile files select output destinations and set the explicit solution visibility switch:

# _quarto-student.yml
project:
  output-dir: _output/student

teaching:
  show-solutions: false
# _quarto-instructor.yml
project:
  output-dir: _output/instructor

teaching:
  show-solutions: true
  default-solution-title: "Solution"

Define Pixi tasks that pass the selected profile to Quarto:

[tasks.preview]
args = [{ "arg" = "profile", default = "student",
          choices = ["student", "instructor"] }]
cmd = "quarto preview --profile {{profile}}"
cwd = "course"

[tasks.render]
args = [{ "arg" = "profile", default = "student",
          choices = ["student", "instructor"] }]
cmd = "quarto render --profile {{profile}}"
cwd = "course"

Contributors can then run commands such as pixi run preview student or pixi run render instructor.

Set teaching.show-solutions explicitly in both profiles. The callout-solution extension can recognize a profile name containing solution as a fallback, but that is not the recommended configuration for new projects.

Existing naming patterns

Different courses use exercise/solution, student/instructor, or student/master. Maintain these existing projects using their configured task names and filters; use student/instructor for new projects.

When profiles matter

Render all affected profiles when changing:

  • Answer text or instructor guidance.
  • Learner starter code or executable solution cells.
  • Links between variants or shared navigation.
  • Profile-dependent format output such as notebooks or PDFs.

Profile behavior relies on extension configuration and metadata as well as the YAML profile file, so investigate all configured parts before changing the visibility model.