Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

TOC Not Playing Nicely with Anchored Objects

Return to Member Forum

  • Author
    Posts
    • #93644
      Tyler Coffin
      Member

      I’m trying to generate a table of contents for a book of legal codes. We’ve done this work by hand in the past, but this year I’m trying to reformat a few things so that we can use Indesign’s TOC function.

      The entries in the TOC look something like this:

      CHAPTER 1
      Article 2
      1005 [Description of code]…..5
      1010 [Description of code]…..7
      1015 [Description of code]….10

      Each “Description of code” is unique text that does not appear anywhere else in the printed document. Obviously this complicates the TOC. I thought I could get around the problem by anchoring non-printing objects with the section number and text where the code numbers appear in the book. And while I’ve been able to get everything to appear in the TOC, the order isn’t right. The order of the first two levels (“CHAPTER” and “Article”) are perfect, but the third level sections appear in the wrong place and I can’t figure out why.

      If my method is fundamentally flawed, is there another way to achieve the same result? Thanks for any advice you can offer!

    • #93645
      Tyler Coffin
      Member

      A quick addendum: the TOC appears to always pull the “CHAPTER” and “Article” levels on a page before it will pull the anchored text frames. This means that the numbered codes will occasionally appear after the Chapter or Article in the TOC even though they occur before them in the document.

    • #93668
      Peter Kahrel
      Participant

      An alternative to your approach is the following. Create a character style that hides the text to which it is applied: type size 0.1 points, horizontal scale 1%, fill colour Paper. Add the text that should appear in the toc at the headings in the text and apply the character style. Add a separator character so you know in the generated toc where the real toc entry starts. Generate the toc. Fix the toc, e.g. by changing the character style (if it’s in a separate document) or removing it, or replace it with a different character style — whatever is appropriate in your set-up.

      By the way, is it because of the anchors that the entries appear in the wrong order? That’s something you should find out first.

      P.

    • #93699
      Tyler Coffin
      Member

      Thanks Peter – I’m going to give this a shot.

      I’m pretty sure that the interaction between the TOC algorithm and the anchors IS the problem. All other parts of the TOC come out perfectly. The anchors are carefully placed exactly where the appropriate heading appears in the text. But I suspect that the logic pulls information out of the main text frame before it looks in the separate, anchored frames.

      Within each level of the TOC, everything appears in the correct order. It’s just that the third level entries (the ones in the hidden text frames) occasionally sort under the wrong parent levels.

    • #93739
      Kelly Vaughn
      Participant

      Hi Tyler,

      I wrote about this topic a few years ago. https://creativepro.com/how-to-incorporate-chapter-thumbnail-images-into-an-auto-generating-table-of-contents.php.

      I would be happy to take a look at your file for you and see if I can troubleshoot it.

    • #93742
      Tyler Coffin
      Member

      Thanks Kelly.

      You point out in your post that InDesign won’t grab “custom” positioned anchored objects – I wonder if that was part of my problem. Unfortunately, my headings have a rule applied above and below, so giving the anchored text box an inline position made the rules stick out past the heading. Also, I wonder if the fact that I’m using the text in the anchored object as the third level of the TOC complicates the process.

      At this point, I’m well down the road using Peter’s advice (only a few dozen lines to add and hide). It feels a little klugdy, but it also works very well, and I haven’t seen an elegant solution.

      I still have the version of my file with the anchored, non-printing text boxes if you are willing to take a look. How would I share that file with you? I’d really love to learn something new. :)

    • #93745
      Kelly Vaughn
      Participant

      Send me a DM on twitter and I’ll give you me email address. https://twitter.com/documentgeek

    • #93746
      Tyler Coffin
      Member

      Thanks! I followed you, but I can’t DM you unless you follow back: https://twitter.com/tyler_coffin

    • #93756
      Kelly Vaughn
      Participant

      Hi Tyler, I took a look at your file and Peter’s solution works really well. You did a great job with the formatting, as well. Nice work on a fairly complex TOC.

    • #93770
      Tyler Coffin
      Member

      Thanks Kelly. I really appreciate your taking the time to give it a look. I’ll proceed confidently with Peter’s method.

      P.S. This forum is the best. :)

Viewing 9 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads