<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

Attributes

Attributes for <exercise>
AttributeRequired?Values
component = "…"optionalstring
label = "…"optionalstring
number = "…"optionalAn override for the numbering of the exercise
xml:base = "…"optionalstring
xml:id = "…"optionalstring
xml:lang = "…"optionalstring

Children

The following may appear as children:<answer> <aside> <biographical> <blockquote> <conclusion> <console> <figure> <hint> <historical> <idx> <image> <introduction> <list> <listing> <ol> <p> <pre> <program> <sage> <sbsgroup> <sidebyside> <solution> <statement> <table> <tabular> <task> <title> <video> <webwork>

Parents

This element may appear as an immediate child of the following elements: <appendix> <article> <chapter> <conclusion> <exercisegroup> <exercises> <introduction> <paragraphs> <reading-questions> <section> <subexercises> <subsection> <subsubsection>

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.