Skip to main content

The PreTeXt Guide

Section 4.1 Paragraphs

Much of your writing will happen in paragraphs, delimited by the simple tag, <p>. You are reading one right now. They are a basic building block of divisions, and also a basic building block of other structures. For example, an ordered list, <ol>, contains a sequence of list items, <li>, and a typical list item might be a sequence of paragraphs. (Do not confuse this element with the anomalous <paragraphs> subdivision, Section 4.6).
Paragraphs are a choke-point of sorts. Many tags can only be used within paragraphs, and many others cannot be used within paragraphs. Notice too, that we do a certain amount of manipulation of whitespace in a paragraph, in ways that you may not even notice.
The following subsections together contain allowed, or encouraged, markup within a paragraph. Many of these may be used in captions and titles, but some of the more complicated constructions (which appear later here) cannot be used in captions or titles.
One more comment: typewriters, computer keyboards, and the ASCII character set have together conspired to limit the full range of characters that typographers and printers have used historically. A case in point is the hyphen, which is a single key on a keyboard. However, there are at least three common dashes of differing lengths (hyphen, en dash, and em dash), and in the context of mathematics or a computer program, the hyphen might be the binary operation of subtraction or the unary operation of negation. Another example is the “upright”, or “dumb”, quote mark that is a single key on a keyboard, while careful typography will employ “smart”, or “curly”, quote marks that have left and right variants. (Sometimes called “66” and “99” based on their shape.) PreTeXt will help you navigate this complexity, but you will want to use keyboard characters or markup appropriately. So if you care about communicating clearly, and making your writing easy for a reader to use, absorb the details that follow and the philosophy they implement.
We will say it again. PreTeXt is a markup language, and our various output formats (, HTML, EPUB, Jupyter notebooks) in turn employ markup languages. These use different escape characters and give different characters special meanings. Our job is to insulate you from this variety, so you can concentrate on authoring your ideas.
We begin with some simple “grouping” elements which contain several excellent examples of the importance and utility of careful markup. There is a plethora of empty tags for individual characters, and these are very important (see Subsection 4.1.4). We defer them to the end of this section, since they are not as instructive, but do not think this means they are an afterthought. They can be extremely critical for successful conversions. Also do not miss Best Practice 4.1.0.8 in the conclusion of this section.

Best Practice 4.1.0.8. Understand the Importance of Careful Markup.

There is a lot of detailed information in this section. Much of it is critically important. If you are new to thinking in terms of markup (rather than WYSIWYG tools), it might be overwhelming, a lot to digest, and hard to separate the wheat from the chaff. Careful here means using the necessary markup, not using it for other purposes different than its intent (tag abuse), planning ahead for different output formats, but not becoming a slave to over-doing it.
So come back here often for a re-read. And keep in mind that PreTeXt is designed around principles (List 1.1.0.1), and that it is markup (Item 1.1.0.1:1) which enables multiple outputs (Item 1.1.0.1:3) and effective and beautiful online versions (Item 1.1.0.1:6).