<section xml:id="lists" label="section-lists">
<title>List Calisthenics</title>
<subsection>
<title>Lists, Generally</title>
<idx><h>ordered list</h></idx>
<idx><h>list</h><h>ordered</h></idx>
<idx><h>unordered list</h></idx>
<idx><h>list</h><h>unordered</h></idx>
<p>
Use <c>ol</c> to make an ordered list,
<idx><h>ordered list</h></idx>
and <c>ul</c> to make an unordered (bulleted) list.
In both cases, use <c>li</c> for each entry.
If an entry contains more than one paragraph,
then each must be wrapped in <c>p</c>.
<idx><h>unordered list</h></idx>
<idx><h>list</h><h>ordered</h></idx>
<idx><h>list</h><h>unordered</h></idx>
</p>
<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 (<c>p</c>) for the list items of the list of colors.
</p>
<p>
<ol>
<li>First.</li>
<li>
Second<fn>
Footnote in an unstructured list item
</fn>.
</li>
<li>Third.</li>
</ol>
<ul>
<li>
<p>
Red<fn>
One of our favorite colors
</fn>
</p>
</li>
<li>
<p>
Green
</p>
</li>
<li>
<p>
Yellow
</p>
</li>
<li>
<p>
Purple
</p>
</li>
</ul>
</p>
<p>
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 <em>must</em>
structure your list items as paragraphs,
since a list may only appear within a <tag>p</tag> element.
<ol>
<li>
<title>A title on a top-level item</title>
<p>
Level 1, first.
</p>
</li>
<li xml:id="list-two">
<p>
Level 1, second.
<ol>
<li>
<p>
Level 2, first.
</p>
</li>
<li>
<p>
Level 2, second.
<ol>
<li>
<p>
Level 3, first.
</p>
</li>
<li xml:id="list-two-two-two">
<p>
Level 3, second.
<ol>
<li>
<p>
Level 4, first.
</p>
</li>
<li>
<p>
Level 4, second.
</p>
</li>
<li xml:id="list-two-two-two-three">
<title>Title on xref'ed list item</title>
<p>
Level 4, third.
</p>
</li>
</ol>
</p>
</li>
<li>
<p>
Level 3, third.
</p>
</li>
</ol>
</p>
</li>
<li>
<title>A title on a nested item</title>
<p>
Level 2, third.
</p>
</li>
</ol>
</p>
</li>
<li>
<p>
Level 1, third.
</p>
</li>
</ol>
</p>
<p>
Items in ordered lists (only) may be be give an <c>xml:id</c> and then may be the target of an <c>xref</c>.
We test three here, referencing down into the hierarchy above.
Level 1, second: <xref ref="list-two" />.
Level 3, second: <xref ref="list-two-two-two" />.
Level 4, third: <xref ref="list-two-two-two-three" />.
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.
</p>
<p>
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)
<ul>
<li>
<title>A title on a top-level item</title>
<p>
Level 1, first.
</p>
</li>
<li>
<p>
Level 1, second.
<ul>
<li>
<p>
Level 2, first.
</p>
</li>
<li>
<p>
Level 2, second.
<ul>
<li>
<p>
Level 3, first.
</p>
</li>
<li>
<p>
Level 3, second.
<ul>
<li>
<p>
Level 4, first.
</p>
</li>
<li>
<p>
Level 4, second.
</p>
</li>
<li>
<p>
Level 4, third.
</p>
</li>
</ul>
</p>
</li>
<li>
<title>A title on a nested item</title>
<p>
Level 2, third.
</p>
</li>
</ul>
</p>
</li>
<li>
<p>
Level 2, third.
</p>
</li>
</ul>
</p>
</li>
<li>
<p>
Level 1, third.
</p>
</li>
</ul>
</p>
<p>
And a total of six levels with a mix of ordered and unordered lists,
the most that out-of-the-box-<latex /> is able to handle.
<ol>
<li>
<p>
Level 1, first.
</p>
</li>
<li>
<p>
Level 1, second.
<ol>
<li>
<p>
Level 2, first.
</p>
</li>
<li>
<p>
Level 2, second.
<ul>
<li>
<p>
Level 3, first.
</p>
</li>
<li>
<p>
Level 3, second.
<ol>
<li>
<p>
Level 4, first.
</p>
</li>
<li>
<p>
Level 4, second.
<ol>
<li>
<p>
Level 5, first.
</p>
</li>
<li>
<p>
Level 5, second.
<ul>
<li>
<p>
Level 6, first.
</p>
</li>
<li>
<p>
Level 6, second.
</p>
</li>
<li>
<p>
Level 6, third.
</p>
</li>
</ul>
</p>
</li>
<li>
<p>
Level 5, third.
</p>
</li>
</ol>
</p>
</li>
<li>
<p>
Level 4, third.
</p>
</li>
</ol>
</p>
</li>
<li>
<p>
Level 3, third.
</p>
</li>
</ul>
</p>
</li>
<li>
<p>
Level 2, third.
</p>
</li>
</ol>
</p>
</li>
<li>
<p>
Level 1, third.
</p>
</li>
</ol>
</p>
<p>
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 be rendered in LaTeX, but not in HTML.
<ol marker="*I*">
<li>
<p>
Level 1, first.
</p>
</li>
<li>
<p>
Level 1, second.
<ol marker="++A">
<li>
<p>
Level 2, first.
</p>
</li>
<li>
<p>
Level 2, second.
<ol marker="1)">
<li>
<p>
Level 3, first.
</p>
</li>
<li>
<p>
Level 3, second.
</p>
</li>
<li>
<p>
Level 3, third.
</p>
</li>
</ol>
</p>
</li>
<li>
<p>
Level 2, third.
</p>
</li>
</ol>
</p>
</li>
<li>
<p>
Level 1, third.
</p>
</li>
</ol>
</p>
<p>
A nested unordered list,
with labels given as squares on the outer list and nothing (blank) on the inner lists.
<ul marker="square">
<li>
<p>
Level 1, first.
</p>
</li>
<li>
<p>
Level 1, second.
<ul marker="">
<li>
<p>
Level 2, first.
</p>
</li>
<li>
<p>
Level 2, second.
</p>
</li>
</ul>
</p>
</li>
<li>
<p>
Level 1, third.
</p>
</li>
</ul>
</p>
<p>
A nested ordered list, to test intramural cross-references.
<ol>
<li>
<p>
Level 1, first.
</p>
</li>
<li xml:id="list-item-second">
<p>
Level 1, second.
<ul marker="">
<li>
<p>
Level 2, first.
</p>
</li>
<li>
<p>
Level 2, second.
</p>
</li>
</ul>
</p>
</li>
<li>
<p>
Level 1, third.
With a cross-reference to second list item,
<xref ref="list-item-second" />.
</p>
</li>
<li>
<p>
Level 1, fourth.
Whose number should not change when the knowl just prior is opened.
</p>
</li>
</ol>
</p>
<p>
An ordered list may begin at zero by using a numeral zero in the <attr>label</attr> attribute,
instead of numeral one.
<ol marker="(0)">
<li>First</li>
<li>
<p>
Second
<ol marker="-0-">
<li>Uno</li>
<li>Dos</li>
<li>Tres</li>
</ol>
</p>
</li>
<li>Third</li>
</ol>
</p>
<p>
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.
</p>
<definition>
<title>Group</title>
<idx>Group</idx>
<statement>
<p>
<idx><h>group</h><h>definition</h></idx>
<idx><h>paragraph</h><h>initial list</h></idx>
<ol marker="a)">
<li>
There is a binary operation, denoted
<q><m>\cdot</m></q>.
</li>
<li>The operation is associative.</li>
<li>There is an identity element, <m>e</m>.</li>
<li>
<p>
For every element <m>b</m>, there is an element <m>c</m>
(the inverse),
such that
<me>
b\cdot c=c\cdot b = e
</me>.
</p>
</li>
</ol>
</p>
<p>
If these conditions are met for a set <m>G</m>,
then we say <m>G</m> is a <term>group</term>.
</p>
</statement>
</definition>
<p>
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.
</p>
<p>
Similarly, References may have lists in their annotations.
Unlikely?
But possible.
</p>
<p>
The next two subdivisions are an Exercises subdivision and a References subdivision,
which have lists within an exercise and a bibliographic item
(respectively).
</p>
</subsection>
<subsection>
<title>List Spacing, I</title>
<p>
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).
<ol cols="2" marker="(a)">
<li>One item.</li>
<li>
<em>Two</em>
<alert>ducks</alert>.
</li>
<li>
Three items.
Plus a few more words to check that long entries in a two column list look good.
</li>
<li>Four items.</li>
<li>
Another long entry that simultaneously tests that long entries look good in a list,
and also tests an odd number of entries in a two column list.
</li>
</ol>
</p>
</subsection>
<subsection>
<title>List Spacing, II</title>
<p>
This is another short list that ends a subsection,
so can be used to address the necessary spacing.
<ul cols="2">
<li>Uno item.</li>
<li>Dos items.</li>
<li>Tres item.</li>
<li>Quattro items.</li>
</ul>
</p>
<p>
And a paragraph after that list so that spacing can be checked.
</p>
</subsection>
<subsection xml:id="test-second">
<title>List items containing only inline math</title>
<assemblage xml:id="math-list-test">
<title>Testing list items containing only math</title>
<p>
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 /> <c>\displaystyle</c> command.
However, it would be nice if a list item containing only math used display mode by default.
</p>
<p>
<ol>
<li>
<p>
A list item containing some text in a paragraph,
as well as some inline math:
<m>\int_a^b x^2\,dx = \frac{x^3}{3}</m>.
</p>
</li>
<li>
A list item with text and math <m>\int_a^b x^2\,dx</m>,
not in a paragraph.
</li>
<li>
<m>\frac{d}{dx}\tan(x) = \sec^2(x) = \frac{1}{\cos^2(x)}</m>
</li>
<li><m>\sum_{i=0}^n r^i = \frac{1-r^{n+1}}{1-r}</m></li>
</ol>
<idx><h><m>\int f(x)\,dx</m></h></idx>
<idx><h>math in lists <m>\frac{d}{dx}(\sin(x))=\cos(x)</m></h></idx>
</p>
<p>
Now, a <c>p</c> that isn't in a list,
followed by a list that's in a <c>p</c>.
</p>
<p>
<ul>
<li>
<p>
<m>\sum_{n=1}^\infty\frac{1}{n^2}=\frac{\pi^2}{6}</m> A list item starting with some math,
followed by text, all in a <c>p</c>
</p>
</li>
<li><m>\frac{a}{b}\div \frac{c}{d} = \frac{ad}{bc}</m></li>
<li>
<m> \tan\theta = \frac{\sin\theta}{\cos\theta} </m>
</li>
</ul>
</p>
</assemblage>
<p>
The above assemblage had some lists in it,
just to see what will happen.
While we're at it,
we might try adding lists that are in a <c>list</c>.
</p>
<list>
<title>A list of items, some of which contain math</title>
<ol>
<li>
<p>
A first list item, containing some text.
The next list item will contain only math,
with the <c>m</c> tag inline with the <c>li</c> tag.
</p>
</li>
<li>
A list item with text and math <m>\int_a^b x^2\,dx</m>,
not in a paragraph.
</li>
<li><m>\int_a^b f'(x)\, dx = f(b)-f(a)</m></li>
<li>
<p>
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 <c>p</c>,
first inline,
and then after a line break.
</p>
</li>
<li>
<m>\frac{d}{dx}\sec^{-1}(x) = \frac{1}{x\sqrt{x^2-1}}</m>
</li>
<li>
<m>\frac{d}{dx}\sec^{-1}(x) = \frac{1}{x\sqrt{x^2-1}}</m>
</li>
<li>
<p>
<m>\frac{d}{dx}\sec^{-1}(x) = \frac{1}{x\sqrt{x^2-1}}</m>
</p>
</li>
<li>
<p>
<m>\frac{d}{dx}\sec^{-1}(x) = \frac{1}{x\sqrt{x^2-1}}</m>
</p>
</li>
</ol>
</list>
<p>
And now, a list in a paragraph.
</p>
<p>
<ul>
<li>
<p>
A paragraph that begins with text, then some math:
<m>\sum_{n=1}^\infty\frac{1}{n^2}=\frac{\pi^2}{6}</m> And now some more text.
The next two list items contain:
<ol>
<li>
<p>
Math only, inline.
</p>
</li>
<li>
<p>
Math only, with a newline.
</p>
</li>
<li>
<p>
Math only, but in a paragraph.
Also the next item on this list has math,
just to see what happens in a nested list.
</p>
</li>
<li><m>\int_a^x \frac{d}{dt}f(t)\,dt = f(x)-f(a)</m></li>
</ol>
</p>
</li>
<li><m>\frac{a}{b}\div \frac{c}{d} = \frac{ad}{bc}</m></li>
<li>
<m> \tan\theta = \frac{\sin\theta}{\cos\theta} </m>
</li>
<li>
<p>
<m>\frac{a}{b}\gt \sum_{i=3}^{76}\frac{x^2}{y^2}</m>
</p>
</li>
</ul>
</p>
<p>
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.
</p>
<p>
<ul>
<li><m>\int_a^b \frac{\sin(x)}{x}\,dx</m>,</li>
<li><m>\int_a^b \frac{\sin(x)}{x}\,dx</m></li>
</ul>
</p>
<p>
List items can have titles.
We try that here,
along with testing list items structured with paragraphs.
<ul>
<li>
<title>With <c>\displaystyle</c> added automatically</title>
<p>
<m>\sum_{n=1}^\infty ar^n</m>
</p>
</li>
<li>
<title>Two paragraphs</title>
<p>
<m>\sum_{n=1}^\infty ar^n</m>
</p>
<p>
<m>\sum_{n=1}^\infty ar^n</m>
</p>
</li>
<li>
<title>One paragraph, extra text</title>
<p>
So, <m>\sum_{n=1}^\infty ar^n</m>
</p>
</li>
<li>
<title>Two elements (only)</title>
<p>
<latex /><m>\sum_{n=1}^\infty ar^n</m>
</p>
</li>
</ul>
</p>
</subsection>
<subsection>
<title>Difficult List Items</title>
<p>
In <xref ref="test-second" text="type-global" /> we were careful about lone bits of math inside list items.
The <tag>cd</tag> element is used with indentation,
which is likely superfluous inside a list item that is already being indented.
Here we test lone <tag>cd</tag> elements inside of list items in various configurations.
</p>
<p>
Unordered list, one-deep.
<ul>
<li>
<cd>
<cline>Foo Bar Foo</cline>
<cline>Bar Foo Bar</cline>
</cd>
</li>
<li>
<p>
This list item is a long paragraph with a <tag>cd</tag> in the middle which should be indented some to indicate its participation in the paragraph.
<cd>
<cline>Foo Bar Foo</cline>
<cline>Bar</cline>
<cline>Bar Foo Bar</cline>
<cline>Foo</cline>
</cd>
This list item is a long paragraph with a <tag>cd</tag> in the middle which should be indented some to indicate its participation in the paragraph.
</p>
</li>
<li>
<cd>
<cline>Foo Bar Foo</cline>
<cline>Bar</cline>
<cline>Bar Foo Bar</cline>
<cline>Foo</cline>
</cd>
</li>
</ul>
</p>
<p>
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.
</p>
<p>
Ordered lists, two-deep, mixed.
<ol>
<li>
<p>
First item, outer level.
<ol>
<li>
<cd>
<cline>First inner item, cd only</cline>
<cline>Foo Bar Foo</cline>
<cline>Bar</cline>
<cline>Bar Foo Bar</cline>
<cline>Foo</cline>
</cd>
</li>
<li>
<p>
Second inner item, a paragraph in a list item.
</p>
</li>
<li>
<cd>
<cline>Third inner item, cd only</cline>
<cline>Foo Bar Foo</cline>
<cline>Foo Bar Foo</cline>
<cline>Bar Foo Bar</cline>
</cd>
</li>
</ol>
</p>
</li>
<li>
<cd>
<cline>cd inside second item, outer level</cline>
<cline>Bar</cline>
<cline>Bar Foo Bar</cline>
<cline>Foo</cline>
</cd>
</li>
</ol>
</p>
</subsection>
<subsection>
<title>Description Lists</title>
<p>
Use <c>dl</c> to make a description list
<idx><h>description list</h></idx>.
<idx><h>list</h><h>description</h></idx>
Inside of those tags, use <c>li</c> for each entry.
Then, use <c>title</c> to specify the term being described and <c>p</c> to specify the description.
</p>
<p>
A
<q>description</q>
list
<idx><h>description list</h></idx>
<idx><h>list</h><h>description</h></idx>
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 <c>term</c> tag which just makes a term prominent in a sentence,
and a <c>definition</c>,
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.
<dl>
<li xml:id="cpu-definition">
<title>Central Processing Unit (CPU)</title>
<p>
Controls most of the activities of the computer,
performs the arithmetic and logical operations,
and contains a small amount of very fast memory.
</p>
</li>
<li>
<title>Memory</title>
<p>
Provides storage for the instructions for the CPU and the data they manipulate.
</p>
</li>
<li>
<title>Input/Output (I/O)</title>
<p>
Communicates with the outside world and with mass storage devices
(<eg />, disks).
</p>
</li>
<li xml:id="bus-definition">
<title>Bus!</title>
<p>
A communication pathway with a protocol specifying exactly how the pathway is used.
(The punctuation is just for testing.)
</p>
</li>
<li>
<title><m>\displaystyle \sum_{n=0}^\infty x^n = \frac{1}{1-x}</m></title>
<p>
A geometric series.
The formula is valid if <m>|x| < 1</m>.
</p>
</li>
</dl>
</p>
<p>
Some presentations can be assisted by a hint from the author about the lengths of the titles.
You can choose to provide a <c>width</c> attribute on a <c>dl</c> element with possible values <c>narrow</c> and <c>medium</c>.
The value refers
(somewhat confusingly)
to the distance between the left margin and the description.
The default is <c>medium</c>,
which is illustrated above.
Conversion to <latex /> ignores the attribute.
An example with <c>narrow</c>:
<dl width="narrow">
<li>
<title>Red</title>
<p>
The color of the sun at sunset.
</p>
</li>
<li>
<title>Blue</title>
<p>
The color of a clear sky.
Also a synonym for
<q>depressed or sad</q>, 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!
</p>
</li>
<li>
<title>Aqua</title>
<p>
The color of shallow tropical waters.<fn>
On a sunny day! (Testing footnotes in description lists for <latex /> output.)
</fn>
</p>
</li>
<li xml:id="description-list-math-title">
<title>Math <m>x^2</m></title>
<p>
Sorry, not a color but testing titles with math in them.
</p>
</li>
<li>
<title>
<q>i</q>
before
<q>e</q>
except after
<q>c,</q>
unless it sounds like
<q>a</q>
as in
<q>neighbor</q>
and
<q>weigh</q>
</title>
<p>
Get feisty about that weird counterfeit rule:
seize the day and don't have a heifer, man.
</p>
</li>
<li>
<title>Avocado</title>
<p>
Avocado is the the color with hex code <c>#568203</c>,
and also the main ingredient in guacamole.
</p>
</li>
<li>
<title>Magenta</title>
<p>
Magenta is a color, and a character in Rocky Horror.
</p>
</li>
<li>
<title>Zymurgist</title>
<p>
A scientist who studies the chemical process of fermentation in brewing and distilling.
Also the alphabetically last 9-letter word in the English language.
</p>
</li>
<li>
<title>Byzantium</title>
<p>
Byzantium is the the color with hex code <c>#702963</c>,
and also an ancient Greek city which later became known as Constantinople,
and today is called Istanbul.
</p>
</li>
<li>
<title>Convection</title>
<p>
Circulating motion in a fluid.
</p>
</li>
<li>
<title>Elementary</title>
<p>
No literary detective ever said
<q>Elementary my dear Watson.</q>
In particular, Sherlock Holmes never said that.
</p>
</li>
<li>
<title>Understand</title>
<p>
Perceive the intended meaning of.
</p>
</li>
<li>
<title>Washington</title>
<p>
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
<q>one dime</q>? But how is one to know that a dime is worth 10 cents?
</p>
</li>
<li>
<title>Aquamarine</title>
<p>
Aquamarine is a color, and a mineral.
</p>
</li>
<li>
<title>Those who cannot remember the past are condemned to repeat it.</title>
<p>
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.
</p>
</li>
<li>
<title><m>\displaystyle \zeta(s) = \sum_{n=1}^\infty n^{-s} </m></title>
<p>
The Riemann <m>\zeta</m>-function is defined by a Dirichlet series,
valid for <m> \Re(s) > 1</m>.
</p>
</li>
<li>
<title><c>main()</c> is a void function</title>
<p>
A <c>dl</c> with <c>width="narrow"</c> might be a useful way to give commentary on a program listing.
</p>
</li>
</dl>
</p>
</subsection>
<subsection>
<title>Named Lists</title>
<idx>named list</idx>
<idx><h>list</h><h>named</h></idx>
<p>
A list can be wrapped with a <tag>list</tag> 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 <c>4.5.3:2.a.ii</c>.
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.
</p>
<list xml:id="list-colors-rainbow">
<title>Colors of the Rainbow</title>
<introduction>
<p>
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.
</p>
</introduction>
<ol>
<li>
<p>
Red
</p>
</li>
<li xml:id="rainbow-orange">
<p>
Orange
</p>
</li>
<li>
<p>
Yellow
</p>
</li>
<li>
<p>
Green
</p>
</li>
<li>
<p>
Blue
</p>
</li>
<li>
<p>
Indigo
</p>
</li>
<li>
<p>
Violet
</p>
</li>
</ol>
<conclusion>
<p>
So some people use the acronym <acro>ROY-G-BIV</acro> to remember this sequence.
</p>
</conclusion>
</list>
<p>
This next list is used for testing cross-references to it.
See <xref ref="section-cross-referencing" text="type-global" />.
</p>
<list xml:id="list-to-reference">
<title>A named list of targets</title>
<introduction>
<p>
This is the introduction to this named list,
which references an item within,
via the hybrid <attr>text</attr> attribute:
<xref ref="target-item" text="type-hybrid" />.
At one time this paragraph was inadvertently centered<mdash />that bug has been fixed.
</p>
</introduction>
<ol marker="A">
<li>
<p>
<ol marker="i">
<li>A and i</li>
<li>A and ii</li>
<li>A and iii</li>
</ol>
</p>
</li>
<li>
<p>
<ol marker="a">
<li>B and a</li>
<li>B and b</li>
<li xml:id="target-item">
B and c (target of some cross-references)
</li>
</ol>
</p>
</li>
<li>
<p>
<ul marker="disc">
<li>
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 <tag>introduction</tag> to this list,
an immediately following, but outside the <tag>list</tag>.
</li>
<li>
Cross-reference within named list (<c>global</c>):
<xref ref="target-item" text="type-global" />
</li>
<li>
Cross-reference within named list (<c>hybrid</c>):
<xref ref="target-item" text="type-hybrid" />
</li>
<li>
Cross-reference within named list (<c>local</c>):
<xref ref="target-item" text="type-local" />
</li>
<li>
<p>
<ol marker="1">
<li>C and bullet and 1</li>
<li xml:id="target-no-number">
C and bullet and 2
</li>
<li>C and bullet and 3</li>
</ol>
</p>
</li>
<li>C and bullet</li>
<li>C and bullet</li>
</ul>
</p>
</li>
</ol>
</list>
<p>
This is a paragraph just outside the preceding named list,
which references an item within,
via the hybrid <attr>text</attr> attribute:
<xref ref="target-item" text="type-hybrid" />.
</p>
<p>
<idx><h>list</h></idx>
This is a paragraph with three lists contained within it.
For HTML output we have to
<q>inside-out</q>
the lists.
<ol>
<li>A one item ordered list.</li>
</ol>
In other words, the text before, after, and between,
needs to each be encapsulated as an HTML <c>p</c> element of its own.
<ul>
<li>A one item unordered list.</li>
</ul>
Including definition lists.
<dl>
<li>
<title>Define Me</title>
<p>
A one item definition list.
</p>
</li>
</dl>
That's all!
</p>
<p>
A one item list,
whose item is a paragraph with two contained ordered lists,
separated by text.
<ul marker="square">
<li>
<p>
Introductory text.
<ol marker="A">
<li>First item, first list.</li>
</ol>
Intermediate text.
<ol marker="a">
<li>First item, second list.</li>
</ol>
Concluding text.
</p>
</li>
</ul>
</p>
</subsection>
<subsection>
<title>Testing List Decompositions</title>
<p>
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.
<idx><h>paragraph</h><h>normal</h></idx>
</p>
<p>
<ol>
<li>This paragraph opens with an ordered list.</li>
<li>
Testing the id,
and other info that should be at the top of the paragraph.
</li>
</ol>
Now the paragraph continues,
and we have an index item here,
so we can test cross-references back here.
<idx><h>paragraph</h><h>opens with list</h></idx>
</p>
</subsection>
<exercises>
<title>Exercises (with lists)</title>
<exercise>
<statement>
<p>
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).
<ol>
<li>
<p>
Exercise 1, first part.
</p>
</li>
<li>
<p>
Exercise 1, second part.
<ol>
<li xml:id="exercise-one-two-one">
<p>
Exercise 1, second part, first refinement.
</p>
</li>
</ol>
</p>
</li>
<li xml:id="exercise-one-three">
<p>
Exercise 1, third part.
</p>
</li>
</ol>
</p>
</statement>
</exercise>
<exercise>
<statement>
<table>
<title>Table Alignment Example</title>
<tabular top="minor" left="minor" halign="center">
<col right="medium" />
<col right="major" />
<col />
<row bottom="medium">
<cell colspan="2">1111, 2222</cell>
<cell right="minor">3333</cell>
</row>
<row bottom="major">
<cell>aaaa</cell>
<cell colspan="2" right="medium">bbbb,cccc</cell>
</row>
<row>
<cell bottom="minor">AAAA</cell>
<cell bottom="medium">BBBB</cell>
<cell bottom="major" right="major">CCCC</cell>
</row>
</tabular>
</table>
<p>
This exercise (a list item really) has a <c>table</c> first.
Default <latex /> aligns it vertically above the exercise number.
Placement here tests correcting that alignment.
</p>
</statement>
</exercise>
<conclusion>
<p>
A small test of cross-references to subsidiary parts of exercises.
Exercise 1, third part: <xref ref="exercise-one-three" />.
Exercise 1, second part, first refinement:
<xref ref="exercise-one-two-one" />.
</p>
</conclusion>
</exercises>
<references>
<title>References (with lists in Annotations)</title>
<biblio type="raw" xml:id="biblio-undetermined">
Some book would be listed here.
<note>
<p>
Here is the annotation and an ordered list as part of that annotation.
<ol>
<li>Book 1, first part.</li>
<li>Book 1, second part.</li>
<li>Book 1, third part.</li>
</ol>
</p>
</note>
</biblio>
</references>
</section>
Section 11 List Calisthenics
View Source for section
Subsection 11.1 Lists, Generally
View Source for subsection
<subsection>
<title>Lists, Generally</title>
<idx><h>ordered list</h></idx>
<idx><h>list</h><h>ordered</h></idx>
<idx><h>unordered list</h></idx>
<idx><h>list</h><h>unordered</h></idx>
<p>
Use <c>ol</c> to make an ordered list,
<idx><h>ordered list</h></idx>
and <c>ul</c> to make an unordered (bulleted) list.
In both cases, use <c>li</c> for each entry.
If an entry contains more than one paragraph,
then each must be wrapped in <c>p</c>.
<idx><h>unordered list</h></idx>
<idx><h>list</h><h>ordered</h></idx>
<idx><h>list</h><h>unordered</h></idx>
</p>
<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 (<c>p</c>) for the list items of the list of colors.
</p>
<p>
<ol>
<li>First.</li>
<li>
Second<fn>
Footnote in an unstructured list item
</fn>.
</li>
<li>Third.</li>
</ol>
<ul>
<li>
<p>
Red<fn>
One of our favorite colors
</fn>
</p>
</li>
<li>
<p>
Green
</p>
</li>
<li>
<p>
Yellow
</p>
</li>
<li>
<p>
Purple
</p>
</li>
</ul>
</p>
<p>
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 <em>must</em>
structure your list items as paragraphs,
since a list may only appear within a <tag>p</tag> element.
<ol>
<li>
<title>A title on a top-level item</title>
<p>
Level 1, first.
</p>
</li>
<li xml:id="list-two">
<p>
Level 1, second.
<ol>
<li>
<p>
Level 2, first.
</p>
</li>
<li>
<p>
Level 2, second.
<ol>
<li>
<p>
Level 3, first.
</p>
</li>
<li xml:id="list-two-two-two">
<p>
Level 3, second.
<ol>
<li>
<p>
Level 4, first.
</p>
</li>
<li>
<p>
Level 4, second.
</p>
</li>
<li xml:id="list-two-two-two-three">
<title>Title on xref'ed list item</title>
<p>
Level 4, third.
</p>
</li>
</ol>
</p>
</li>
<li>
<p>
Level 3, third.
</p>
</li>
</ol>
</p>
</li>
<li>
<title>A title on a nested item</title>
<p>
Level 2, third.
</p>
</li>
</ol>
</p>
</li>
<li>
<p>
Level 1, third.
</p>
</li>
</ol>
</p>
<p>
Items in ordered lists (only) may be be give an <c>xml:id</c> and then may be the target of an <c>xref</c>.
We test three here, referencing down into the hierarchy above.
Level 1, second: <xref ref="list-two" />.
Level 3, second: <xref ref="list-two-two-two" />.
Level 4, third: <xref ref="list-two-two-two-three" />.
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.
</p>
<p>
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)
<ul>
<li>
<title>A title on a top-level item</title>
<p>
Level 1, first.
</p>
</li>
<li>
<p>
Level 1, second.
<ul>
<li>
<p>
Level 2, first.
</p>
</li>
<li>
<p>
Level 2, second.
<ul>
<li>
<p>
Level 3, first.
</p>
</li>
<li>
<p>
Level 3, second.
<ul>
<li>
<p>
Level 4, first.
</p>
</li>
<li>
<p>
Level 4, second.
</p>
</li>
<li>
<p>
Level 4, third.
</p>
</li>
</ul>
</p>
</li>
<li>
<title>A title on a nested item</title>
<p>
Level 2, third.
</p>
</li>
</ul>
</p>
</li>
<li>
<p>
Level 2, third.
</p>
</li>
</ul>
</p>
</li>
<li>
<p>
Level 1, third.
</p>
</li>
</ul>
</p>
<p>
And a total of six levels with a mix of ordered and unordered lists,
the most that out-of-the-box-<latex /> is able to handle.
<ol>
<li>
<p>
Level 1, first.
</p>
</li>
<li>
<p>
Level 1, second.
<ol>
<li>
<p>
Level 2, first.
</p>
</li>
<li>
<p>
Level 2, second.
<ul>
<li>
<p>
Level 3, first.
</p>
</li>
<li>
<p>
Level 3, second.
<ol>
<li>
<p>
Level 4, first.
</p>
</li>
<li>
<p>
Level 4, second.
<ol>
<li>
<p>
Level 5, first.
</p>
</li>
<li>
<p>
Level 5, second.
<ul>
<li>
<p>
Level 6, first.
</p>
</li>
<li>
<p>
Level 6, second.
</p>
</li>
<li>
<p>
Level 6, third.
</p>
</li>
</ul>
</p>
</li>
<li>
<p>
Level 5, third.
</p>
</li>
</ol>
</p>
</li>
<li>
<p>
Level 4, third.
</p>
</li>
</ol>
</p>
</li>
<li>
<p>
Level 3, third.
</p>
</li>
</ul>
</p>
</li>
<li>
<p>
Level 2, third.
</p>
</li>
</ol>
</p>
</li>
<li>
<p>
Level 1, third.
</p>
</li>
</ol>
</p>
<p>
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 be rendered in LaTeX, but not in HTML.
<ol marker="*I*">
<li>
<p>
Level 1, first.
</p>
</li>
<li>
<p>
Level 1, second.
<ol marker="++A">
<li>
<p>
Level 2, first.
</p>
</li>
<li>
<p>
Level 2, second.
<ol marker="1)">
<li>
<p>
Level 3, first.
</p>
</li>
<li>
<p>
Level 3, second.
</p>
</li>
<li>
<p>
Level 3, third.
</p>
</li>
</ol>
</p>
</li>
<li>
<p>
Level 2, third.
</p>
</li>
</ol>
</p>
</li>
<li>
<p>
Level 1, third.
</p>
</li>
</ol>
</p>
<p>
A nested unordered list,
with labels given as squares on the outer list and nothing (blank) on the inner lists.
<ul marker="square">
<li>
<p>
Level 1, first.
</p>
</li>
<li>
<p>
Level 1, second.
<ul marker="">
<li>
<p>
Level 2, first.
</p>
</li>
<li>
<p>
Level 2, second.
</p>
</li>
</ul>
</p>
</li>
<li>
<p>
Level 1, third.
</p>
</li>
</ul>
</p>
<p>
A nested ordered list, to test intramural cross-references.
<ol>
<li>
<p>
Level 1, first.
</p>
</li>
<li xml:id="list-item-second">
<p>
Level 1, second.
<ul marker="">
<li>
<p>
Level 2, first.
</p>
</li>
<li>
<p>
Level 2, second.
</p>
</li>
</ul>
</p>
</li>
<li>
<p>
Level 1, third.
With a cross-reference to second list item,
<xref ref="list-item-second" />.
</p>
</li>
<li>
<p>
Level 1, fourth.
Whose number should not change when the knowl just prior is opened.
</p>
</li>
</ol>
</p>
<p>
An ordered list may begin at zero by using a numeral zero in the <attr>label</attr> attribute,
instead of numeral one.
<ol marker="(0)">
<li>First</li>
<li>
<p>
Second
<ol marker="-0-">
<li>Uno</li>
<li>Dos</li>
<li>Tres</li>
</ol>
</p>
</li>
<li>Third</li>
</ol>
</p>
<p>
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.
</p>
<definition>
<title>Group</title>
<idx>Group</idx>
<statement>
<p>
<idx><h>group</h><h>definition</h></idx>
<idx><h>paragraph</h><h>initial list</h></idx>
<ol marker="a)">
<li>
There is a binary operation, denoted
<q><m>\cdot</m></q>.
</li>
<li>The operation is associative.</li>
<li>There is an identity element, <m>e</m>.</li>
<li>
<p>
For every element <m>b</m>, there is an element <m>c</m>
(the inverse),
such that
<me>
b\cdot c=c\cdot b = e
</me>.
</p>
</li>
</ol>
</p>
<p>
If these conditions are met for a set <m>G</m>,
then we say <m>G</m> is a <term>group</term>.
</p>
</statement>
</definition>
<p>
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.
</p>
<p>
Similarly, References may have lists in their annotations.
Unlikely?
But possible.
</p>
<p>
The next two subdivisions are an Exercises subdivision and a References subdivision,
which have lists within an exercise and a bibliographic item
(respectively).
</p>
</subsection>
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.- First.
- Second.
1
Footnote in an unstructured list item - Third.
- Red
2
One of our favorite colors - Green
- Yellow
- Purple
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.-
A title on a top-level item.Level 1, first.
- Level 1, second.
- Level 2, first.
- Level 2, second.
- Level 3, first.
- Level 3, second.
- Level 4, first.
- Level 4, second.
-
Title on xref’ed list item.Level 4, third.
- Level 3, third.
-
A title on a nested item.Level 2, third.
- Level 1, third.
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)
-
A title on a top-level item.Level 1, first.
- Level 1, second.
- Level 2, first.
- Level 2, second.
- Level 3, first.
- Level 3, second.
- Level 4, first.
- Level 4, second.
- Level 4, third.
-
A title on a nested item.Level 2, third.
- Level 2, third.
- Level 1, third.
And a total of six levels with a mix of ordered and unordered lists, the most that out-of-the-box-LaTeX is able to handle.
- Level 1, first.
- Level 1, second.
- Level 2, first.
- Level 2, second.
- Level 3, first.
- Level 3, second.
- Level 4, first.
- Level 4, second.
- Level 5, first.
- Level 5, second.
- Level 6, first.
- Level 6, second.
- Level 6, third.
- Level 5, third.
- Level 4, third.
- Level 3, third.
- Level 2, third.
- Level 1, third.
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 be rendered in LaTeX, but not in HTML.
- Level 1, first.
- Level 1, second.
- Level 2, first.
- Level 2, second.
- Level 3, first.
- Level 3, second.
- Level 3, third.
- Level 2, third.
- Level 1, third.
A nested unordered list, with labels given as squares on the outer list and nothing (blank) on the inner lists.
- Level 1, first.
- Level 1, second.
- Level 2, first.
- Level 2, second.
- Level 1, third.
A nested ordered list, to test intramural cross-references.
- Level 1, first.
- Level 1, second.
- Level 2, first.
- Level 2, second.
- Level 1, third. With a cross-reference to second list item, 2.
- Level 1, fourth. Whose number should not change when the knowl just prior is opened.
An ordered list may begin at zero by using a numeral zero in the
@label
attribute, instead of numeral one.- First
- Second
- Uno
- Dos
- Tres
- Third
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.
Definition 11.1. Group.
View Source for definition
<definition>
<title>Group</title>
<idx>Group</idx>
<statement>
<p>
<idx><h>group</h><h>definition</h></idx>
<idx><h>paragraph</h><h>initial list</h></idx>
<ol marker="a)">
<li>
There is a binary operation, denoted
<q><m>\cdot</m></q>.
</li>
<li>The operation is associative.</li>
<li>There is an identity element, <m>e</m>.</li>
<li>
<p>
For every element <m>b</m>, there is an element <m>c</m>
(the inverse),
such that
<me>
b\cdot c=c\cdot b = e
</me>.
</p>
</li>
</ol>
</p>
<p>
If these conditions are met for a set <m>G</m>,
then we say <m>G</m> is a <term>group</term>.
</p>
</statement>
</definition>
- There is a binary operation, denoted “\(\cdot\)”.
- The operation is associative.
- There is an identity element, \(e\text{.}\)
- For every element \(b\text{,}\) there is an element \(c\) (the inverse), such that\begin{equation*} b\cdot c=c\cdot b = e\text{.} \end{equation*}
If these conditions are met for a set \(G\text{,}\) then we say \(G\) is a group.
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.
Similarly, References may have lists in their annotations. Unlikely? But possible.
The next two subdivisions are an Exercises subdivision and a References subdivision, which have lists within an exercise and a bibliographic item (respectively).
Subsection 11.2 List Spacing, I
View Source for subsection
<subsection>
<title>List Spacing, I</title>
<p>
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).
<ol cols="2" marker="(a)">
<li>One item.</li>
<li>
<em>Two</em>
<alert>ducks</alert>.
</li>
<li>
Three items.
Plus a few more words to check that long entries in a two column list look good.
</li>
<li>Four items.</li>
<li>
Another long entry that simultaneously tests that long entries look good in a list,
and also tests an odd number of entries in a two column list.
</li>
</ol>
</p>
</subsection>
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).
- One item.
- Two ducks.
- Three items. Plus a few more words to check that long entries in a two column list look good.
- Four items.
- Another long entry that simultaneously tests that long entries look good in a list, and also tests an odd number of entries in a two column list.
Subsection 11.3 List Spacing, II
View Source for subsection
<subsection>
<title>List Spacing, II</title>
<p>
This is another short list that ends a subsection,
so can be used to address the necessary spacing.
<ul cols="2">
<li>Uno item.</li>
<li>Dos items.</li>
<li>Tres item.</li>
<li>Quattro items.</li>
</ul>
</p>
<p>
And a paragraph after that list so that spacing can be checked.
</p>
</subsection>
This is another short list that ends a subsection, so can be used to address the necessary spacing.
- Uno item.
- Dos items.
- Tres item.
- Quattro items.
And a paragraph after that list so that spacing can be checked.
Subsection 11.4 List items containing only inline math
View Source for subsection
<subsection xml:id="test-second">
<title>List items containing only inline math</title>
<assemblage xml:id="math-list-test">
<title>Testing list items containing only math</title>
<p>
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 /> <c>\displaystyle</c> command.
However, it would be nice if a list item containing only math used display mode by default.
</p>
<p>
<ol>
<li>
<p>
A list item containing some text in a paragraph,
as well as some inline math:
<m>\int_a^b x^2\,dx = \frac{x^3}{3}</m>.
</p>
</li>
<li>
A list item with text and math <m>\int_a^b x^2\,dx</m>,
not in a paragraph.
</li>
<li>
<m>\frac{d}{dx}\tan(x) = \sec^2(x) = \frac{1}{\cos^2(x)}</m>
</li>
<li><m>\sum_{i=0}^n r^i = \frac{1-r^{n+1}}{1-r}</m></li>
</ol>
<idx><h><m>\int f(x)\,dx</m></h></idx>
<idx><h>math in lists <m>\frac{d}{dx}(\sin(x))=\cos(x)</m></h></idx>
</p>
<p>
Now, a <c>p</c> that isn't in a list,
followed by a list that's in a <c>p</c>.
</p>
<p>
<ul>
<li>
<p>
<m>\sum_{n=1}^\infty\frac{1}{n^2}=\frac{\pi^2}{6}</m> A list item starting with some math,
followed by text, all in a <c>p</c>
</p>
</li>
<li><m>\frac{a}{b}\div \frac{c}{d} = \frac{ad}{bc}</m></li>
<li>
<m> \tan\theta = \frac{\sin\theta}{\cos\theta} </m>
</li>
</ul>
</p>
</assemblage>
<p>
The above assemblage had some lists in it,
just to see what will happen.
While we're at it,
we might try adding lists that are in a <c>list</c>.
</p>
<list>
<title>A list of items, some of which contain math</title>
<ol>
<li>
<p>
A first list item, containing some text.
The next list item will contain only math,
with the <c>m</c> tag inline with the <c>li</c> tag.
</p>
</li>
<li>
A list item with text and math <m>\int_a^b x^2\,dx</m>,
not in a paragraph.
</li>
<li><m>\int_a^b f'(x)\, dx = f(b)-f(a)</m></li>
<li>
<p>
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 <c>p</c>,
first inline,
and then after a line break.
</p>
</li>
<li>
<m>\frac{d}{dx}\sec^{-1}(x) = \frac{1}{x\sqrt{x^2-1}}</m>
</li>
<li>
<m>\frac{d}{dx}\sec^{-1}(x) = \frac{1}{x\sqrt{x^2-1}}</m>
</li>
<li>
<p>
<m>\frac{d}{dx}\sec^{-1}(x) = \frac{1}{x\sqrt{x^2-1}}</m>
</p>
</li>
<li>
<p>
<m>\frac{d}{dx}\sec^{-1}(x) = \frac{1}{x\sqrt{x^2-1}}</m>
</p>
</li>
</ol>
</list>
<p>
And now, a list in a paragraph.
</p>
<p>
<ul>
<li>
<p>
A paragraph that begins with text, then some math:
<m>\sum_{n=1}^\infty\frac{1}{n^2}=\frac{\pi^2}{6}</m> And now some more text.
The next two list items contain:
<ol>
<li>
<p>
Math only, inline.
</p>
</li>
<li>
<p>
Math only, with a newline.
</p>
</li>
<li>
<p>
Math only, but in a paragraph.
Also the next item on this list has math,
just to see what happens in a nested list.
</p>
</li>
<li><m>\int_a^x \frac{d}{dt}f(t)\,dt = f(x)-f(a)</m></li>
</ol>
</p>
</li>
<li><m>\frac{a}{b}\div \frac{c}{d} = \frac{ad}{bc}</m></li>
<li>
<m> \tan\theta = \frac{\sin\theta}{\cos\theta} </m>
</li>
<li>
<p>
<m>\frac{a}{b}\gt \sum_{i=3}^{76}\frac{x^2}{y^2}</m>
</p>
</li>
</ul>
</p>
<p>
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.
</p>
<p>
<ul>
<li><m>\int_a^b \frac{\sin(x)}{x}\,dx</m>,</li>
<li><m>\int_a^b \frac{\sin(x)}{x}\,dx</m></li>
</ul>
</p>
<p>
List items can have titles.
We try that here,
along with testing list items structured with paragraphs.
<ul>
<li>
<title>With <c>\displaystyle</c> added automatically</title>
<p>
<m>\sum_{n=1}^\infty ar^n</m>
</p>
</li>
<li>
<title>Two paragraphs</title>
<p>
<m>\sum_{n=1}^\infty ar^n</m>
</p>
<p>
<m>\sum_{n=1}^\infty ar^n</m>
</p>
</li>
<li>
<title>One paragraph, extra text</title>
<p>
So, <m>\sum_{n=1}^\infty ar^n</m>
</p>
</li>
<li>
<title>Two elements (only)</title>
<p>
<latex /><m>\sum_{n=1}^\infty ar^n</m>
</p>
</li>
</ul>
</p>
</subsection>
Testing list items containing only math.
View Source for assemblage
<assemblage xml:id="math-list-test">
<title>Testing list items containing only math</title>
<p>
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 /> <c>\displaystyle</c> command.
However, it would be nice if a list item containing only math used display mode by default.
</p>
<p>
<ol>
<li>
<p>
A list item containing some text in a paragraph,
as well as some inline math:
<m>\int_a^b x^2\,dx = \frac{x^3}{3}</m>.
</p>
</li>
<li>
A list item with text and math <m>\int_a^b x^2\,dx</m>,
not in a paragraph.
</li>
<li>
<m>\frac{d}{dx}\tan(x) = \sec^2(x) = \frac{1}{\cos^2(x)}</m>
</li>
<li><m>\sum_{i=0}^n r^i = \frac{1-r^{n+1}}{1-r}</m></li>
</ol>
<idx><h><m>\int f(x)\,dx</m></h></idx>
<idx><h>math in lists <m>\frac{d}{dx}(\sin(x))=\cos(x)</m></h></idx>
</p>
<p>
Now, a <c>p</c> that isn't in a list,
followed by a list that's in a <c>p</c>.
</p>
<p>
<ul>
<li>
<p>
<m>\sum_{n=1}^\infty\frac{1}{n^2}=\frac{\pi^2}{6}</m> A list item starting with some math,
followed by text, all in a <c>p</c>
</p>
</li>
<li><m>\frac{a}{b}\div \frac{c}{d} = \frac{ad}{bc}</m></li>
<li>
<m> \tan\theta = \frac{\sin\theta}{\cos\theta} </m>
</li>
</ul>
</p>
</assemblage>
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.- A list item containing some text in a paragraph, as well as some inline math: \(\int_a^b x^2\,dx = \frac{x^3}{3}\text{.}\)
- A list item with text and math \(\int_a^b x^2\,dx\text{,}\) not in a paragraph.
- \(\displaystyle \frac{d}{dx}\tan(x) = \sec^2(x) = \frac{1}{\cos^2(x)}\)
- \(\displaystyle \sum_{i=0}^n r^i = \frac{1-r^{n+1}}{1-r}\)
Now, a
p
that isn’t in a list, followed by a list that’s in a p
.- \(\sum_{n=1}^\infty\frac{1}{n^2}=\frac{\pi^2}{6}\) A list item starting with some math, followed by text, all in a
p
- \(\displaystyle \frac{a}{b}\div \frac{c}{d} = \frac{ad}{bc}\)
- \(\displaystyle \tan\theta = \frac{\sin\theta}{\cos\theta} \)
The above assemblage had some lists in it, just to see what will happen. While we’re at it, we might try adding lists that are in a
list
.And now, a list in a paragraph.
- 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:
- Math only, inline.
- Math only, with a newline.
- Math only, but in a paragraph. Also the next item on this list has math, just to see what happens in a nested list.
- \(\displaystyle \int_a^x \frac{d}{dt}f(t)\,dt = f(x)-f(a)\)
- \(\displaystyle \frac{a}{b}\div \frac{c}{d} = \frac{ad}{bc}\)
- \(\displaystyle \tan\theta = \frac{\sin\theta}{\cos\theta} \)
- \(\displaystyle \frac{a}{b}\gt \sum_{i=3}^{76}\frac{x^2}{y^2}\)
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.
- \(\int_a^b \frac{\sin(x)}{x}\,dx\text{,}\)
- \(\displaystyle \int_a^b \frac{\sin(x)}{x}\,dx\)
List items can have titles. We try that here, along with testing list items structured with paragraphs.
-
With
\displaystyle
added automatically.\(\displaystyle \sum_{n=1}^\infty ar^n\) -
Two paragraphs.\(\sum_{n=1}^\infty ar^n\)\(\sum_{n=1}^\infty ar^n\)
-
One paragraph, extra text.So, \(\sum_{n=1}^\infty ar^n\)
-
Two elements (only).LaTeX\(\sum_{n=1}^\infty ar^n\)
Subsection 11.5 Difficult List Items
View Source for subsection
<subsection>
<title>Difficult List Items</title>
<p>
In <xref ref="test-second" text="type-global" /> we were careful about lone bits of math inside list items.
The <tag>cd</tag> element is used with indentation,
which is likely superfluous inside a list item that is already being indented.
Here we test lone <tag>cd</tag> elements inside of list items in various configurations.
</p>
<p>
Unordered list, one-deep.
<ul>
<li>
<cd>
<cline>Foo Bar Foo</cline>
<cline>Bar Foo Bar</cline>
</cd>
</li>
<li>
<p>
This list item is a long paragraph with a <tag>cd</tag> in the middle which should be indented some to indicate its participation in the paragraph.
<cd>
<cline>Foo Bar Foo</cline>
<cline>Bar</cline>
<cline>Bar Foo Bar</cline>
<cline>Foo</cline>
</cd>
This list item is a long paragraph with a <tag>cd</tag> in the middle which should be indented some to indicate its participation in the paragraph.
</p>
</li>
<li>
<cd>
<cline>Foo Bar Foo</cline>
<cline>Bar</cline>
<cline>Bar Foo Bar</cline>
<cline>Foo</cline>
</cd>
</li>
</ul>
</p>
<p>
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.
</p>
<p>
Ordered lists, two-deep, mixed.
<ol>
<li>
<p>
First item, outer level.
<ol>
<li>
<cd>
<cline>First inner item, cd only</cline>
<cline>Foo Bar Foo</cline>
<cline>Bar</cline>
<cline>Bar Foo Bar</cline>
<cline>Foo</cline>
</cd>
</li>
<li>
<p>
Second inner item, a paragraph in a list item.
</p>
</li>
<li>
<cd>
<cline>Third inner item, cd only</cline>
<cline>Foo Bar Foo</cline>
<cline>Foo Bar Foo</cline>
<cline>Bar Foo Bar</cline>
</cd>
</li>
</ol>
</p>
</li>
<li>
<cd>
<cline>cd inside second item, outer level</cline>
<cline>Bar</cline>
<cline>Bar Foo Bar</cline>
<cline>Foo</cline>
</cd>
</li>
</ol>
</p>
</subsection>
In Subsection 11.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.Unordered list, one-deep.
Foo Bar Foo Bar Foo Bar
- This list item is a long paragraph with a
<cd>
in the middle which should be indented some to indicate its participation in the paragraph.Foo Bar Foo Bar Bar Foo Bar Foo
This list item is a long paragraph with a<cd>
in the middle which should be indented some to indicate its participation in the paragraph. Foo Bar Foo Bar Bar Foo Bar Foo
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.
Ordered lists, two-deep, mixed.
- First item, outer level.
First inner item, cd only Foo Bar Foo Bar Bar Foo Bar Foo
- Second inner item, a paragraph in a list item.
Third inner item, cd only Foo Bar Foo Foo Bar Foo Bar Foo Bar
cd inside second item, outer level Bar Bar Foo Bar Foo
Subsection 11.6 Description Lists
View Source for subsection
<subsection>
<title>Description Lists</title>
<p>
Use <c>dl</c> to make a description list
<idx><h>description list</h></idx>.
<idx><h>list</h><h>description</h></idx>
Inside of those tags, use <c>li</c> for each entry.
Then, use <c>title</c> to specify the term being described and <c>p</c> to specify the description.
</p>
<p>
A
<q>description</q>
list
<idx><h>description list</h></idx>
<idx><h>list</h><h>description</h></idx>
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 <c>term</c> tag which just makes a term prominent in a sentence,
and a <c>definition</c>,
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.
<dl>
<li xml:id="cpu-definition">
<title>Central Processing Unit (CPU)</title>
<p>
Controls most of the activities of the computer,
performs the arithmetic and logical operations,
and contains a small amount of very fast memory.
</p>
</li>
<li>
<title>Memory</title>
<p>
Provides storage for the instructions for the CPU and the data they manipulate.
</p>
</li>
<li>
<title>Input/Output (I/O)</title>
<p>
Communicates with the outside world and with mass storage devices
(<eg />, disks).
</p>
</li>
<li xml:id="bus-definition">
<title>Bus!</title>
<p>
A communication pathway with a protocol specifying exactly how the pathway is used.
(The punctuation is just for testing.)
</p>
</li>
<li>
<title><m>\displaystyle \sum_{n=0}^\infty x^n = \frac{1}{1-x}</m></title>
<p>
A geometric series.
The formula is valid if <m>|x| < 1</m>.
</p>
</li>
</dl>
</p>
<p>
Some presentations can be assisted by a hint from the author about the lengths of the titles.
You can choose to provide a <c>width</c> attribute on a <c>dl</c> element with possible values <c>narrow</c> and <c>medium</c>.
The value refers
(somewhat confusingly)
to the distance between the left margin and the description.
The default is <c>medium</c>,
which is illustrated above.
Conversion to <latex /> ignores the attribute.
An example with <c>narrow</c>:
<dl width="narrow">
<li>
<title>Red</title>
<p>
The color of the sun at sunset.
</p>
</li>
<li>
<title>Blue</title>
<p>
The color of a clear sky.
Also a synonym for
<q>depressed or sad</q>, 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!
</p>
</li>
<li>
<title>Aqua</title>
<p>
The color of shallow tropical waters.<fn>
On a sunny day! (Testing footnotes in description lists for <latex /> output.)
</fn>
</p>
</li>
<li xml:id="description-list-math-title">
<title>Math <m>x^2</m></title>
<p>
Sorry, not a color but testing titles with math in them.
</p>
</li>
<li>
<title>
<q>i</q>
before
<q>e</q>
except after
<q>c,</q>
unless it sounds like
<q>a</q>
as in
<q>neighbor</q>
and
<q>weigh</q>
</title>
<p>
Get feisty about that weird counterfeit rule:
seize the day and don't have a heifer, man.
</p>
</li>
<li>
<title>Avocado</title>
<p>
Avocado is the the color with hex code <c>#568203</c>,
and also the main ingredient in guacamole.
</p>
</li>
<li>
<title>Magenta</title>
<p>
Magenta is a color, and a character in Rocky Horror.
</p>
</li>
<li>
<title>Zymurgist</title>
<p>
A scientist who studies the chemical process of fermentation in brewing and distilling.
Also the alphabetically last 9-letter word in the English language.
</p>
</li>
<li>
<title>Byzantium</title>
<p>
Byzantium is the the color with hex code <c>#702963</c>,
and also an ancient Greek city which later became known as Constantinople,
and today is called Istanbul.
</p>
</li>
<li>
<title>Convection</title>
<p>
Circulating motion in a fluid.
</p>
</li>
<li>
<title>Elementary</title>
<p>
No literary detective ever said
<q>Elementary my dear Watson.</q>
In particular, Sherlock Holmes never said that.
</p>
</li>
<li>
<title>Understand</title>
<p>
Perceive the intended meaning of.
</p>
</li>
<li>
<title>Washington</title>
<p>
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
<q>one dime</q>? But how is one to know that a dime is worth 10 cents?
</p>
</li>
<li>
<title>Aquamarine</title>
<p>
Aquamarine is a color, and a mineral.
</p>
</li>
<li>
<title>Those who cannot remember the past are condemned to repeat it.</title>
<p>
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.
</p>
</li>
<li>
<title><m>\displaystyle \zeta(s) = \sum_{n=1}^\infty n^{-s} </m></title>
<p>
The Riemann <m>\zeta</m>-function is defined by a Dirichlet series,
valid for <m> \Re(s) > 1</m>.
</p>
</li>
<li>
<title><c>main()</c> is a void function</title>
<p>
A <c>dl</c> with <c>width="narrow"</c> might be a useful way to give commentary on a program listing.
</p>
</li>
</dl>
</p>
</subsection>
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.- Central Processing Unit (CPU)
- Controls most of the activities of the computer, performs the arithmetic and logical operations, and contains a small amount of very fast memory.
- Memory
- Provides storage for the instructions for the CPU and the data they manipulate.
- Input/Output (I/O)
- Communicates with the outside world and with mass storage devices (e.g., disks).
- Bus!
- A communication pathway with a protocol specifying exactly how the pathway is used. (The punctuation is just for testing.)
- \(\displaystyle \sum_{n=0}^\infty x^n = \frac{1}{1-x}\)
- A geometric series. The formula is valid if \(|x| < 1\text{.}\)
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
:- Red
- The color of the sun at sunset.
- Blue
- 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!
- Aqua
- The color of shallow tropical waters.
3
On a sunny day! (Testing footnotes in description lists for LaTeX output.) - Math \(x^2\)
- Sorry, not a color but testing titles with math in them.
- “i” before “e” except after “c,” unless it sounds like “a” as in “neighbor” and “weigh”
- Get feisty about that weird counterfeit rule: seize the day and don’t have a heifer, man.
- Avocado
- Avocado is the the color with hex code
#568203
, and also the main ingredient in guacamole. - Magenta
- Magenta is a color, and a character in Rocky Horror.
- Zymurgist
- 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
- 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. - Convection
- Circulating motion in a fluid.
- Elementary
- No literary detective ever said “Elementary my dear Watson.” In particular, Sherlock Holmes never said that.
- Understand
- Perceive the intended meaning of.
- Washington
- 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?
- Aquamarine
- Aquamarine is a color, and a mineral.
- Those who cannot remember the past are condemned to repeat it.
- 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.
- \(\displaystyle \zeta(s) = \sum_{n=1}^\infty n^{-s} \)
- The Riemann \(\zeta\)-function is defined by a Dirichlet series, valid for \(\Re(s) > 1\text{.}\)
-
main()
is a void function - A
dl
withwidth="narrow"
might be a useful way to give commentary on a program listing.
Subsection 11.7 Named Lists
View Source for subsection
<subsection>
<title>Named Lists</title>
<idx>named list</idx>
<idx><h>list</h><h>named</h></idx>
<p>
A list can be wrapped with a <tag>list</tag> 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 <c>4.5.3:2.a.ii</c>.
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.
</p>
<list xml:id="list-colors-rainbow">
<title>Colors of the Rainbow</title>
<introduction>
<p>
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.
</p>
</introduction>
<ol>
<li>
<p>
Red
</p>
</li>
<li xml:id="rainbow-orange">
<p>
Orange
</p>
</li>
<li>
<p>
Yellow
</p>
</li>
<li>
<p>
Green
</p>
</li>
<li>
<p>
Blue
</p>
</li>
<li>
<p>
Indigo
</p>
</li>
<li>
<p>
Violet
</p>
</li>
</ol>
<conclusion>
<p>
So some people use the acronym <acro>ROY-G-BIV</acro> to remember this sequence.
</p>
</conclusion>
</list>
<p>
This next list is used for testing cross-references to it.
See <xref ref="section-cross-referencing" text="type-global" />.
</p>
<list xml:id="list-to-reference">
<title>A named list of targets</title>
<introduction>
<p>
This is the introduction to this named list,
which references an item within,
via the hybrid <attr>text</attr> attribute:
<xref ref="target-item" text="type-hybrid" />.
At one time this paragraph was inadvertently centered<mdash />that bug has been fixed.
</p>
</introduction>
<ol marker="A">
<li>
<p>
<ol marker="i">
<li>A and i</li>
<li>A and ii</li>
<li>A and iii</li>
</ol>
</p>
</li>
<li>
<p>
<ol marker="a">
<li>B and a</li>
<li>B and b</li>
<li xml:id="target-item">
B and c (target of some cross-references)
</li>
</ol>
</p>
</li>
<li>
<p>
<ul marker="disc">
<li>
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 <tag>introduction</tag> to this list,
an immediately following, but outside the <tag>list</tag>.
</li>
<li>
Cross-reference within named list (<c>global</c>):
<xref ref="target-item" text="type-global" />
</li>
<li>
Cross-reference within named list (<c>hybrid</c>):
<xref ref="target-item" text="type-hybrid" />
</li>
<li>
Cross-reference within named list (<c>local</c>):
<xref ref="target-item" text="type-local" />
</li>
<li>
<p>
<ol marker="1">
<li>C and bullet and 1</li>
<li xml:id="target-no-number">
C and bullet and 2
</li>
<li>C and bullet and 3</li>
</ol>
</p>
</li>
<li>C and bullet</li>
<li>C and bullet</li>
</ul>
</p>
</li>
</ol>
</list>
<p>
This is a paragraph just outside the preceding named list,
which references an item within,
via the hybrid <attr>text</attr> attribute:
<xref ref="target-item" text="type-hybrid" />.
</p>
<p>
<idx><h>list</h></idx>
This is a paragraph with three lists contained within it.
For HTML output we have to
<q>inside-out</q>
the lists.
<ol>
<li>A one item ordered list.</li>
</ol>
In other words, the text before, after, and between,
needs to each be encapsulated as an HTML <c>p</c> element of its own.
<ul>
<li>A one item unordered list.</li>
</ul>
Including definition lists.
<dl>
<li>
<title>Define Me</title>
<p>
A one item definition list.
</p>
</li>
</dl>
That's all!
</p>
<p>
A one item list,
whose item is a paragraph with two contained ordered lists,
separated by text.
<ul marker="square">
<li>
<p>
Introductory text.
<ol marker="A">
<li>First item, first list.</li>
</ol>
Intermediate text.
<ol marker="a">
<li>First item, second list.</li>
</ol>
Concluding text.
</p>
</li>
</ul>
</p>
</subsection>
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.This next list is used for testing cross-references to it. See Section 20.
This is a paragraph just outside the preceding named list, which references an item within, via the hybrid
@text
attribute: Item 11.4:B.c. This is a paragraph with three lists contained within it. For HTML output we have to “inside-out” the lists.
- A one item ordered list.
In other words, the text before, after, and between, needs to each be encapsulated as an HTML
p
element of its own.- A one item unordered list.
Including definition lists.
- Define Me
- A one item definition list.
That’s all!
A one item list, whose item is a paragraph with two contained ordered lists, separated by text.
- Introductory text.
- First item, first list.
Intermediate text.- First item, second list.
Concluding text.
Subsection 11.8 Testing List Decompositions
View Source for subsection
<subsection>
<title>Testing List Decompositions</title>
<p>
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.
<idx><h>paragraph</h><h>normal</h></idx>
</p>
<p>
<ol>
<li>This paragraph opens with an ordered list.</li>
<li>
Testing the id,
and other info that should be at the top of the paragraph.
</li>
</ol>
Now the paragraph continues,
and we have an index item here,
so we can test cross-references back here.
<idx><h>paragraph</h><h>opens with list</h></idx>
</p>
</subsection>
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 paragraph opens with an ordered list.
- Testing the id, and other info that should be at the top of the paragraph.
Now the paragraph continues, and we have an index item here, so we can test cross-references back here.
Exercises 11.9 Exercises (with lists)
View Source for exercises
<exercises>
<title>Exercises (with lists)</title>
<exercise>
<statement>
<p>
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).
<ol>
<li>
<p>
Exercise 1, first part.
</p>
</li>
<li>
<p>
Exercise 1, second part.
<ol>
<li xml:id="exercise-one-two-one">
<p>
Exercise 1, second part, first refinement.
</p>
</li>
</ol>
</p>
</li>
<li xml:id="exercise-one-three">
<p>
Exercise 1, third part.
</p>
</li>
</ol>
</p>
</statement>
</exercise>
<exercise>
<statement>
<table>
<title>Table Alignment Example</title>
<tabular top="minor" left="minor" halign="center">
<col right="medium" />
<col right="major" />
<col />
<row bottom="medium">
<cell colspan="2">1111, 2222</cell>
<cell right="minor">3333</cell>
</row>
<row bottom="major">
<cell>aaaa</cell>
<cell colspan="2" right="medium">bbbb,cccc</cell>
</row>
<row>
<cell bottom="minor">AAAA</cell>
<cell bottom="medium">BBBB</cell>
<cell bottom="major" right="major">CCCC</cell>
</row>
</tabular>
</table>
<p>
This exercise (a list item really) has a <c>table</c> first.
Default <latex /> aligns it vertically above the exercise number.
Placement here tests correcting that alignment.
</p>
</statement>
</exercise>
<conclusion>
<p>
A small test of cross-references to subsidiary parts of exercises.
Exercise 1, third part: <xref ref="exercise-one-three" />.
Exercise 1, second part, first refinement:
<xref ref="exercise-one-two-one" />.
</p>
</conclusion>
</exercises>
1.
View Source for exercise
<exercise>
<statement>
<p>
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).
<ol>
<li>
<p>
Exercise 1, first part.
</p>
</li>
<li>
<p>
Exercise 1, second part.
<ol>
<li xml:id="exercise-one-two-one">
<p>
Exercise 1, second part, first refinement.
</p>
</li>
</ol>
</p>
</li>
<li xml:id="exercise-one-three">
<p>
Exercise 1, third part.
</p>
</li>
</ol>
</p>
</statement>
</exercise>
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).
- Exercise 1, first part.
- Exercise 1, second part.
- Exercise 1, second part, first refinement.
- Exercise 1, third part.
2.
View Source for exercise
<exercise>
<statement>
<table>
<title>Table Alignment Example</title>
<tabular top="minor" left="minor" halign="center">
<col right="medium" />
<col right="major" />
<col />
<row bottom="medium">
<cell colspan="2">1111, 2222</cell>
<cell right="minor">3333</cell>
</row>
<row bottom="major">
<cell>aaaa</cell>
<cell colspan="2" right="medium">bbbb,cccc</cell>
</row>
<row>
<cell bottom="minor">AAAA</cell>
<cell bottom="medium">BBBB</cell>
<cell bottom="major" right="major">CCCC</cell>
</row>
</tabular>
</table>
<p>
This exercise (a list item really) has a <c>table</c> first.
Default <latex /> aligns it vertically above the exercise number.
Placement here tests correcting that alignment.
</p>
</statement>
</exercise>
View Source for table
<table>
<title>Table Alignment Example</title>
<tabular top="minor" left="minor" halign="center">
<col right="medium" />
<col right="major" />
<col />
<row bottom="medium">
<cell colspan="2">1111, 2222</cell>
<cell right="minor">3333</cell>
</row>
<row bottom="major">
<cell>aaaa</cell>
<cell colspan="2" right="medium">bbbb,cccc</cell>
</row>
<row>
<cell bottom="minor">AAAA</cell>
<cell bottom="medium">BBBB</cell>
<cell bottom="major" right="major">CCCC</cell>
</row>
</tabular>
</table>
1111, 2222 | 3333 | |
aaaa | bbbb,cccc | |
AAAA | BBBB | CCCC |
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: 11.9.1.c. Exercise 1, second part, first refinement: 11.9.1.b.i.
References 11.10 References (with lists in Annotations)
View Source for references
<references>
<title>References (with lists in Annotations)</title>
<biblio type="raw" xml:id="biblio-undetermined">
Some book would be listed here.
<note>
<p>
Here is the annotation and an ordered list as part of that annotation.
<ol>
<li>Book 1, first part.</li>
<li>Book 1, second part.</li>
<li>Book 1, third part.</li>
</ol>
</p>
</note>
</biblio>
</references>
View Source for biblio
<biblio type="raw" xml:id="biblio-undetermined">
Some book would be listed here.
<note>
<p>
Here is the annotation and an ordered list as part of that annotation.
<ol>
<li>Book 1, first part.</li>
<li>Book 1, second part.</li>
<li>Book 1, third part.</li>
</ol>
</p>
</note>
</biblio>
[1]
Some book would be listed here.
Note.
View Source for note
<note>
<p>
Here is the annotation and an ordered list as part of that annotation.
<ol>
<li>Book 1, first part.</li>
<li>Book 1, second part.</li>
<li>Book 1, third part.</li>
</ol>
</p>
</note>
Here is the annotation and an ordered list as part of that annotation.
- Book 1, first part.
- Book 1, second part.
- Book 1, third part.