Chapter 12 Document Structure
Elements such as
<subsection> are called divisions. They are the key organizational elements of the structure of a PreTeXt document and all have (essentially) the same syntax. If a division does not contain any other divisions, then its structure looks like what we see in Listing 12.0.1. (Plenty of other things can go inside other than paragraphs, including figures, etc.)
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
<subsection> (or whatever your subdivision type is),
<conclusion>. This is illustrated in Listing 12.0.2.
Limitations on introductions and conclusions.
There are many tags that are not allowed in introductions and conclusions. In general, avoid things that would have numbers. For instance, one should not put an
<example> or an
<exercise> in an introduction or conclusion.
Paragraphs: like an un-numbered (sub)section.
It can be useful to gather a few items and give them a title, but perhaps those items do not merit their own (sub)section. The
<paragraphs> serves that purpose. A
<title> is required.
<paragraphs> contains two
<p>s. Immediately before, and immediately after this
<paragraphs> there are
<paragraphs> which each contain one
<paragraphs> can contain pretty much anything except for a division.
The role of
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 Chapter 6 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.