Jump to content

Anchor generation doesn't work properly for multiple TOCs


MikeTO

Recommended Posts

It's difficult to generate anchors successfully for a book that uses chapter-level TOCs with different heading levels than the main TOC. For example, a book with a main TOC might include Heading 1, 2, and 3 while its chapters might have TOCs that include Heading 2, 3, and 4.

When you generate the main TOC, you'll get properly nested anchors for Heading 1, 2, and 3. You'll also get Heading 4 anchors because Publisher doesn't let you specify the heading levels to use before generation like ID does.

After you've deleted the Heading 4 anchors, you would generate the chapter TOCs and deselect Heading 1. Unfortunately, this will move the Heading 2 anchors out from under Heading 1 which will break the PDF bookmark hierarchy. And new Heading 4 anchors will be created but they won't be children of Heading 3.

If you refresh the main TOC the Heading 2 ones will become children of Heading 1 again but the Heading 4 anchors will still be strays. If you disable Export as PDF Bookmark for the Heading 4 anchors they'll just re-enable when you update the chapter-level TOCs.

I've attached a screen recording and test document to demonstrate the issue. The problem is that the user would want the main TOC to drive the PDF bookmarks, excluding Heading 4, but also want Heading 4 in the chapter-level TOCs to be linked to the right page.

One solution might be:

  • Introduce a concept of a main TOC and set "Export as PDF bookmark" only for its headings. I'd just use the first TOC as the main because it's most likely to be the main.
  • Headings unique to chapter-level TOCs would still generate anchors but would have "Export as PDF bookmark" disabled for headings not in the main TOC to not interfere with the PDF bookmarks
  • Change the Update All TOCs feature to update the main TOC after any subsequent TOCs - this would presumably fix Preflight, too

For anybody encountering the issue, here's a workaround but you can't include Heading 4 in your chapter-level TOCs (or any heading level that isn't in the main TOC) because there's not workaround for that. For the example I've given above, edit the Heading 3 text style and change Next Level to Same Style. It's okay to base Heading 4 on Heading 3 but you don't want Heading 3 to be connected to Heading 4. Remove Heading 4 from the chapter-level TOCs. After you have your TOCs set up, each time you want to update your TOCs, update all TOCs (through the TOC panel or Preflight > Fix) first and then update the main TOC independently.

TOC test 211.afpub

 

 

Link to comment
Share on other sites

  • 5 months later...

@Dan C FYI another issue was reported today and I don't think my bug report above captured this basic part of the issue as well as I could have.

test2.afpub

  1. Open this document and check the Anchors panel - looks good
  2. Using the TOC panel, deselect Include as PDF Bookmarks and update the TOC
  3. In the Anchors panel - Heading 2 is no longer a child of Heading 1 (as I mentioned in my original post and which is probably okay since they're not being exported but it's still a bit confusing and I don't know why it's necessary). But Heading 1 and 2 still have the PDF export setting selected.
  4. Add a new heading an update the TOC - the new heading won't have an associated anchor (but the TOC will still hyperlink to the correct page so it's unneeded).

I think turning off Include as PDF Bookmarks should turn off the Export as PDF Bookmark setting for existing TOC anchors. This isn't a big deal for a single TOC because you can just disable bookmarks when exporting, but is a big deal for secondary TOCs.

 

Link to comment
Share on other sites

Thank you for the further steps and information provided here Mike!

I can certainly see the issue and I too would expect the existing Anchors to be affected by this option and not only newly created Anchors after deselecting the option, therefore I've updated this log with our development team and 'bumped' it with them once again.

I hope this helps :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.