5  Custom Callouts

This page demonstrates the use of the quarto-custom-callout extension to provide bespoke callout blocks.

5.1 Introduction

Quarto provides a number of built-in callout blocks, including:

Caution

The caution callout

::: { .callout-caution }
The caution callout
:::
Important

The important callout

::: { .callout-info }
The important callout
:::
Tip

The tip callout

::: { .callout-tip }
The tip callout
:::

but these do not cover all the cases we might want to use callouts for. It is possible to change the titles of these callouts, such as:

Custom title

The tip callout with a custom title

::: { .callout-tip title="Custom title"}
The tip callout with a custom title
:::
Not the caution callout
::: { .callout-caution }
## Not the caution callout
:::

but customising the colour and icon of a callout is more difficult. The quarto-custom-callout extension allows us to make our own callouts.

5.2 Defining a new callout

To make a new callout, add a new entry in _quarto.yml in the custom-callout block with the name of the callout. For instance, to add a new case study callout, we could use the code below:

custom-callout:
  callout-case-study:
    title: "Case Study"
    icon-symbol: "🔍"
    color: "#FFA500"

and ensure that the custom-callout filter is called in _quarto.yml:

filters:
  - custom-callout
Callout naming convention

We have chosen to give all of our callouts for this template the prefix callout- for continuity with the builtin callouts, and to aid with literate programming/self-documentation. Please keep to this convention when you define your own callouts.

Tip

Notice that the icon-symbol field accepts unicode icons and emojis.

5.3 Custom callouts in this template

We have defined the custom callouts below:

Case Study

For describing case studies

::: { .callout-case-study }
For describing case studies
:::
Challenge

For presenting a challenge to readers

::: { .callout-challenge }
For presenting a challenge to readers
:::
Data Analysis

For describing datasets and data analysis

::: { .callout-data }
For describing datasets and data analysis
:::
Discussion Questions:

For introducing discussion points

::: { .callout-discussion }
For introducing discussion points
:::
Microbe Profile

For summarising the properties of a microbe

::: { .callout-microbe }
For summarising the properties of a microbe
:::
Question

For presenting a single question to readers

::: { .callout-question }
For presenting a single question to readers
:::
Questions

For presenting multiple questions to readers

::: { .callout-questions }
For presenting multiple questions to readers
:::
Great job!

For general encouragement

::: { .callout-thumbs-up }
For general encouragement
:::
Callout-todo

For highlighting where we still need to do some work

::: { .callout-todo }
For highlighting where we still need to do some work
:::