• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

GREP for underlining text in a Table of Contents

Community Beginner ,
Jul 02, 2024 Jul 02, 2024

Copy link to clipboard

Copied

How can I crate a GREP that will underline a part of an entry in a table of contents?

I know how to bold certain words using a GREP but cannot figure out how to underline certai words!!

Any ideas???

TOPICS
How to , Scripting

Views

497

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

Community Expert , Jul 02, 2024 Jul 02, 2024

It looks as if you are attempting to apply HTML-like formatting markup instead of applying an InDesign Character Style. That might work, in certain circumstances, but it's not the right approach.

 

  • Create an "underline" style that works when you apply it directly.
  • Create a GREP string that finds the word or string you want to underline.
  • Set the GREP style to apply the "underline" style.

 

Don't try to do anything else in the process. It should not be necessary.

 

And, since this is unclear: us

...

Votes

Translate

Translate
Community Expert ,
Jul 02, 2024 Jul 02, 2024

Copy link to clipboard

Copied

This is absolutely correct. Nevertheless, additional (unapplied) attributes can be added with a grep style.

Votes

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 ,
Jul 03, 2024 Jul 03, 2024

Copy link to clipboard

Copied

I figured it out!   I was trying to create a seperate GREP style when I should of been creating the GREP in the actual Paragraph Style that I was using...  i.e.: PARAGRAPH STYLE NAME:  Table of Contents...  GREP had to be added within this style, not as a whole separate Paragraph Style.  

Votes

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 Expert ,
Jul 03, 2024 Jul 03, 2024

Copy link to clipboard

Copied

quote

I figured it out!   I was trying to create a seperate GREP style when I should of been creating the GREP in the actual Paragraph Style that I was using...  i.e.: PARAGRAPH STYLE NAME:  Table of Contents...  GREP had to be added within this style, not as a whole separate Paragraph Style.  


By @pcfiles

 

Yes, that's how GREP Styles in Paragraph Styles work - next to Nested and Line Styles.

 

It's on the screenshots for Steps 2) and 4) in the link I and @pixxxelschubser provided:

 

RobertatIDTasker_0-1720021406650.png

 

We all were under the impression, that you are doing it this way?

That's why we were asking for screenshots - to see what, where and how you were doing. 

 

Votes

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 Expert ,
Jul 03, 2024 Jul 03, 2024

Copy link to clipboard

Copied

It was right there all along. 🙂

 

Very, very powerful feature that can automate many formatting needs; the only downside is that using very many GREP styles or one that applies to lots of text (such as all of the Body style, for example) can result in noticeable slowdowns or update lags, since it's a continuous process.


┋┊ InDesign to Kindle (& EPUB): A Professional Guide, v3.0 ┊ (Amazon) ┊┋

Votes

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 Expert ,
Jul 03, 2024 Jul 03, 2024

Copy link to clipboard

Copied

LATEST
quote

I figured it out!   I was trying to create a seperate GREP style when I should of been creating the GREP in the actual Paragraph Style that I was using...  i.e.: PARAGRAPH STYLE NAME:  Table of Contents...  GREP had to be added within this style, not as a whole separate Paragraph Style.  


By @pcfiles

 

Yes.
That's exactly what I suspected yesterday.
😉

 


quote

 

I don't think so.

It is more likely that he is not using the correct paragraph style in his table of contents …


By @pixxxelschubser

 

 

 

Votes

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