Use ol to make an ordered list, and ul to make an unordered (bulleted) list. In both cases, use li for each entry. If an entry contains more than one paragraph, then each must be wrapped in p.
This section contains nested lists, to demonstrate how they get assigned labels (numbering, symbols). But we begin with two simple lists, demonstrating an ordered list and an unordered list. See the end of section for an example of a description list. Note in the source the optional use of a paragraph (p) for the list items of the list of colors.
Next, we have a list with no customization and multiple levels to test the defaults. LaTeX allows a maximum of four levels of ordered/numbered lists, and a total of six levels if some unordered lists are mixed in. Note that to have nested lists you must structure your list items as paragraphs, since a list may only appear within a <p> element.
Items in ordered lists (only) may be be give an xml:id and then may be the target of an xref. We test three here, referencing down into the hierarchy above. Level 1, second: 2. Level 3, second: 2.b.ii. Level 4, third: 2.b.ii.C. Note that if a list item of an ordered list is contained within a list item of an unordered list, then its number will not be defined.
And now a four-level deep unordered list with the default labels supplied by PreTeXt (disc, circle, square, disc). Again, the defalt order for Markdown/Jupyter (disc, square, circle, circle) is different than for LaTeX and HTML (disc, circle, square, disc)
Now, nested lists with the defaults replaced by custom choices. First, an ordered list, three deep, upper Roman numerals, then upper-case Latin, then more traditional Arabic numerals on the three elements of the third level. Note the adornments of the labels will not currently be rendered by WebKitβ3β
en.wikipedia.org/wiki/WebKit
-based browsers (such as Safari) when viewing HTML output.
The next definition is very poorly worded. It is meant to test leading off with a list (bad form), for which LaTeX normally begins right after the heading.
Exercises and References are specialized subdivisions you can put anywhere. They are implemented as top-level lists, so should share behavior. For example, an exercise may have many parts and when expressed as a list, should have the expected labels.
The next two subdivisions are an Exercises subdivision and a References subdivision, which have lists within an exercise and a bibliographic item (respectively).
This is a short list that ends a subsection, so can be used to address the necessary spacing. We also test two XML elements separated by a space (which should not go missing).
Subsection12.4List items containing only inline math
Testing list items containing only math.
There are many places where it makes sense to have a list of mathematical terms, or possibly equations. For example, one might wish to provide a list of derivative formulas. With such lists, the author may wish to have display mathematics, but almost certainly they donβt want it centered. One can work around this by using the LaTeX\displaystyle command. However, it would be nice if a list item containing only math used display mode by default.
The next two list items will contain, respectively, a list item containing only math, where the math is on a new line, then the same again, but with two new lines, and a list item containing math within a p, first inline, and then after a line break.
A paragraph that begins with text, then some math: \(\sum_{n=1}^\infty\frac{1}{n^2}=\frac{\pi^2}{6}\) And now some more text. The next two list items contain:
Inclusion of any text other than math will kill the automatic display style. For example, this would happen if one were to add punctuation after the math.
In SubsectionΒ 12.4 we were careful about lone bits of math inside list items. The <cd> element is used with indentation, which is likely superfluous inside a list item that is already being indented. Here we test lone <cd> elements inside of list items in various configurations.
Intervening paragraph, to illuminate spacing at both the top and bottom of a list. Intervening paragraph, to illuminate spacing at both the top and bottom of a list. Intervening paragraph, to illuminate spacing at both the top and bottom of a list. Intervening paragraph, to illuminate spacing at top and bottom of a list.
Use dl to make a description list. Inside of those tags, use li for each entry. Then, use title to specify the term being described and p to specify the description.
A βdescriptionβ list has a short term or phrase that is prominent, followed by a short description. It is modeled on the lists of similar structure in both LaTeX and HTML. It makes for a nice medium-weight way to define terms, somewhere in-between the term tag which just makes a term prominent in a sentence, and a definition, which is set off, has a heading, a number, and a title. Do not try to manage the separation between the title and the description by employing punctuation (but you can include a question-mark or exclamation-point if necessary). For example, do not include a colon to the end of the title. This example is from Bob Plantz.
Some presentations can be assisted by a hint from the author about the lengths of the titles. You can choose to provide a width attribute on a dl element with possible values narrow and medium. The value refers (somewhat confusingly) to the distance between the left margin and the description. The default is medium, which is illustrated above. Conversion to LaTeX ignores the attribute. An example with narrow:
The color of a clear sky. Also a synonym for βdepressed or sadβ, the title of a 1971 Joni Mitchell album (and more than a dozen other musical albums), the period of Picassoβs work between 1901 and 1904, and much more!
A scientist who studies the chemical process of fermentation in brewing and distilling. Also the alphabetically last 9-letter word in the English language.
Byzantium is the the color with hex code #702963, and also an ancient Greek city which later became known as Constantinople, and today is called Istanbul.
A state, a district, the man on the US $1 bill and on the US quarter. Did you ever notice that on the US dime, the value is stated as βone dimeβ? But how is one to know that a dime is worth 10 cents?
George Santayana wrote those words in 1905. A similar aphorism is misattributed to Winston Churchill. The idea is embodied in the 4th principle: PreTeXt respects the good design practices which have been developed over the past centuries.
A list can be wrapped with a <list> element, so that it earns a number, can be given a title and have an introduction and conclusion. Cross-references to individual list items get a bit involved as they are prefixed with the number of the list and then the number of the item, so conceivably you could get a number like 4.5.3:2.a.ii. The colon is used to indicate the transition from the number of the list within divisions and the numbers coming from the list hierarchy, since it has two small dots.
Because the colors are always in the same order, an ordered list is natural here. The colors change continuously, but are often divided up into large ranges that human perception can easily distinguish.
This is the introduction to this named list, which references an item within, via the hybrid @text attribute: ItemΒ B.c. At one time this paragraph was inadvertently centeredβthat bug has been fixed.
The next three cross-references point to a list item, just above. It is interesting because the list is named, hence numbered. The global reference uses the full number, while the local reference uses the number from within the list. The hybrid reference recognizes that the target is within the same named list, so the number can be shorter. An identical hybrid cross-reference appears within the <introduction> to this list, an immediately following, but outside the <list>.
A list in a paragraph is a construction in HTML that browsers try to correct, which leads to unpredictable results, so we have to decompose an authorβs paragraph with lists into a sequence of HTML paragraphs, interrupted by lists. This subsection is only relevant to HTML output, and only for testing.
This is a list arranged into two columns with some intentional layout challenges. The math is too long to fit in one column and canβt be wrapped - it reduces the number of columns in its row. The long text items can be wrapped and stay within their column.
This exercise should have several parts, and labels should follow the defaults for second-level lists (since the exercise is numbered according to the top-level default).
This exercise (a list item really) has a table first. Default LaTeX aligns it vertically above the exercise number. Placement here tests correcting that alignment.
A small test of cross-references to subsidiary parts of exercises. Exercise 1, third part: 12.10.1.c. Exercise 1, second part, first refinement: 12.10.1.b.i.