Skip to main content

The PreTeXt Guide

Section 44.1 Common Options

These are options that might affect several conversions, though the influence may vary from one conversion to the next.

Subsection 44.1.1 Common Chunking Option

Many outputs are produced as a collection of several files, others may only produce a single file. A chunk is a generic, informal term for a portion of an output, typically a single file. This is given as a level, see Section 26.2 for more about levels. The specification is in the attribute
/publication/common/chunking/@level
with a whole number as the value (generally 0 is allowed). This is critical for the construction of HTML output, and ignored for output.

Subsection 44.1.2 Table of Contents Level Option

The depth of the entries in a Table of Contents is given as a level, see Section 26.2 for more about levels. The specification is in the attribute
/publication/common/tableofcontents/@level
with a whole number as the value. A value of 0 is used to indicate that no Table of Contents is desired. Absent this setting, reasonable defaults are supplied, which can vary by conversion and document type.

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.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

Subsection 44.1.4 Fillin Options

The style of fill-in-the-blanks (from a <fillin>) is set by the attributes
  • Text Fillin.
    Set
    /publication/common/fillin/@textstyle
    
    to values underline, box, or shade to influence the style of a fillin within text. The default is underline.
  • Math Fillin.
    Set
    /publication/common/fillin/@mathstyle
    
    to values underline, box, or shade to influence the style of a fillin within math. The default is shade.

Subsection 44.1.5 Em Dash Width Options

The width of spaces on either side of an em dash (the <mdash/> element) is set with the
/publication/common/@emdash-space
attribute having values none (the default) or thin. See Subsubsection 4.1.4.7 for more explanation.

Subsection 44.1.6 Watermarks

The text of a watermark is given as the content of the
/publication/common/watermark
element. An optional scale factor may be given as a positive rational number with the
/publication/common/watermark/@scale
attribute. The default scale is 0.5.
In the text itself avoid obscure characters or symbols, and do not use any markup. Keep it simple. When used with output the scharacters \\ will survive in the text to create multiple lines of text in the watermark. This feature is implemented for and HTML output. See Section 26.5 for more detail and an example.

Subsection 44.1.7 Mermaid

Various themes are available for Mermaid diagrams. To use a theme, set
/publication/common/mermaid/@theme
with a value of the theme name. The default theme is default. See Subsubsection 4.14.3.5 for more information on Mermaid diagrams.

Subsection 44.1.8 QR code image

QR codes for videos and interactive elements can have an image placed in their center. This image file should be square, and stored in the external assets folder. To use this image in your QR codes, use
/publication/common/qrcode/@image
with a value of the file path, relative to external assets folder.
Note that the presence of such an image will increase the raw size of QR codes, which are then genreally shrunk to fit. This will result in a finer grain for the QR code pixels.