Cross-referencing between subdocuments
The methods described earlier in this chapter are all most writers will need when using master documents. However, you might need to automatically update cross-references between subdocuments. This section describes how to do this.
The process to create cross-references between subdocuments is tedious, but it works.
Preparing items as targets for cross-referencing
Before you can insert a cross-reference to anything that is not automatically shown on the References tab, such as a heading, you must prepare or “set” that heading as an item to be referenced. To do this, you can either use bookmarks or set references.
When you set references, be sure to select the entire text you want to use as the reference, such as a heading or figure number. Keep a list of what you have named the reference fields, and be sure every name is unique. One way to keep track of this information is by putting it in a separate text file or a spreadsheet.
The field names are case-sensitive. You can check the field name by holding the cursor over the referenced item. In our example, the heading has the field name word count.
Bookmarks are listed in the Navigator and can be accessed directly from there with a single mouse click. In HTML documents, bookmarks are converted to anchors that you can jump to via hyperlink.
- Select the text you want to bookmark. Click Insert > Bookmark.
- On the Insert Bookmark dialog box, the larger box lists any previously defined bookmarks. Type a name for this bookmark in the top box. Click OK.
- Click Insert > Cross reference.
- On the References tab of the Fields dialog box, click Set Reference in the Type list. The Selection list shows any references that have been defined.
- Click in the document and highlight the text of the first heading to be used as a target for a cross-reference. Click on the Fields dialog box. The text of the heading will appear in the Value box in the lower right of the dialog box. In the Name box, type some text by which you can identify this heading.
- Click Insert. The text you typed in the Name box now appears in the Selection list.
- Repeat steps 3 and 4 as often as required.
You can leave this page open while you set many headings as references.
Inserting the cross-references
- Open the master document. In the Navigator, select a subdocument and click the Edit icon (or right-click and choose Edit from the pop-up menu). The subdocument opens for editing.
- In the subdocument, place the cursor where you want the cross-reference to appear. Click Insert > Cross Reference.
- In the Fields dialog box, on the References page, select Insert Reference in the Type list on the left hand side. The Selection list in the middle column shows only the reference field names for the subdocument you are using, so ignore that list and check the list you created manually in step 1.
- In the Name field in the lower right hand column, type the name of the reference you set in the subdocument you are referring to. In our example, the reference is in Chapter 3, and its name is word count.
- Click Insert, type any text you want to appear between the reference and page number (such as “on page”), and then insert another reference with the Page format. Nothing will appear in the subdocument except tiny gray bars indicating the fields. If you hover the mouse pointer over one of these fields, you should see the field name.
- After you have inserted all the cross-references required in the subdocument, save and close it and return to the master document window.
(You can turn on the display of field codes by clicking View > Field Names. The two fields shown as gray lines above now look like the figure below.)
Within the master document, navigate to the page of the subdocument on which you inserted the cross-reference field. You should now see the text of the cross-reference appear in the spot where you inserted it, because within the master document, the subdocument can find the target of that field reference.
This technique also works if you open a subdocument directly in step 2 (that is, not from within the master document) and insert a cross-reference field.
|Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).|