<exercise>

The exercise tag contains a description of an exercise for readers to perform. It can be freeform, containing elements such as <p>, <figure> or <image>. Alternatively, it can be structured with components such as <statement> and <solution>, or even broken down with the <task> tag.

Syntax

Variants

There are 2 variants of <exercise>.

Examples

An unstructured exercise within the section content

This exercise occurs within other content inside a division (a <paragraphs>), so it appears as a Checkpoint. It is unstructured as it itself contains only <p> tags.

A structured exercises with in a list of exercises

This exercise occurs inside an <exercises> tag, so it is rendered a list item. It is structured to include a hint, solution, and answer.

A complex exercise with task

This exercise is broken down into an introduction, a set of tasks, and a conclusion.

An exercise with a custom number

You can use the number attribute to override the display number of an example. This is useful, for example, when quoting exercises from other textbooks.