Restarting list numbering using LISTNUM fields

Article contributed by Margaret Aldis

with acknowledgments to Bruce Brown.

This article provides details of how to restart numbering on a list of numbered paragraphs by using a LISTNUM field. For other methods of restarting list numbering, see How to restart style-based numbering.

LISTNUM fields generate automatic numbering using the same 'list template' mechanism as paragraph numbering, and so it possible to create a single numbering sequence using a mixture of LISTNUM fields and numbered paragraphs. This provides a method of restarting numbering on list items without overriding their numbered style.

The simplest and safest way of implementing this method is to use a field of the form {LISTNUM \l 1 \s 0} at the end of each list. (The \l flag gives the list level of the numbered style; this is not needed for a single level list.) Resetting the number to 0 at this point means that the next time the same numbered style is used, the numbering sequence will restart at 1. The reason for placing the field at the end of the list is that if no list template name is specified then the LISTNUM field picks up the last numbering sequence used. If you place the field at the beginning of a list (which might seem more natural) then you cannot be sure which numbering sequence will be restarted. For example, if there was a numbered heading before the new list, a LISTNUM field at the list start would restart the heading numbering.

The field needs to be formatted so as not to print. One option is to use a white font, especially if the field shading View option is set to 'Always', so the white number 0 shows up against the grey field shading. Alternatively, you can use hidden font, so the field is visible when you Show non-printing characters, but takes up no space when hidden.

You can insert the field at the end of the last list item, or in a separate paragraph that you add at the end of each list. You can create an AutoText entry for the formatted field to make it easy to insert manually, or you could provide a 'start list' macro that sets the style of the current item to the numbered style, and inserts the field at the end of the next previous paragraph of this style.

Note: It is possible to use a named LISTNUM field where the name refers to the list template that is linked to the style. This allows the LISTNUM restart to refer explicitly to the numbering sequence to be restarted, so the position of the field is not important. However, this explicit reference depends on the name of the list template, and this name can sometimes be lost when styles are updated from template or when styled paragraphs are pasted between documents. To use named list templates to 'mix and match' LISTNUM fields and styles safely, you would need to reset the name on the list template linked to the style programmatically when required.