Skip to main content

The PreTeXt Guide

Subsection 4.11.4 Cross-References to List Content

Note that a list is a container, so it cannot be the target of a cross-reference, and so the three types of lists cannot have an @xml:id attribute. But you may well be able to point at some other structure (e.g., a <remark>) with a paragraph containing a list of interest. If this seems overly restrictive, read below about named lists.
By contrast, a list item, <li>, is not a container, and does contain content. Further, a list item of an ordered list has a marker that is natural text for a cross-reference. So in this situation, the list item can have an @xml:id attribute. But note that the “number” of a list item of an ordered list, which is nested inside a list item of an unordered list, is not defined, so a cross-reference by number can fail.
The “number” of a list item, mostly for the purposes of a cross-reference, is the concatenation of all of the individual markers in the containing lists, outermost first. For example, from the example lists below, the list item with content “Walleye” has number 2.I. These are indivisible, there is no way to get a component, excepting leading subsequences obtained by using an @xml:id on a containing list item. Note that the format codes never become part of the number.