Cross-referencing between subdocuments

From Apache OpenOffice Wiki
Jump to: navigation, search


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. (An alternative is to use Ian Laurenson’s OutlineCrossRef3 macro, available from http://homepages.paradise.net.nz/hillview/OOo/OutlineCrossRef3-fr-3.odt.)

  1. First set references in each subdocument, just as you would when you are cross-referencing within a single document. When you do this, select the entire text you want to use as the reference, such as a 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.
  2. 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.

    Finding the field name for a heading
    Finding the field name for a heading.

  3. 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.
  4. Selecting a subdocument in the Navigator
    Selecting a subdocument in the Navigator.

  5. In the subdocument, place the cursor where you want the cross-reference to appear. Click Insert > Cross Reference.
  6. 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.
  7. Fields dialog box showing manual entry of field name
    Fields dialog box showing manual entry of field name.

  8. 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.
  9. 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.
  10. Viewing the field name
    Viewing the field name.

    (You can turn on the display of field codes by clicking View > Field Names. The two fields shown as gray lines in the figure above now look like the figure below.)

    Displaying field codes
    Displaying field codes.

  11. After you have inserted all the cross-references required in the subdocument, save and close it and return to the master document window.
  12. 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 (Figure 15), because within the master document, the subdocument can find the target of that field reference.

    Field contents showing where inserted in file
    Field contents showing where inserted in file.

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).
Personal tools