When I wrote my book in 2013 and did the layout in Adobe InDesign, I was able to put tab leaders in my table of contents and have spaces after the chapter title and before the number.

I remember this being relatively easy then, but I couldn’t reproduce it in laying out my current book. Looking at the files from the old book didn’t help me figure it out. I searched all over the internet and the method I found back in 2013 seems to have now disappeared. However, I have been learning to use grep in InDesign and I figured out a new way to do this using grep.

I began by putting tab leaders in my TOC by setting it up as in the picture below:

The character style “underline TOC” simply set underline to “on” and assigned a type:

This worked fine to put in tab leaders but the leaders touched right up against the chapter titles and the page numbers. I wanted spaces between them and nothing I tried seemed to work until I hit on the grep idea.

What I changed was I put an EM Space before and after the right aligned tab marker and I set the style to “none” and built my TOC.

This gave me a chapter title and right aligned page numbers with nothing visible in between. (you can use the Type ==> Show Hidden Characters command to see what is actually there.) That’s where I used grep to solve the problem. I have paragraph styles for each level of TOC entry. In each of the paragraph styles, I set up two grep commands:

The first grep command looks for the EM Spaces and sets them to a character style that has underline color set to none and underline set to its intermediate default setting. You have to turn on underline first, set the color to none, then reset underline to the intermediate setting:

The second grep command looks for the right aligned tab and sets its character style to the underline style used several steps above. This provides the same tab leaders as above but with the spaces you see in the first image above.

While this is a bit of a hack, it does the job very nicely. I spent several hours of my life looking for ways to resolve this simple detail in my TOC before coming to this solution. Hopefully, this example saves you some time getting the same effect.

 

I am using the most current version of Adobe CC InDesign as of November 2017. I believe it is called InDesign 2018 but Adobe doesn’t make that entirely clear: