Skip to main content
Known Participant
June 7, 2020
Answered

Table of Contents tab before entry

  • June 7, 2020
  • 5 replies
  • 3834 views

In my table of contents, I need a tab before and after the "entry" so the sequence is: tab, entry, tab, page nbr. Anybody got a clue how I can do this other than manually? See attached example

This topic has been closed for replies.
Correct answer pixxxelschubser

I totally agree with @mompcomike.

 

The left indent couldn't never be the correct answer!

(Or maybe I misunderstood that answer - who knows.)

 

Yes, I also think that there is no automatic solution with the TOC function in InDesign. But with a few changes afterwards, the desired result is possible (and reproducible).

 

page7 - page30

 

In normal way created TOC

 

 

open Grep Find and Replace window

find: ^[^\t]+\t\d+

replace with: \t$0\t

find format: [your "TOC item format"]

 

Replace all.

Done. But now the "two lines entries" are not correct.

 

Search the middle space in these line and select.

 

Replace (only) this space with [tab][tab][shift+Enter][tab] 

 

Quick and easy result:

 

 

One disadvantage: After editing and re-creating the table of contents, the shown changes must be made again.

 

If that works for you

have fun

😉

5 replies

pixxxelschubser
Community Expert
June 15, 2020

Hi @mompcomike,

here a short description of the Grep.

 

 --> find format: [your "TOC item format"]

means:

Only search and find in this paragraph (or character) style.

 

 --> find: ^[^\t]+\t\d+

means:

^   = begin of paragraph

[^\t]   = all characters that are not tabs

+   = one or more times

\t   = one tab

\d   = one digit

+   = one or more times

 

 --> replace with: \t$0\t

means:

\t   = tab

$0   = all what you have found in the actually hit

\t   = tab

 

 

Hope that helps a little.

😉

pixxxelschubser
pixxxelschubserCorrect answer
Community Expert
June 14, 2020

I totally agree with @mompcomike.

 

The left indent couldn't never be the correct answer!

(Or maybe I misunderstood that answer - who knows.)

 

Yes, I also think that there is no automatic solution with the TOC function in InDesign. But with a few changes afterwards, the desired result is possible (and reproducible).

 

page7 - page30

 

In normal way created TOC

 

 

open Grep Find and Replace window

find: ^[^\t]+\t\d+

replace with: \t$0\t

find format: [your "TOC item format"]

 

Replace all.

Done. But now the "two lines entries" are not correct.

 

Search the middle space in these line and select.

 

Replace (only) this space with [tab][tab][shift+Enter][tab] 

 

Quick and easy result:

 

 

One disadvantage: After editing and re-creating the table of contents, the shown changes must be made again.

 

If that works for you

have fun

😉

Known Participant
June 15, 2020

I understand the concept (even through the language barrier). It is kind of like my solution, but I don't know the GRep symbols ^[^\t]+\t\d+. I'll try to figure it out though. Thanks. This is probably the best solution. 

Known Participant
June 14, 2020

One of us doesn't understand..:it could be me. The left indent doesn't apply here because the tab aligns the text to a right alignment tab followed by a left alignment tab as displayed in the attached example. 

Frans v.d. Geest
Community Expert
June 7, 2020

Use a left indent in the paragraph style used for the TOC entry

Known Participant
June 14, 2020

I have the style set up. Everytime I update the contents, I have to physically add the tab as the first character. I've got that process down to a replace-all end of paragraph mark with an end of paragraph mark tab. Just wanted to know if there is a parameter in the TOC that would automatically do this for me. 

Frans v.d. Geest
Community Expert
June 14, 2020

Again: define the style you want to use for the TOC (that is a seperate style than the one you set to be in the TOC, vlick on more options to define which seperate style to use for each TOC entry*) and set the left indent there. With a left indent no need to set a tab.

 

*Let say you have added the style Header to be in the TOC. You then create a new, seperate style, lets call it HeaderTOC, then in the create Table Of Contents options you set the style HeaderTOC to be used for Header. In the HeaderTOC style you set the left indent. No tab needed. Be sure to Save your settings in the Create Table of Contents dialog! If you do not save the setting does not get remembered next time you update the TOC!

 

 

 

Known Participant
June 7, 2020

By the way, I don't have a problem with the stuff after the entry. Just the tab before the entry. 

Community Expert
June 7, 2020

You can't add a tab before an entry via the TOC tools - you could put a request here https://indesign.uservoice.com/forums/601021-adobe-indesign-feature-requests

That's the best place to make your request.

 

Although, it is not needed, you can make Paragraph Style for your Table of Contents text, which I always do, a separate individual style for your TOC entries.

 

You can then set the left indent to your required tab stop. Even include a first line indent so if it flows over 2 lines it still lines up.