Skip navigation
Scorpio17523
Currently Being Moderated

GREP Styles, format the last line before a page break

Dec 3, 2013 3:44 AM

Hi all,

 

I'm trying to learn to use GREP Style in the Paragraph Styles sheets to help my company save some time when formatting.

 

A lot of us use linked text boxes to include information across 4 - 8 pages.

 

This information mainly contains headers, sometimes with a subheader and then a body of text.

 

A HEADER has one particular style (e.g. all caps and in bold)

A sub header = just in bold

Body text = normal font (regular)

 

I've developed some GREP expressions that formats this how it needs to be by identifying the patterns however I need some help in perfecting it.

 

If a header is the last line before a page break, GREP sees it as body text and doesn't format it.

 

If anyone could assist in this it would be much appreciated.

 

Below I will type a basic example of what needs to be formated.

 

 

 

HEADER (Bold all caps)

 

 

HEADER (Bold all caps)

Sub Header (Bold)

 

Body (Regular)

Body (Regular)

Body (Regular)

 

 

HEADER (Bold all caps) (PAGE BREAK)

 

NEW PAGE

 

HEADER (Bold all caps)

 

 

HEADER (Bold all caps)

Sub Header (Bold)

 

Body (Regular)

Body (Regular)

Body (Regular)

 

HEADER (Bold all caps) (END OF STORY)

 
Replies
  • Currently Being Moderated
    Dec 3, 2013 6:33 AM   in reply to Scorpio17523

    I'm not sure you can do what you want to do with GREP styles (because I think you intend to apply paragraph styles based on the formatting, but perhaps I'm not reading this correctly).

     

    GREP styles defined as part of a Paragraph Style can ONLY apply a defined character style to the matching text. They cannot change the text, nor apply a different paragraph style. To change paragraph styles you would need to use Find/Change.

     

    Are your page breaks "real" breaks, or are they automatic breaks? Real breaks would be those you enter deliberately, and ~P is the GREP term to find them. Automatic breaks are those ID makes when the frame is full and aren't really there at all. What expression are you using now to find HEADER text?

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 3, 2013 7:25 AM   in reply to Scorpio17523

    So your headers and sub-heads are divided by forced line breaks (\n) and are not separate paragraphs?

     

    Can you show us a screen shot of an actual page, with non-printing characters showing?

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 3, 2013 8:01 AM   in reply to Scorpio17523

    .+ should match everything from the beginning of the paragraph, including forced linebreaks. The order of your GREP styles is going to be very important.

     

    Frankly, I don't think this is a good way to do your work. Headings, subheadings, and body text ought, in my opinion, to each be separate paragraphs, and each have a pragraph style. Nor would I ever leave a heading at the bottom of a column or page, separated from the content to which it refers.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 3, 2013 10:12 AM   in reply to Scorpio17523

    While I agree with Peter Spier that the best way would be to have these as each their own paragraph, if you are stuck with them all in one paragraph, wouldn't Nested Styles be a better answer? In the "Dropcaps and Nested Styles" at the bottom is a section for nested line styles. First line is Header. Second line is Subheader. Hope that helps.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 3, 2013 12:01 PM   in reply to Scorpio17523

    Looks like a bug to me.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points