I am creating a TOC on a document I am working on.
I have set everything up correctly – style sheets for the page headings which links to the table of contents and it all works fine.
On every page in the document the page heading is repeated, and obviously this gives me multiple entries in the TOC which I don't want.
About us 2
About us 3
About us 4
About us 5
Our experience 6
I would prefer:
About us 2
Our experience 6
The only solution I can think of is to create a new paragraph style for all the page headings I don't want to appear in the TOC, so first instance Style A, every instance after that Style B. The only problem with that is this seems a real work around rather than a solution. The problem is this is a manual solution, so if the pages move around, then the TOC becomes incorrect also if the style sheets are applied incorrectly, this also creates a problem.
Does anyone know a way to make the first instance of a page heading appear automatically in the TOC without a manual workaround?
Many thanks in advance.
I would recommend placing the repeating heading on the Master Page using a running-header variable.
Thanks Vinny. That sounds interesting, how would I do that exactly?
I've never come across running headers before.
vinny38, Playing around with this....I'm not getting the variable to appear in the TOC unless I Cmd Sh click on the first one to copy it to body page. Was that what you intended?
The only solution I can think of is to create a new paragraph style for all the page headings I don't want to appear in the TOC, so first instance Style A, every instance after that Style B.,
neilp58610967, I like the variable idea (though you can see from my question to Vinny that I'm not quite clear on the workflow), but I do want to say that many people do just use 2 paragraph tags: TitleTOC and TitleNoTOC for example. The TOC will still be accurate when text reflows, but it is an extra step, and you do need to proof the style assignment after edits, so I understand why you asking.
Thanks for the help everyone. I shall have a look into it. Variable text and running headers is something I need to learn about.
And depending on Vinny's response, how to override a master page item!
vinny38 , Playing around with this....I'm not getting the variable to appear in the TOC unless I Cmd Sh click on the first one to copy it to body page. Was that what you intended?
Not really...overriding master text elements is usually not a good idea. You should avoid it.
In short: we don't want the repeating headers to appear in the TOC.
So we just set them as Master elements.
Because we don't want a Master page per Heading, we set up a running-header variable.
Without knowing how OP's document is made, it's hard to advice on the best workflow. (I love screenshots so much, they should be mandatory)
See below a rather simple example based on 2 Master Pages with primary text frames:
Thanks for this, I shall give it a go.
@Vinny38: If I'm "reading" your animation correctly, we are all just using slight variation on a theme.
I don't see the practical difference of using a separate master page, typing in the title, and applying a unique style used int the TOC vs overriding the text object on just the first page and apply a unique style. Both techniques can use variables for the header.
There is nothing wrong with overriding master page items IF it is done with purpose.
@Barb: You are correct--headers will not show up in the TOC unless overridden.
See below a rather simple example
Did I have to watch your video multiple times—and walk away to think it through—before I figured out exactly how you set it up? Yes.
Dave, I see your point but I think Vinny's approach—while more complicated to set up—will be easier to handle when the client rearranges the content. I like it, Vinny.
Neil, let us know how you finally solved your dilemma, and if you have any questions about any of these posts.
OK, maybe not so simple^^ Maybe I should not have shown this Gif that could be confusing.
It's was just an example of what you could do and how it could be set up, but definitely not what the OP should/must do.
Again, without seeing the layout, it's impossible to give the best possible advice.
@IDEAS (Dave, is it?)
About overriding master elements: let's say it's some sort of Good practice that I personally try to stick to. So I recommend the use of this good practice, but it's just a personal opinion. You can override Master elements, but you must know exactly what you are doing because it really can mess up your layout.
See this simple (yes Barb, this one is simple!) example: on page 2, I override a text element and I delete another one. Then I insert a new page before. See what happens on page 3: deleted elements are back again... not good!
Now, about the OP's specific question, we could just put a running-header variable in the Master page and override it on the page that starts the section, replacing the variable marker by plain text. (By the way, no need for two paragraph styles, one is enough).
In case pages are added/deleted and the page with the overridden header moves, the Master will be reapplied (just like in the example above) and we'll end up with two similar text frames overlapping.
Since they overlap perfectly, we visually don't see any difference, but I am quite reluctant to end up with such a possible trouble-making situation. Filling the frame with [paper] would give me some reassurance.
In addition, I should note that any transparency effect involved in the process will mess up the whole thing.
how about using a table with one header row where we set the text?
All body rows could be without fills and strokes. The text frames for the table will show exactly one header row and one (invisible) body row.
We could thread such a table from page to page of a chapter.
TOC will pick up only the one original—fully editable header—on the first page of a chapter.
Using a table row with e.g. one table cell would allow for more than one line of text.
Altought I understand only first header row text would be picked up by TOC, I'm really not sure I understand how you would set this up...
Maybe a few screenshots, a gif or a video could enlighten me?
it's a bit work to set this up, but see the screenshots:
And download an IDML with a TOC and the tables for two chapters from my Dropbox account:
I'm really not sure about this method...
It really involves at lot of manipulation. It is very inconvenient to break threaded frames to start a new "section". Moving, adding, deleting pages are going to end up with a real mess. Auto-reflow should not be allowed. etc...
I would rather consider a more automated way.
That said, I admit you've got a point that if header isn't single-line, variable running-header will not be an acceptable solution.
I have the feeling that we kind of overthinking this. It's a rather basic question, I personally do a lot of documents with the same needs than the OP and working with running-header variables has always been a safe and good-working method for me ^^
One way that I've used in a real-world example was to tackle the completed TOC along the lines of Michel's (Obi-Wan's) GREP-based solution. I've written more about this in an old piece here: Making Picture Indexes with Captions | Colecandoo! To see the solution in the article, scroll down to the heading: Part 2: Consolidating duplicates once Table of Contents is run.
Regardless of how the pages are set up, all that is needed is two styles:
HeaderNoTOC (This can be on the master page, or simply typed in anywhere one wants)
HeaderForTOC (Identical based on style)
Note: names are just for illustration purposes.
Simply apply the HeaderNoTOC to all pages by default.
On the first page, apply HeaderForTOC to the very first page/instance.
As much as I enjoy offering layout solutions to others, selfishly, my favorite days on the forum are the ones where I learn new ways to combine features that I use all the time. Puzzling my way through the gif was part of the fun, Vinny.
I would use these two options.
For either option, create a style for the repeating header ("About Us").
Do NOT include this style in the TOC settings.
1: Override master page text object on the first page and apply and identical, based-on style that IS included in the TOC settings.
2: Create a small text object at the top of the first page of each section, enter your TOC heading, and apply a style that IS included in the TOC. Set the attributes to non-printing the the Attributes panel. Leave the master page header (not included in the TOC) alone. (Put the text box in a library to use it on other sections.)
Option 2 is a great technique to add text to the TOC that is not on the actual page, such as content descriptions.
We talk about "TOC"!
A simple regex could be enough! … just one click! …
I had the same issue. Turns out I had multiple copies of the subheading saved under the top/final designed version. They were invisible for some reason during an earlier phase of the design process. I simple deleted to invisible versions and refreshed the TOC. Solved for me.
did you try the GREP solution Obi-wan offered?
( ACP )