How to insert captions that include chapter numbers, in documents where some Heading styles are not built-in

For example, if your Appendix Heading styles are not built-in

Article contributed by Lukas Pietsch and Dave Rado

There are two (sensible) ways of doing appendix numbering. One is to use the built-in styles Heading 6–9 for your Appendix styles and define their numbering as part of the same outline numbering definition (List Template) that your Heading 1 style uses. The other way is to create a fresh set of Heading styles for the  Appendixes, linked to their own outline numbering definition. Both methods have pros and cons and there's no right way.

If you go down the former course, creating caption numbering that includes the chapter number is very simple. On the caption numbering sub-dialog of the Caption dialog, link the caption to your Heading 1 style until you get to the Appendices, and link it to the Heading 6 style within the Appendices.

If you go down the route of using non-built-in styles for your Appendix headings, it's almost as simple but far less obvious. It's a bit more fiddly to set up, but once set up it's easy as pie.

If you include chapter numbering in your caption numbers, the caption number consists of two fields; a StyleRef field to pick up the chapter number, and a SEQ field to number the caption. If you press Alt+F9 to display field codes you will see something like:

Table { STYLEREF 1 \s } { SEQ Table \* ARABIC \s 1 }

Where the 1 implies that you've linked your caption to the Heading 1 style.

The \s in the StyleRef field is undocumented, but it causes the field to display only the number from the style, without any text that may also be defined in the numbering – for example, it displays A, and not Appendix A.

The \s in the SEQ field means restart numbering whenever you hit this style.

Now edit both fields manually (this is a one-off), so that both fields contain the style name of your chapter-level Appendix heading style in quotes in place of the 1; and in order to modify the identifier used by the SEQ field (so in this example, change Table to something else) . It should now look something like this:

Table { STYLEREF "Heading 1 Appendix" \s } { SEQ AppendixTable \* ARABIC \s "Heading 1 Appendix" }

Update the field (F9), display the field results instead of the field code (Alt+F9), and you should see something like this:

Table A–1

Now highlight the paragraph containing your field, and create an AutoText entry from it. Then hold the Shift key down and select File + Save All, in order to save the new AutoText entry.

From now on, all you need to do in order to insert a caption number in your Appendices is type the name of the AutoText entry and press F3 (or use AutoComplete)..

You might want to define more than one such AutoText entry; one for Figures and one for Tables, for example.