How to nest page numbers in TOC?

Community Beginner ,
Aug 29, 2021 Aug 29, 2021

Copy link to clipboard

Copied

Using InDesign CC 2021 I'm creating a TOC for a photo album. Working well except when more than one entry occurs for a name or place etc, the TOC lists them individually, and not by clustering them together as I expected. For example, I have the place Weggis about 6 times, and it gets listed on a separate line each time with the page number for that one entry. But I want to have "Weggis........5,36,41,72,99, " etc. Simply can't find the answer so wonder if there is anyone out there who knows the answer? Grateful thanks if you can help!

TOPICS
How to

Views

49

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Aug 29, 2021 Aug 29, 2021
I used to do an association directory with an included "index to advertisers" which was really a TOC. I had to consolodate lisings as you describe, and I used the following GREP query, which I think was actually written by Peter Kahrel: Find ^(.+ )([\d, ]+)\r\1([\d, ]+)$ Change: $1$2, $3 You might need to run it multiple times.

Likes

Translate

Translate
Adobe Community Professional ,
Aug 29, 2021 Aug 29, 2021

Copy link to clipboard

Copied

This is the kind of listing that is usually associated with an Index. You might have a look at that feature and see if it would suit your purposes for the TOC. Otherwise, you could use a brute force and have a find/change sequence that would probably clean it up for you.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 29, 2021 Aug 29, 2021

Copy link to clipboard

Copied

Thanks Diane - I will have a go with the Grep query suggested below. I just thought there might be something fairly straightforward that I was missing.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 29, 2021 Aug 29, 2021

Copy link to clipboard

Copied

I used to do an association directory with an included "index to advertisers" which was really a TOC. I had to consolodate lisings as you describe, and I used the following GREP query, which I think was actually written by Peter Kahrel:

Find

^(.+ )([\d, ]+)\r\1([\d, ]+)$

Change: $1$2, $3

 

You might need to run it multiple times.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 29, 2021 Aug 29, 2021

Copy link to clipboard

Copied

Thanks Peter - I'll try that. Much obliged.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 30, 2021 Aug 30, 2021

Copy link to clipboard

Copied

LATEST

You're welcome. Let us know if it works for you.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines