Paul Howson’s Website

Building a Better Structured Editor

Lists in Word and RTF

In this post we will examine how lists work in Microsoft Word and RTF.

As mentioned in an earlier post, RTF development was intimately tied to the developing capabilities of Microsoft Word. Hence we find that the RTF specification provides us with a window into Word’s document model.

How Lists Work in Word 97 and Later Versions

Word 97 (W97) introduced the sophisticated list behaviours which have carried through to the present day, with some additional embellishments.

If we study the RTF specification, we find that lists are like another kind of style mechanism operating in parallel with paragraph and character styles.

The Microsoft RTF specification explains it thus:

From Word 97 onwards … all the formatting information [for lists] is stored in a pair of document-wide list tables that act as a style sheet, and each individual paragraph stores only an index to one of the tables, like a style index.

Lists work independently of paragraph styles — i.e. you can apply a list format to a paragraph without changing its paragraph style (for example it can retain Normal style while being part of a list) and you can apply a paragraph style without changing the list format. Lists are another style-like mechanism in the document, independent from character or paragraph styles.

Word subsequently added a naming mechanism and user interface for these list formats. Word calls these List Styles, documented in the Word 2007 RTF specification.

For our purpose of understanding the Word list model, we don’t need to dig further into the rather complex way these list styles are implemented in RTF.

Consequences For A Shared List Model

A complication of introducing list styles as a kind of mixin1 to paragraphs or to paragraph styles is that not all markup systems support the notion of a list style. For example InDesign permits only paragraph styles as a way of defining a collection of paragraph format directives and linking these to a paragraph. We will have more to say about InDesign in a later post.

A shared list model will need to be compatible with the lowest common denominator markup system, and for compatibility with InDesign, this would mean combining list styles and paragraph styles in some way. How would we map a combined paragraph style plus list style mixin as described above into a single paragraph style? We will come back to that question later as well. Let’s just flag it for now.

In the next post we will look at Lists in HTML.

Why Did Microsoft Introduce Yet Another Style Mechanism for Lists?

You might be wondering why Microsoft introduced yet another style mechanism for lists? As explained above, this happened in two steps. Initially Microsoft added list formatting as a kind of nameless mixin to paragraphs. This would have kept things simple for the casual user who just wanted to add list behaviour to an existing paragraph — which would already have a paragraph style since all paragraphs in Word must have a paragraph style. List behaviour could thus be added without defining a new paragraph style. It also allowed the provision of pre-defined list formats — bullet, number, outline, heading, etc. — as unnamed but de-facto list styles, without exposing the mechanism as a separate kind of style. Later they revealed the mechanism as List Styles.

  1. In object-oriented programming, mixins are a language concept that allows a programmer to inject some code into a class. In the case of Word, list formats are being mixed into an existing paragraph’s formatting without changing the paragraph style (which you could think of as its class). ↩︎