This content has been marked as final. Show 9 replies
Spaces at the beginning of paragraphs didn't come out correctly in the forum post. I hope that what I'm describing is understandable. In order to clarify, below I've inserted zeros to force the numbers to right align. Of course the zeros should not be in the final TOC.
001 Chapter 1: Making widgets
023 Second entry
300 Third entry
350 Chapter 2: Selling widgets
I found my previous post, with a similar situation, that Peter Spier helped me with. Peter's GREP query works in this case too, even though the TOC is formatted a bit differently. So, my problem is solved. Again, many thanks to Peter!
Can't you just do an F&R to change every ^p to a ^p^t to get a tab
before the number? If the first tab is specified as right-aligned,
this should achieve what you want. It does for me, anyway.
No, Noel, you can't. Replacing ^p with ^p changes the styles of paragraphs in a non-intuitive way that I have long thought of as a bug, but it does have a relentless logic to it.
Really, the lack of ability to put a tab to the left of a page number in the TOC is an InDesign limitation which Adobe should fix. I just installed CS4, and the TOC dialog hasn't changed/improved a bit. FrameMaker is so much more robust when it comes to autonumbers, books, TOC, and Index, but it's not an option for me to use it.
Dave, sorry, I'm not with you. My TOC para style has a right-aligned
tab at 5mm and a left-aligned one at 8mm. When I've generated the
TOC, I just replace ^p with ^p^t and everything lines up just as Jay
was describing. No '+' in the Styles panel. I know this is the
Scripting group, but this seemed to beg for a UI solution - unless
you've got a lot of TOCs to do, or some other reason for doing it
via script. Jay didn't mention his version, so I forgot to, too -
Because of InDesign limitations, I'm having to do another kluge. In front of each chapter in the TOC, an autonumber with the word Chapter, the chapter number, colon and space needs to appear in the TOC -- but this autonumber shouldn't appear in the individual chapters. I can't put the autonumber into the TOC paragraph style because if I do, the page number appears after the paragraph autonumber. So in the individual chapters, I'm making the autonumber white to not show.
When InDesign deletes a paragraph marker, the paragraph style of the next paragraph becomes the same as the first. When it puts it back in, the paragraph style of the second paragraph is not restored. So, if you have two paragraphs in a row that match your search with the second paragraph having a different style from the first, then after the Find/Change, both paragraphs will have the same style.
You're much better off using a grep search because then you don't have to replace the paragraph marker.
Dave, sorry to be so short-sighted. I just thought 'It works for
me - why not for him' and jumped in. Thanks for taking the time to
explain the difficulty.