Skip to main content
\( \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section1Divisions

Rob Beezer refers to elements such as chapter, section, and subsection as divisions. They are the key organizational elements of a PreTeXt document and all have (essentially) the same structure. If a division does not contain any other divisions, then its structure looks like what we see in Listing 1.1. (Plenty of other things can go inside other than paragraphs, including figures, etc.)

<section>
    <title>Mandatory</title>
    <p>First paragraph.</p>
    <p>Second paragraph.</p>
</section>
Listing1.1The general outline of a section as a model division

If a division has other divisions inside it, then the structure is a bit more complicated and regimented. In particular, if you want text before your first subdivision (subsection in this example), that text must go inside introduction. If you want to start with the subsection, then the introduction is optional. In the “division with subdivisions” model, everything must be contained inside introduction, subsection (or whatever your subdivision type is), exercises, references, or conclusion. This is illustrated in Listing 1.2.

<section>
    <title>Mandatory</title>
    <introduction>
        <p>Introductory text. (Optional.)</p>
    </introduction>
    <subsection>
        <title>Mandatory</title>
        <p>Subsection content.</p>
    </subsection>
    <subsection>
        <title>Mandatory</title>
        <p>Subsection content.</p>
    </subsection>
    <conclusion>
        <p>Concluding text. (Optional.)</p>
    </conclusion>
</section>
Listing1.2A section with subsections.
The role of p tags

One of the things you'll need to keep an eye out for is when things must be wrapped in p (paragraph) tags. Notice that title tags do not have their content wrapped in p, which places some limits on the sorts of things that can be contained in a title. If you find text disappearing or displaying strangely, the culprit is likely an unnecessary or or missing p tag. See the part of the documentation on validating your source for information on how to use some additional tools to see if your PreTeXt file is valid in terms of following the structural rules in the schema.