Table of Contents – GREP Styles

Learn / Forums / General InDesign Topics / Table of Contents – GREP Styles

Viewing 2 reply threads
  • Author
    Posts
    • #97044
      John Penney
      Participant

      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.

    • #97046
      Graham Park
      Member

      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 updated

      Make 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 \t

      This will apply your underline style to the tab only and not the en space either side of it

    • #97054
      John Penney
      Participant

      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.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.
>