Chapter number in caption of an specific Heading

Hi,

I created a new Numbered Heading Style. Besides, I want that my table captions have the chapter number of my Numbered Heading, but the only options that I see when I try to include the numbering to my captions are Heading 1, Heading 2, etc. that come by default. In the list don't appear my Styles. How can I add the Headings that I created to the list, so the captions have the number of my Numbered Heading?

Thanks

 

Question Info


Last updated August 27, 2019 Views 1,101 Applies to:
Answer
Answer

Unfortunately, the caption dialog works only with the built-in heading styles. There is no way to add custom styles to the list.

Edit: The following proposal doesn't quite work as originally written. The chapter number does appear correctly, but then the figure or table number doesn't restart after each chapter heading (but does restart if you also have a real Heading 1 paragraph). The edited section at the end shows how to fix that.

However, you can alter the results afterward. When you choose the chapter-number option in the dialog, Word places a field in each caption to display the chapter number. If you choose Heading 1, for example, the field code looks like

{ STYLEREF 1 \s }

In your document, you can display the field codes (Alt+F9 to display all field codes, or select one field and Shift+F9 to display that one code) and replace the number 1 with the name of your custom style. (If the style name has any spaces, surround it with double-quote marks.) Then press F9 to update the field, and it will display the number of the most recent heading in that style.

If you wait until all your captions are inserted with Heading 1 numbers, you can display all the field codes (Alt+F9) and use the Replace dialog to replace all instances of STYLEREF 1 with STYLEREF <your style name>. Then press Alt+F9 again to collapse the codes, press Ctrl+A to select the whole document, and press F9 to update all the fields.

Edit: In addition to the procedure above, you need to modify the SEQ fields that provide the figure or table numbers. The fields as inserted by the Caption dialog look like this (assuming you chose Heading 1 in the dialog):

{ SEQ Figure \* ARABIC \s 1 }

or

{ SEQ Table \* ARABIC \s 1 }

The procedure here is similar to the one above. Display all the field codes with Alt+F9. Open the Replace dialog, enter the code SEQ Figure \* ARABIC \s 1 in the Find What box, and enter the code without the \s 1 (that is, just SEQ Figure \* ARABIC) in the Replace With box. Click the Replace All button and close the dialog. Now, go to the first figure or table after each chapter starts, and insert the code \r 1 after the word ARABIC and before the closing field brace. Finally, press Alt+F9, Ctrl+A, and F9 to update the fields. 

Give me a little more time and I'll post a macro that does all of this with one button.

_____________________________
https://jay-freedman.info

2 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

Answer
Answer

Give me a little more time and I'll post a macro that does all of this with one button.

The macro is in an add-in that I posted at http://jay-freedman.info/custom_style_captions.htm.

If you try it and have any trouble with it, please send me details at the email address listed at http://jay-freedman.info/contact/contact.htm.

_____________________________
https://jay-freedman.info

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.