In addition to cross-references (see previous pages), you can also insert style references into the text.
A style reference is a field that works as follows: It searches the document (from the place where you inserted it) backwards for text that is formatted in the paragraph style you selected – and then displays this text.
This can be useful, for example, in the following situation:
Large documents are usually organized according to an outline, and thus have headings with several levels. The easiest way to achieve this is to format the headings in the predefined paragraph styles "Heading 1", "Heading 2", etc. If you now insert a style reference field into any place in the text and let it search for the style "Heading 1", for example, the field automatically finds the main heading valid for this place in the text and displays it.
Such fields are most often used in the headers or footers of books and other large documents in order to display the main heading of the current chapter.
Inserting a style reference field
To insert a style reference field into the text, proceed as follows:
1. | Move the text cursor to the place in the text where the style reference field is to be inserted. |
2. | Click on the arrow of the icon on the ribbon tab References | group Fields | Field. |
3. | Click on the entry Style reference in the dropdown menu, and select the style for which you want to search from the submenu. |
Alternatively, click on the entry More in the dropdown menu (or on the Field icon itself) to open the dialog box with further options (see below). |
4. | Only in the dialog box: Click on the Insert button. |
Write now inserts the style reference field into the text.
The field then automatically searches for text formatted with the specified paragraph style. It first searches backwards (towards the beginning of the document). If nothing is found in this direction, it also searches forwards (towards the end of the document).
As soon as the program finds text formatted in the desired style, the field displays that text. If, for example, you had selected the paragraph style "Heading 1", the field would display the current main heading for the section of text in which the field was inserted. (Of course, this assumes that all headings in the document have been formatted with the paragraph style "Heading 1".)
If nothing is found, the field shows the error message "Style reference: No matching text found!". Then verify that you are looking for the correct style and that there is actually text that was formatted in this style.
Options of the dialog box
The dialog box contains the following options:
▪Style
In this list, select the style for which you want to search. |
▪Search for character styles
Usually, style reference fields are used to search for paragraph styles. However, you can also search for character styles by enabling this option. The Style list then contains character styles rather than paragraph styles. |
▪Search page from bottom
This applies only to style reference fields inserted into headers or footers because they use a special search order: |
First, only the current page is searched for text in the selected style in the following direction: |
If this option is disabled, the program searches the page from top to bottom. |
If this option is enabled, the program searches the page from bottom to top (backwards). |
The search will then continue "normally" regardless of this option: So the pages before the current page (backwards) are first searched. If nothing is found, the pages after the current page are also searched (forwards). |
▪Insert paragraph number
If this option is enabled, the style reference field returns the numbering of the text rather than the actual text formatted in the desired style. |
Of course, this only works if numbering has been applied to the text. For more information, see also Automatic numbering and Numbering headings. |
▪Insert "above" or"below"
If this option is enabled, the style reference field no longer returns the text formatted in the desired style but only the specified position "above" or "below": |
If the location is above the field, the field returns the text "above". |
If the location is below the field, it returns the text "below". |
In this way, references such as "see above" or "see below" can be inserted. |
Updating style reference fields
Like all types of fields, style reference fields are updated automatically before the document is printed. If desired, they can also be updated manually with the ribbon command References | group Fields | Update fields. For more information on working with fields, see Fields.