is now part of CreativePro.com!

Creating Cross References with Text Anchors

InDesign’s Cross-References panel lets you create x-refs such as “see Oranges and Apples on page 23.” But cross-references have two important limitations:

  • In general, the text you’re referencing needs to be on the page (“Oranges and Apples” in the example above)
  • In general, the text has to have a paragraph style applied to it

However, I say “in general” because there is an easy workaround to both of these: use text anchors instead of relying on paragraph styles.

For example, I want to create a cross-reference that says “See ‘flightless birds’ on page…” (where the page number changes depending on where it falls in the document). However, you can see in the image below that the words “flightless birds” doesn’t even appear on my page! So I’m going to make a text anchor by placing my cursor in the text somewhere, then choosing New Hyperlink Destination from the Hyperlinks panel menu:

adding a text anchor

That let’s me insert a text anchor at the text cursor position. Name the anchor exactly how you want the text to appear in the cross-reference:

Xrefanchor2

More after the jump! Continue reading below
Free and Premium members see fewer ads! Sign up and log-in today.

When you click OK, the anchor will be placed, but it’s invisible so you can’t see it. If Type > Show Hidden Characters is enabled, you’ll see a little colon at the position of the anchor. Or, you can see it clearly if you open Edit > Edit in Story Editor:

Xrefanchor3

You can see above that the anchor is in a paragraph that doesn’t even have a heading paragraph style applied to it. (I normally would always use paragraph styles, but I’m just pointing out that it works even if you don’t.)

Okay, once the anchor is in place, you can position your text cursor wherever you want the cross-reference to be. Then open Window > Text & Tables > Cross-References, and click the New Cross Reference button at the bottom of the panel. In the New Cross-Reference dialog box, change the Link To popup menu to “Text Anchor,” choose the anchor you just made from the Text Anchor popup menu, and then set the Format popup menu to “Text Anchor Name & Page Number” — like this:

Xrefanchor4

When you click OK, InDesign adds your cross reference into the text. Here you can see that it’s inside parentheses, which I typed before adding the x-ref:

Xrefanchor5

Of course, I should probably also go back and add the word “See ” before that x-ref. That’s easy to do.

Why bother with cross-references like this? Because page numbers change! If you have 10 or 100 of these, you don’t want to have to update them manually whenever the document is edited. Cross-references take care of all of that for you.

