computer book

Want to make your cross-references look and act like hyperlinks in your online output and display appropriately (e.g., with page numbers) in your print-based output?

Totally do-able. It's easy to style your cross-references to behave differently depending on which output you place them in. Here's how:

Formatting the cross-reference style

  1. First, we’ll style our hyperlinks. From the Content Explorer, open the stylesheet that you want to modify.
  2. In the local toolbar of the Stylesheet Editor, make sure the Medium is set to (default) and make sure the first button displays Simplified View (which means that the Advanced view is currently shown in the editor).
  3. In the upper-left corner of the editor, click in the Show Styles field and select Show Link Styles.
  4. In the Styles section, select MadCap|xref.
  5. From the Show drop-down list on the upper-right side of the editor, select Show: Assorted Relevant Properties.
  6. Expand the Font property group and do the following:
    1. Click in the field to the right of color.
    2. Select More Colors. The Color Picker dialog opens.
    3. In the # field, type 003366 and click OK.
    4. Click in the field to the right of font-weight and select bold.
    5. Click in the field to the right of text-decoration and select underline
    6. Click in the field to the right of mc-format. The Cross-Reference Format dialog opens.
    7. In the Enter format field, type {para}
    8. Click OK.
  7. In the Styles section, expand the MadCap|xref style.
  8. Expand (Pseudo Classes).
  9. Select hover. Now we’ll change the color of the cross-reference when users hover over it in online output.
  10. Expand the Font property group and do the following.
    1. Click in the field to the right of color.
    2. Select More Colors. The Color Picker dialog opens.
    3. In the # field, type c0c0c0 and click OK.
  11. Now let’s specify settings for print outputs. In the local toolbar of the Stylesheet Editor, make sure the Medium field is set to print.
  12. Select MadCap|xref again.
  13. Expand the Font property group and do the following.
    1. Click in the field to the right of color.
    2. Select More Colors. The Color Picker dialog opens.
    3. In the # field, type 000000 and click OK.
    4. Click in the field to the right of font-weight and select normal.
    5. Click in the field to the right of text-decoration and select none.
    6. Click in the field to the right of mc-format. The Cross-Reference Format dialog opens.
  14. In the Enter format field, type “{para}” {pageref}. Note: The second command in this format, {pageref}, is the key to making the cross-reference change for the PDF output. Depending on how far away the target content is from the link, this command might display any number of possibilities (e.g., See “Other Topic” on page 15, See “Other Topic” on the next page, See “Other Topic” on the previous page, See “Other Topic”above, See “Other Topic” below).
  15. Click OK.
  16. Save your work, and you are done!

Now let’s inset a cross-reference in a topic and see what it looks like in both print and online outputs.

  1. Right-click the place where you want to insert the cross-reference and select Cross-Reference.
  2. In the Link to field, select Topic in Project and select the topic file you want to link to.
  3. In the XRef Class: field, select MadCap:xref and click OK.

Your cross-reference will look like this online:

cross reference image

And it will look like this in print:

xref test image