Callout boxes

Bookly provides several types of boxes to highlight different kinds of content. Their style is defined by the current theme, and their titles are translated according to the lang argument of #bookly.with. The previews below use the default fancy theme.

Predefined boxes

Information box

#info-box provides general information or useful advice.

#info-box[This is an information box.]
Information box

Tip box

#tip-box provides tips or recommendations.

#tip-box[This is a tip box.]
Tip box

Warning box

#warning-box warns the reader about a potential danger or important information.

#warning-box[This is a warning box.]
Warning box

Important box

#important-box emphasizes crucial information or key points.

#important-box[This is an important box.]
Important box

Proof box

#proof-box presents proofs or mathematical demonstrations.

#proof-box[This is a proof box.]
Proof box

Question box

#question-box asks questions or proposes problems to solve.

#question-box[This is a question box.]
Question box

Code box

#code-box presents source code or code snippets.

#code-box[This is a code box.]
Code box

Custom boxes

The boxes above are built with the #custom-box function, which you can use to create your own boxes.

#custom-box(
  title: none,
  icon: "info",
  color: rgb(29, 144, 208),
  breakable: true,
)[...]
Argument
<title>: nonestring|content

Title of the box.

Argument
<icon>: "info"string

Name of the icon displayed in the title of the box. Available icons are:

  • alert "alert"
  • info "info"
  • question "question"
  • report "report"
  • stop "stop"
  • tip "tip"
  • code "code"
Argument
<color>: rgb(29, 144, 208)color

Color of the box.

Argument
<breakable>: truebool

If true, the box can be broken across pages.

Example

#let my-box = custom-box.with(title: "My box", icon: "report", color: rgb("#8a2be2"))

#my-box[This is a custom box.]
Custom box
Tip
Defining your own box with custom-box.with(...), as above, is exactly how the predefined boxes are implemented. The box then follows the style of the theme in use.