OOXML/WordProcessingML/Lists and Numbering

From Apache OpenOffice Wiki
Jump to: navigation, search

Most markup languages like HTML, LaTeX, and ODF text documents have an explicit notion of lists and headings. That is, a list is a container for a sequence of items, each of which in turn is a container for a sequence of paragraphs or sublists. Similarly, headings and heading levels are expressed via some combination of element names and attributes. WordProcessingML differs substantially from this approach, using a more general notion of numbered paragraphs' which result in the same visual rendering, but avoid including structural information directly within the actual content.

Numbered paragraphs

A numbered paragraph is one which has a numbering definition associated with it. These act like counters in CSS, incrementing each time they are used. All paragraphs in a document associated with a particular numbering definition will be given consecutive numbers. They do not have to appear consecutively, but may be spread throughout a document.

A simple, non-nested list, with only one paragraph per item is represented simply as a sequence of paragraphs that share the same, unique numbering definition (that is not used elsewhere in a document). Because the displayed number increments each time, the paragraphs will be numbered 1, 2, 3, etc. The format used for the numbers can either be numeric (arabic digits, roman numerals, letters of the alphabet), or symbolic (a bullet point, square, or tick). Thus, this scheme is used for what HTML calls ordered and unordered lists.

All headings in a document, if they are numbered, use the same numbering definition. Since the counting for a given numbering definition applies across all instances of associated paragraphs throughout the document, this results in all sections being numbered correctly, even though they have other paragraphs between them.

Nesting is achieved using numbering levels. Every numbered paragraph has a numbering level, which defaults to 0. For a nested list, the top-level items would be paragraphs with a numbering level of 0, and sublists would have items with numbering levels of 1 or higher, depending on their levels of nesting. For headings, in the case of a book for example, chapters would be level 0, sections level 1, and subsections level 2. The format of the number displayed for a particular combination of numbering definition and level can be customised to include those from higher levels, e.g. a subsection in a book which is numbered 8.2.5, indicating chapter 8, section 2, subsection 5.

The numbering definition and level for a given paragraph may either be specified either directly as part of the paragraph properties, or indirectly as part of a style. List numbering is normally specified directly, while heading numbering is normally specified via styles.

Numbering definitions

Recovering structure

Personal tools