Share via

Restarting sequence field codes

Anonymous
2012-01-03T01:01:07+00:00

Hi everyone,

I've used a heading 1 style to format the main chapter name for each new chapter in my document. As part of the style definition, this style has automatic numbering applied to it so that the chapter headings are all numbered sequentially.

I then used two field codes in the header. The first of these looks like this:

{ STYLEREF "chapter name" \n \* MERGEFORMAT }

The above picks up the numbering in the heading 1 style and populates the field.

The second one looks like this:

{ STYLEREF "chapter name" \* MERGEFORMAT }

The above styleref field code picks ups the content of the heading 1 style and so each new chapter heading is placed in the header for that chapter.

The document has a number of tables and figures etc. that I'd like to be able to number sequentially. I started out using a sequence field code like the following:

{ SEQ Table \* ARABIC }

This works, however when I get to a new chapter I need the numbering to start again from 1. Currently the numbers sequentially increase for each new caption.

I was wondering whether I can somehow use the styleref field codes that I've used in the header to somehow trigger the sequence field codes to renumber when a new chapter starts. Note that I haven't used any section breaks in the document and would prefer to avoid these if possible.

If anyone has any suggestions as to how to solve this, I'd be really grateful.

Thanks in advance.

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-01-03T04:30:45+00:00

[Peter's reply was not showing when I posted this!]

Just use the "reset" switch in the first Table in each chapter that you need to renumber. That is:


{ SEQ Table \r 1 \ ARABIC }*

will cause your named sequence "Table" to restart from 1 (or from any other specified number).

You can also do it through independent sequences named Table1, Table2... You obtain these self-numbered sequence names by pasting a STYLEREF field inside the SEQ field:

{ SEQ "Table{ STYLEREF "chapter name" \n }" \* ARABIC }

Note that you do need the quotes here. This has the advantage that you can always use the same field (as above) throughout your document. The above combo is equivalent to using:

  • { SEQ "Table1" \ ARABIC }* in Chapter 1
  • { SEQ "Table 2" \ ARABIC }* in Chapter 2
  • etc.

except that the names are built automatically, according to the value of each **{ STYLEREF "chapter name" \n }"**as it appears each time.

Was this answer helpful?

10+ people found this answer helpful.
0 comments No comments

Answer accepted by question author

Anonymous
2012-01-04T04:55:35+00:00

I would use an AutoCorrect entry instead. Just select the field and assign to it a unique text sequence, like tablenum or table* or /tn/. Then, just typing that keyword will automatically produce { SEQ "Table{ STYLEREF "chapter name" \n }" \ ARABIC }.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

12 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-01-03T03:06:36+00:00

    I also changed the following in the header:

    { STYLEREF "chapter name" \n \* MERGEFORMAT }

    to

    { STYLEREF "chapter name" \s \* MERGEFORMAT }

    This made no difference either.

    Any further suggestions appreciated.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2012-01-03T03:02:40+00:00

    Thanks for the reply,

    Sorry I made a mistake when I said that I used a heading 1 style to format the main chapter. I used a style and that style name was "chapter name".

    I tried out your code by revising the SEQ field code as follows:

    { SEQ Table \* ARABIC \s "chapter name" }

    But this didn't bring about any result, ie. it's still increasing the sequence numbering from the last one.

    Do you know what it hasn't worked?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2012-01-03T01:41:31+00:00

    If you use Insert->Caption to insert the captions for your tables and figures, select the Include Chapter number option, and then look at the field codes that Word creates, you'll see that it inserts something like

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

    which is similar to what you are attempting.

    in STYLEREF, \s undocumented but similar to \n (I forget the difference),  and "1" is an abbreviation for "Heading 1" (handy when internationalising).

    In SEQ, \s means "restart numbering at the specified style", and "1" is also a shorthand for "Heading 1"

    So I would guess that may fill your needs.

    I wasn't sure about this:

    { STYLEREF "chapter name" \n \* MERGEFORMAT }

    Did you mean

    { STYLEREF "Heading 1" \n \* MERGEFORMAT } ?

    Was this answer helpful?

    0 comments No comments