Skip to main content

The PreTeXt Guide

Subsection 44.1.3 Exercise Component Visibility

An <exercise> can appear in four different locations: mixed in with paragraphs and blocks (“inline”), inside an <exercises> specialized division (“divisional”), inside a <worksheet> specialized division (“worksheet”), or inside a <reading-questions> specialized division (“reading”). Also, a <project>, and similar (“project”), behaves in many ways like an <exercise>. All of these elements (or their <task>) may have <statement>, <hint>, <answer>, and <solution> (“components”).
Where such exercises first appear (not, for example, in back-of-the-book solutions) publication switches can control the visibility of the components. There are five elements, each with four attributes, which can take on the values of yes or no. The default is yes, which should be most useful in the early stages of a project. The element <exercise-project> is a misnomer, but is used to avoid confusion with some other use of project. See Section 26.4 for more explanation.
Table 44.1.3.1. Exercise Component Visibility Settings
Publication File Entry Attributes: yes or no values
common/exercise-inline @statement, @hint, @answer, @solution
common/exercise-divisional @statement, @hint, @answer, @solution
common/exercise-worksheet @statement, @hint, @answer, @solution
common/exercise-reading @statement, @hint, @answer, @solution
common/exercise-project @statement, @hint, @answer, @solution