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:
'(?<=\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
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.
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.
Copy link to clipboard
Copied
If those lines are short - how about a table with alternate rows filling?
Copy link to clipboard
Copied
… Supposing a para with 5 lines separated by a soft-return:
(^.+\n)(?=(?1){3}.+$)
(^/) The Jedi
Copy link to clipboard
Copied
… or:
(?<!\n)^.+
(^/)
Copy link to clipboard
Copied
… or use a nested line style applying the bold char style on the first line!
(^/)
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.
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.
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.
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?
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.
Copy link to clipboard
Copied
If it is in one paragraph use line styles.