Skip to main content
James Gifford—NitroPress
Brainiac
April 16, 2022
Answered

Identifying/Mapping TOC text anchors

  • April 16, 2022
  • 2 replies
  • 3173 views

Is there any straightforward way to identify the automatically generated text anchor for any TOC entry? I generate a TOC that works fine for both the print edition and the EPUB/Kindle side TOC. It creates 120-odd text anchors of the name style '_idTOCAnchor-34'.

 

In theory, I can do internal references using these anchors... but in practice, the order and numbering seem to be almost random. ...Anchor-1, for example, goes to the last section heading in the document, and I haven't been able to make any sense out of the numeric order.

 

So if I want to link to a section titled "End Material" on page 195, without going and setting a specific text anchor of known name, how do I identify that heading's TOC anchor number? (It seems with all the various menus and palettes and such, this should be much easier... but I'm stumped.)

 

This topic has been closed for replies.
Correct answer Peter Kahrel

The order is probably not random. The anchors must be added from back to front, and they are numbered ascending, so they appear to be in reverse order.

You can use this script to map anchors:

https://creativepro.com/files/kahrel/indesign/text_anchors.html

P.

2 replies

Community Expert
March 6, 2023

 a way to modify the script so that it can automatically rename the anchors based on the text of the paragraph they are anchored to

 

A separate script would make more sense.

 

that portion of the script doesnt seem to prompt

 

Not sure I understand what you mean here. What kind of prompt were you thinking of?

Inspiring
March 7, 2023

Sorry, i think i misread his post and thought a second dialog would pop up after selecting which TOC style you want.

Peter KahrelCorrect answer
Community Expert
April 16, 2022

The order is probably not random. The anchors must be added from back to front, and they are numbered ascending, so they appear to be in reverse order.

You can use this script to map anchors:

https://creativepro.com/files/kahrel/indesign/text_anchors.html

P.

James Gifford—NitroPress
Brainiac
April 16, 2022

Excellent — thank you!