Table of Contents – GREP Styles
Learn / Forums / General InDesign Topics / Table of Contents – GREP Styles
Tagged: grep style, leader fill, tab, table of contents, underline
- This topic has 2 replies, 2 voices, and was last updated 6 years, 7 months ago by John Penney.
-
AuthorPosts
-
-
August 23, 2017 at 2:03 pm #97044John PenneyParticipant
I have always felt that applying a leader fill to tab stops results in a coarse look, especially in a table of contents. So instead of using the leader fill, I usually create a character style with a dotted stroke underline, which I then apply to my right indent tabs. This method gives me greater control over the stroke weight (dots), resulting in a more refined appearance.
Besides applying the dotted stroke underline to the tab, I insert a quarter space without an underline before and after the tab so that the stroke doesn’t butt up against the T of C entries and page number. I can easily set this up in my T of C style, but this creates a problem: the dotted stroke underline character style is automatically applied to both the tab and the quarter spaces—something I don’t want.
Currently I’m trying to learn GREP, but my knowledge is limited to the information available on Lynda.com (early in the course), contributing authors to this website, and expressions that I found on the Internet and have modified for my own needs. Is there a GREP style I can create and incorporate in my T of C paragraph style that will apply the underline character style to the tab—but not to the quarter spaces?
Any help you can provide is greatly appreciated.
-
August 23, 2017 at 9:12 pm #97046Graham ParkMember
In the TABLE OF CONTENTS dialogue box in the BETWEEN YOUR ENTRY AND NUMBER box add the EN SPACE before and after the TAB
This will automatically add the space you want when the TOC os generated or updatedMake the character style with the underline style as you want it name this eg TOC Underline
Then in the TOC Paragraph Style add a GREP Style
APPLY STYLE TOC Underline
TO TEXT \tThis will apply your underline style to the tab only and not the en space either side of it
-
August 24, 2017 at 11:38 am #97054John PenneyParticipant
Thank you Graham, This is perfect!
The only change I made to your instructions were in the “TO TEXT” field: I used ~y for the Right Indent Tab. Otherwise, It is exactly what I needed. Before posting my question to the forum, my approach was the opposite of yours and wasn’t working. Instead of using GREP to apply the underline, I was trying to use GREP to remove the underline from the spaces before and after the tab. Your solution is simple, easy, and accomplishes what I needed
Thank you.
-
-
AuthorPosts
- You must be logged in to reply to this topic.