Skip to main content

Section 3.1 Structure

A PreTeXt document is a nested sequence of structural divisions. For a book, these would go <part>, <chapter>, <section>, <subsection>, and <subsubsection>. Using <part> is optional, but a book must always use <chapter> (or else it is not a book!). No skipping over divisions. For example, you cannot divide a <section> directly into several <subsubsection>s without an intervening <subsection>.

An <article> starts divisions from <section>, though it may choose to have no divisions at all. <paragraphs> are exceptional. They lack a full set of features, but can be used to divide anything, in books or in articles, though they are always terminal since you cannot divide them further. You will have noticed that we prefer the generic term division (rather than “section”) since a <section> is a very particular division.

A division may be unstructured, in which case you fill it with paragraphs and lists and figures and theorems and so on. But if you choose to structure a division it must look like an optional <introduction>, followed by multiple divisions of the next finer granularity, with an optional <conclusion>. Either version may have a single <exercises> division at the end. The structured version may have more than one <exercises>. Finally, there may be a single <references> within a division.

Every division tag can carry an @xml:id attribute, and it is a good practice to (a) provide one, (b) use a very short list of words describing the content, and (c) adopt a consistent pattern of your choosing. Do not use numbers, you may later regret it. These are optional, and with practice you will learn how best to use them. See Section 3.4 just below for more on this.

The <exercises> and <references> tags are special divisions, see Section 4.3 and Subsection 4.7.1.

This explanation is expanded and reiterated at Section 4.6 and is worth reading earlier rather than later.