Skip to main content

Section 21.1 Inline exercises

You can put an <exercise> in the middle of a division, intermixed between theorems and paragraphs and figures. In this case, it is labeled as a “Checkpoint”. 1  You can also put a bunch of <exercise>s inside an <exercises> tag within a division, which is the typical way for creating a bunch of exercises togther at the end of a section.

See Chapter 22 for information on how to use something different than “Checkpoint” as the name for these.
      The <c>statement</c> is mandatory.
      Just an suggestion of what to try.
      Just the <q>final answer</q>.
      All the gory details.
Listing 21.1.1. An exercise

The code in Listing 21.1.1 produces the following output:

The statement is mandatory.


Optional. Just an suggestion of what to try.


Optional. Just the “final answer”.


Optional. All the gory details.

Note that you can have multiple <hint>, <answer>, and <solution> elements. But you must put all the <hint>s first, then all the <answer>s, and then all the <solution>s. There are a variety of options for determining where hints, answers, and solutions appear (at all). Check the PreTeXt documentation for information about stringparams.