Skip to main content

The PreTeXt Guide

Section 26.4 Exercise Component Visibility

The <statement>, <hint>, <answer>, and <solution> elements are collectively the components of exercises, projects (and similar), and tasks they may contain. When you author an exercise, you may only want to have a solution appear at the end of a book, or in a solution manual, and not right where the exercise is born. There are twenty yes/no settings (four components for each of five types of exercises), which control visibility at the location where the content is born. The default value for each is yes, which means the component is visible. See Subsection 44.1.3 for complete details.
This is a good example of settings you may wish to employ differently for different output. Since HTML output automatically puts these components into knowls (Section 29.2), you may be less concerned about having them visible as part of the exercise itself. Conversely, for PDF/print output, you may wish exercise components to only be visible at the end of a book. Note that migrating solutions to another location is accomplished with a <solutions> specialized division (Subsection 4.13.2).
Finally, these settings are observed by the stylesheet which creates a solution manual (see Section 37.1). This might explain why controlling the visibility of a <statement> is of interest.