Cross-reference between documents

I’ve now discovered that you can indeed do cross-referencess between documents, if they are both subdocuments of a master document. The method is obscure, and the help file (although giving a clue) wasn’t much help. Turns out it’s been working from at least 1.0.3 and possibly earlier — now that I’ve learned the secret, I tested it in 1.0.3 and it worked.

Someone pointed me to the help file, which says:

———

Insert reference

Inserting a referenced field to another position in the document. The corresponding text passage has to be defined with “Set Reference” first. Otherwise, inserting a reference by choosing a field name under Selection is not possible.

In master documents, you can also reference from one sub-document to another. Note that the reference name will not appear in the selection field and has to be entered “by hand”.

———

Here’s how to do it.

  1. You must first set references in each subdocument, just as you would when you are cross-referencing within a single document. When you do this, keep a list of what you’ve 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 hovering the mouse pointer over the referenced item. In our example (Figure 1), the heading has the field name word count.

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

  3. Open the master document. In the Navigator (Figure 2), select a subdocument and click the Edit icon. The subdocument opens for editing.
  4. Figure 2. Selecting a subdocument in the Navigator
    Figure 2. 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, on the References page, select Insert Reference in the Type list on the lefthand side (Figure 3). The Selection list in the middle column shows only the reference field names for the subdoc you’re using, so ignore that list and check the list you created manually in step 1.
  7. Figure 3. Fields dialog showing manual entry of field name
    Figure 3. Fields dialog showing manual entry of field name

  8. In the Name field in the lower righthand column, type the name of the reference you set in the subdocument you’re referring to. In our example, the reference happens to be in Chapter 3, and its name is word count.
  9. Click Insert. Nothing will appear in the subdocument except a tiny grey bar indicating a field. If you hover the mouse pointer over this field, you should see the field name (Figure 4).
  10. Figure 4. Viewing the field name
    Figure 4. Viewing the field name

    (You can turn on the display of field codes by clicking Tools > Options > Text Document > View and selecting the Field Codes checkbox. The two fields shown as grey lines in Figure 2 now look like Figure 5.)

    Figure 5. Displaying field codes
    Figure 5. Displaying field codes

  11. Save and close the subdocument and return to the master document window. 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 6), because within the master document, the subdocument can find the target of that field reference.
  12. Figure 6. Field contents showing
    Figure 6. Field contents showing

The above 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.

To test whether this x-ref changes as it should when the target text changes, do this:

  1. Save and close the master document.
  2. Open the master document. Select the subdocument containing the referenced text (Chapter 3 in our example) and click the Edit icon.
  3. Find the referenced text and change it in some way. Save and close the subdocument.
  4. Within the master document, in the Navigator select the subdocument on which you inserted the cross-reference field (Chapter 1 in our example), right-click and choose Update > Links (Figure 7).
  5. Figure 7. Updating links in a master document
    Figure 7. Updating links in a master document

  6. After the links update, navigate to the page when you inserted the cross-reference. You should now see the changed text.
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkedin

Categories

Archives