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

GREP style every 5 line bold

Community Beginner ,
Jun 30, 2023 Jun 30, 2023

Copy link to clipboard

Copied

Hello!

 

I'm trying to make a GREP style to make every 5 line bold, I tried several ways but it is not working.
I have a paragraph style with a GREP, I tried two ways:

  1.  

 

 '(?<=\n.*\n.*\n.*\n.*\n).*$' 

 

2. 

 

(^.*\n){4}^.*

 

 

Both of them are not working, can somebody help me? 🙂

Full disclosure, I'm trying to achieve this:

Example

Text

For

This

Forum

Example

Text

For

This

Forum

Example

Text

For

This

Forum

Example

Text

For

This

Forum

TOPICS
Experiment , How to , Scripting

Views

419

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 , Jun 30, 2023 Jun 30, 2023

Sorry, yes, the first line bold, then four with none. Forgot it was bold on the first line, not the fifth.

This is still cleaner using using rotating paragraph styles, though. Perhaps only two, one for the bold paragraph and one for the remainder if all one one paragraph. Forced line breaks are usually a bad way to break text.

Votes

Translate

Translate
Community Expert ,
Jun 30, 2023 Jun 30, 2023

Copy link to clipboard

Copied

A better way to do this is to make each line a paragraph and sety up a set of rotatiung paragraph styles.

First paragraph style has second paragraph style set as Next Style, seconha has third as Next Style up to fifth paragraph style which uses first paragraph style as Next 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 ,
Jun 30, 2023 Jun 30, 2023

Copy link to clipboard

Copied

If those lines are short - how about a table with alternate rows filling? 

 

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
Guide ,
Jun 30, 2023 Jun 30, 2023

Copy link to clipboard

Copied

… Supposing a para with 5 lines separated by a soft-return:

 

(^.+\n)(?=(?1){3}.+$)

 

(^/)  The Jedi

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
Guide ,
Jun 30, 2023 Jun 30, 2023

Copy link to clipboard

Copied

… or:

 

(?<!\n)^.+

 

(^/)

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
Guide ,
Jun 30, 2023 Jun 30, 2023

Copy link to clipboard

Copied

… or use a nested line style applying the bold char style on the first line!

 

(^/)

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 ,
Jun 30, 2023 Jun 30, 2023

Copy link to clipboard

Copied

If the lines are really separated by forced line breaks (soft returns) you don't really need GREP at all. Ordinary nested styles should work.

None through 4 Forced Line Break

Bold through 1 Forced Line Break

Repeat as required if the paragraphs have more than five lines.

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 ,
Jun 30, 2023 Jun 30, 2023

Copy link to clipboard

Copied

Sorry, yes, the first line bold, then four with none. Forgot it was bold on the first line, not the fifth.

This is still cleaner using using rotating paragraph styles, though. Perhaps only two, one for the bold paragraph and one for the remainder if all one one paragraph. Forced line breaks are usually a bad way to break text.

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 ,
Jun 30, 2023 Jun 30, 2023

Copy link to clipboard

Copied

InDesign also has Line Styles which would work here, and would potetially allow for edits that change the lenght of the first line (or width of the column).  Same dialog as Nested Styles.

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 ,
Jun 30, 2023 Jun 30, 2023

Copy link to clipboard

Copied

I think I managed to fix it, thanks for your answer.

I still have to Apply Paragraph Style & Next to al my text frames, is there a way to do that automatticly?

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 ,
Jun 30, 2023 Jun 30, 2023

Copy link to clipboard

Copied

Select the text (for threaded text just do a select all), then right-click the name of the first style to use in the Paragraph Styles panel and select Use [stylename] and next style.

If any of this makes you nervouse, make a copy of the file.

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 ,
Jun 30, 2023 Jun 30, 2023

Copy link to clipboard

Copied

LATEST

If it is in one paragraph use line styles.

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