Copier le lien dans le Presse-papiers
Copié
Hello Everyone,
I'm trying to find a way to remove duplicate entries i my TOC using GREP,
if Enybody could help me plese finding a proper code for that?
My TOC looks like that:
thank's for help!
Basing on your sample:
Simplistically:
(^.+)(~y\d+)\r\K(\1(?2)$\r?)+
(^/) The Jedi
Copier le lien dans le Presse-papiers
Copié
Is it a mockup or a real thing?
TOC is supposed to show all entries.
Or your goal is Index - where each brand is mentioned / referenced?
Copier le lien dans le Presse-papiers
Copié
It's a test file on which I'm trying to find a solution.
So I think, I need a GREP code to delete the second and after "first brand" words with the page number, and the same with the "second brand" entries which TOC collects from the headers on every page.
Is there any solution to do it?
Copier le lien dans le Presse-papiers
Copié
Then just create new ParaStyle and use it once, at the beginning of the "chapter" - and use it just for TOC.
You can even put it on the pasteboard - but the TextFrame needs to touch the edge of the page.
Copier le lien dans le Presse-papiers
Copié
I've got the Paragraph Style for TOC, the problem is I dont't want to delete or use the title once, it suppose to be on every page, thats why im trying to find the solution to remove the double entries after the first in the index, the entry should be mentioned only once, the first page on which it's apears.
Copier le lien dans le Presse-papiers
Copié
As @John Mensinger said - you need two different ParaStyles - one for TOC entries - that you'll use ONCE per chapter, at the beginning, and then the second for your "normal" headers.
Kind of two level Heading - 1st level is at the beginning of the chapter - then 2nd level on every page.
Copier le lien dans le Presse-papiers
Copié
You're thinking in the wrong direction, and editing your TOC after the fact, using GREP or any other approach, defeats the purpose of automating the TOC in the first place.
The TOC function is picking up your main header paragraph style. If you apply that style to a second instance of the same header, and the TOC finds them both, it's just working as designed. The solution is to apply your styles differently to prevent the duplication. Make a copy of your main header paragraph style and give it a different name, like "duplicate header" then apply it to the header instance(s) you don't want included in the TOC.
Copier le lien dans le Presse-papiers
Copié
in order to do it quite quickly, im duplicating the pages (about 300 in fact), so the header is the same, on which i'd duplicated (my example - 8 times 'first brand' - means 8 pages with it, and 6 times 'second brand' - 6 pages). I dont't want to change the paragharh style selectively, because it will take much more time, working on a such multi-page document, to add it to the duplicated text fields. So I was thinking of deleting it using script.
Copier le lien dans le Presse-papiers
Copié
I dont't want to change the paragharh style selectively, because it will take much more time, working on a such multi-page document, to add it to the duplicated text fields.
Okay, so don't apply it to the duplicated headers, apply it to just the first instance, then change your TOC setup to target the first-instance style.
Again, the TOC function is automatic, and can be updated in a single click when needed. Creating a need to edit it by any means after the fact negates the feature. Doing it correctly up-front would only take a little more time; less than you're wasting looking for the wrong solution.
Copier le lien dans le Presse-papiers
Copié
Do you have a database for your catalog? Because you could at least use DataMerge.
But even if you do it "manually" - AFTER you create your catalog - you just need to go to the first page of each chapter - and add one extra TextFrame - with the contents of your TOC.
Or, as you've said - you are duplicating pages - then, when starting new chapter - duplicate first two pages from the previous chapter, then duplicate only 2nd page for next pages - 1st page of the chapter will always remain the same.
You could even use dedicated Master Page / Spread for this to speed up your work.
With 300 pages you won't be creating it from scratch every day so it's not much of extra work...
Copier le lien dans le Presse-papiers
Copié
Basing on your sample:
Simplistically:
(^.+)(~y\d+)\r\K(\1(?2)$\r?)+
(^/) The Jedi
Copier le lien dans le Presse-papiers
Copié
Thanks Robert! that's what I was looking for! works fine! DZIEKI!
Copier le lien dans le Presse-papiers
Copié
Thanks FRIdNGE! that's what I was looking for! works fine!
Trouvez plus d’idées, d’événements et de ressources dans la nouvelle communauté Adobe
Explorer maintenant