David Blatner is the co-founder of the Creative Publishing Network, InDesign Magazine, and the author or co-author of 15 books, including Real World InDesign. His InDesign videos at LinkedIn Learning (Lynda.com) are among the most watched InDesign training in the world. You can find more about David at 63p.com.
  • Christopher Campbell says:

    Legend. I’ll give this a try now.

    Thanks for responding on the forum and thanks for writing a post.

  • Jon. Hersh says:

    Very Cool. And it works across multiple documents (that are open).
    Is there any way to eliminate the quote marks?

  • Shawn Girsberger says:

    So helpful — thanks!

  • Patrick Dawson says:

    If you have a long document (and that’s all I do), this is a much more reliable method than using paragraphs, especially if the text is constantly being edited and hence the paragraph name can get changed.In theory, they will also remain intact if the text is reused in another document.

    If you have a lot of cross refs, then I would strongly recommend setting up a keyboard short cut both for creating the anchor and then actually inserting them (I use ALT + W for the anchor and ALT + Q for the insert). I would also not worry unduly about naming conventions: the key is that they must be unique. The reason for this is that if you highlight a word and use the keyboard short cut, then the highlighted word would be used as the anchor. So in David examples just highlight “Penguin”: if you have hundred(s) of them it saves a hug amount of typing!

    It is also much quicker to go through your document putting the anchors in rather than doing them on an ad hoc basis. You can them methodically work through the document and insert the page numbers.

    My biggest frustration though is not being able to see what the anchors are called in the story editor or in the links panel: it really would make life a lot easier as you tend to end up with loads of duplicates if you aren’t careful. However, Peter Krahel has developed a great script (text-anchors.jsx) that identifies all dead links and lets you delete them. It’s a life saver.

    • Hi Patrick, Trying to make text anchors from a long list of notes; came across your note about creating shortcuts and can’t find how to do that (I make shortcuts all the time using Edit-Keyboard shortcuts but don’t find “create new text anchor” anywhere to apply a shortcut

      Any help appreciated!!

      • Hi Katherine

        I’m using CS6 so I guess they may be in different places if you are using a different version.
        IN CS6 though try
        Type Menu
        Insert Cross reference (this should give the cross ref insert) Insert
        Source marker (this should give you the “create text anchor”)

        Should do the trick!

        Best

        Patrick

  • Krystal says:

    This is a great post and timely too. I’ve been working on a book document involving cross references for endnotes and to tables and figures in the individual articles. I use the cross references for the endnotes and text anchors/hyperlinks to for references to figures and tables. I have encountered three things I can’t figure out:

    1. Is it possible to link text to an image anchor? I’m using the text in the figure/table captions as text anchors, and when one follows the hyperlink to the text, it jumps to the text below the figure.

    2. Is it possible to set the zoom/view settings for a hyperlink/text anchor combination? I know in cross references, you can set the view settings for a PDF (i.e., fit width, fit view, etc.), can you do the same with text anchors? Otherwise, when you’re reading through the text of a document in PDF and you click on “Figure 1” to go to the figure that lives on the next page, it zooms to fit the text anchor in view, and the user has to zoom out and up to see the figure.

    3. Is it possible to set the view settings of a text anchor to the top edge of the paper? This would be an alternative to the default view of zooming to fit the text anchor I mentioned in question #2.

    I hope this makes sense. If it helps to share the PDF, I am willing to do that also.

    Thanks!

    • First, I want to point out that I generally use paragraph styles for cross-references, not text anchors, especially for figure references (because text changes and I need the x-refs to update, too, without worrying about manually changing the text anchors). I discussed that process here:
      https://creativepro.com/figure-numbering-in-indesign-and-cross-references-to-them.php

      To Krystal’s questions:
      1. No, you would need to add a text anchor or some text above the image.
      2. Unfortunately, no, I don’t think there’s any access to that level of control; perhaps you could change it in Acrobat later, but that would be tedious of course.
      3. Nope.

  • Robin Erickson says:

    Can cross references be created within InCopy?

    • Yes, cross-refs can be created in InCopy. It has the cross-ref panel, and access to the same x-ref formats (including Text Anchor) as InDesign.

      The only proviso is that the InCopy user has to have checked out (gotten editing privileges) to both the source and destination stories. This is also true for any InDesign user working with a layout that’s part of an InCopy/InDesign workflow, that is, contains linked InCopy stories.

  • Sandee Cohen says:

    Great article David.

    I’m doing a hands-on lab at Adobe Max 2015 and will be covering x-refs. I’ll be sure to include this article as well as its links for further reference.

  • linda says:

    Hi, David:
    I found that using cross-reference slow down InDesign significantly. every time I made changes, it refreshed taking a few second/min., especially in book file, to the points of making me very frustrating and don’t want to use x-ref. anymore.
    any solution?
    Thanks

  • Rick Soldin says:

    When I create a new cross reference and select ‘Text Anchor‘ from the drop menu (Link To:) in the ‘New Cross-Reference‘ dialog box, all the listed anchors are shown as _idTOCAnchor-#. In the Bookmarks panel I see the TOC created bookmarks organized from pulling a TOC using that feature. There are also a bunch of names in the Bookmarks panel that have little anchors to the left side. These came over from the imported Word file.

    My question is, why don’t those anchors and the TOC bookmarks show up in the New Cross-Reference/Text Anchor drop menu? Is there a way to get the bookmarks to show in the drop menu for a text anchor?

  • David – I love your helpful articles. You are the first person I turn to! But my problem is one which is not really addressed anywhere that I can find: I follow your procedures for making cross-references to the letter but the actual page number will not appear in my large (400 page) document. The WORD “page” appears If I do the same thing in a completely fresh new document, the page number shows up. Does this mean my file is corrupt? And if so, what can I do about it? Thanks to anyone who can help me with this. Am really tearing my hair out. (I am using CS5 with Windows 10.)

    • Jenny: It’s hard to know what’s going on. Does it work with a normal cross-reference to a paragraph style, but not to a text anchor x-ref? Maybe change the setting in the Format popup menu in the x-refs dialog box? If the problem continues, maybe start a thread in the Forums here.

      • Thank you, David for coming back to me – I feel honoured! Yes, I am afraid it happens no matter what I do – text anchor, paragraph etc. BUT in a completely new document, I have no problem. The odd thing about it is that in Editor view I can see the little icons showing it is there; when I mouse over in the panel menu, it gives the correct page link, AND it works; and the word PAGE appears – followed by nothing. But the actual number is never there. Refresh page, re-open document. Nada…
        I did wonder if there was a figure which is so small or white that I can’t see it, but no; and then it occurred to me it might be as if this was seen as a webpage link rather than a hard-copy document. Again thank for you at least thinking about it with me!

      • Jenny, if it’s a cross-reference, then it may just be the Format popup menu. You can edit the format (which means “how the cross-reference appears on the page”). See this video: https://creativepro.com/watch_listen/creating-custom-cross-references-video

  • Many thanks David – I had not seen that video so will no doubt find the solution there. Most helpful.

    • Setchell says:

      Ugh. No go, am afraid. I have viewed so many videos now and followed everything to the letter – but still no page numbers. Formats all seem fine. I am now wondering if there is a problem because I have put an endnotes sections at the back using cross-references. And this is working just fine. Do you think this might cause the problem? The weird thing is that the name of the anchor – and the style make – come through just fine – but not the number of the page. Would it be something to do with the numbering? As far as I know I have done this using the standard method.

      • Jenny: I’m not sure. You might try exporting the whole document as IDML and then opening that IDML file to see if there is some document corruption that can be cleaned out. But other than that, it’s hard to see without seeing the file.

  • David, your articles are always a great help, so thanks!

    Now here’s something I can’t quite figure out. I created a ToC for a project, based on the main headings and secondary headings in my stylesheet. So far so good.

    Next I’d like to use those text anchors (which were auto-generated by the ToC) for cross-references throughout the document. But the text anchors in the Cross-Reference dropdown list have very ambiguous names (e.g. _idTOCAnchor-1, _idTOCAnchor-2, etc.)

    Is there a way to rename those text anchors? Or better yet, have InDesign use the actual headings themselves as identifiers, rather than the vague _idTOCAnchor-x naming convention?

  • Jacoub says:

    But how to make the link take you back from the location of the distination to the location of the hyper link in the pdf doc.? I got the hand showing but it does not take back.

    Jacoub

  • >