details::details

BSTA 526 Functions of the Week

Collapsible sections in quarto
Author

Walter Ell

Published

March 5, 2026

See the syllabus for links to presentations from previous years.

1 Function(s) Name(s)

What function(s) is being presented and what package is it from?

#::: {.callout-note collapse="true"}
# ## Two # is one way to make the title
# Content here
#:::

#::: {.callout-note collapse="true" title=" Different title"}
# Content here
#:::

2 What is it for?

Placing text within the nested layer above can cause problems

This formatting allows for quarto to format with collapsible sections to reduce visual clutter.

3 Examples

The three : that are used for the wrapper can cause issues with some packages when using Python

3.1 Be care ful about changing the title

It often overrides other formats within

head(penguins)
# A tibble: 6 × 8
  species island    bill_length_mm bill_depth_mm flipper_length_mm body_mass_g
  <fct>   <fct>              <dbl>         <dbl>             <int>       <int>
1 Adelie  Torgersen           39.1          18.7               181        3750
2 Adelie  Torgersen           39.5          17.4               186        3800
3 Adelie  Torgersen           40.3          18                 195        3250
4 Adelie  Torgersen           NA            NA                  NA          NA
5 Adelie  Torgersen           36.7          19.3               193        3450
6 Adelie  Torgersen           39.3          20.6               190        3650
# ℹ 2 more variables: sex <fct>, year <int>
#::: {.callout-important collapse="true" icon=false appearance=minimal}
# Content here
#:::

The icon can be turned off and the appearance changed

4 Is it helpful?

Useful for making the vertical space of a quarto document less cluttered and more selective. However the formating can be disrupted by other quarto formating. Some extentions to the customization can be done via terminal commands.