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

Hoping GREP is the answer: Styling glyph and following paragraph

Participant ,
Jan 26, 2017 Jan 26, 2017

Copy link to clipboard

Copied

Hi all

Really hoping someone knows this.

I have 3 long from books to format.

The author use in-chapter breaks styled as a star /  asterix glyph (*).

The paragraph following that glyph needs to be an untabbed paragraph (for which I have a style setup).

I have limited experience of GREP / am still learning.

So: how do I find the star * glyph (which is a paragraph by itself) and then target the following paragraph only to apply the untabbed style to?

There over 600 instances of this, so any help appreciated!

M

Views

1.0K

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

Mentor , Jan 26, 2017 Jan 26, 2017

If Para with the asterisk should be removed:

Find: (\*\r)(.)

Change to: $2

If should be left:

Find: (?<=\*\r).

Change to: [leave blank]

In both cases in Change Format: field define your desired Para Style.

Votes

Translate

Translate
LEGEND ,
Jan 26, 2017 Jan 26, 2017

Copy link to clipboard

Copied

Hi,

If I understand well: you have an "*" and the para end and you want to style the para below?

Right?

What do you do with this "*" after styling?

[Could you make a screenshot of a page with invisible chars?]

(^/)

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
Mentor ,
Jan 26, 2017 Jan 26, 2017

Copy link to clipboard

Copied

If Para with the asterisk should be removed:

Find: (\*\r)(.)

Change to: $2

If should be left:

Find: (?<=\*\r).

Change to: [leave blank]

In both cases in Change Format: field define your desired Para 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
Enthusiast ,
Jan 26, 2017 Jan 26, 2017

Copy link to clipboard

Copied

winterm- Won't the second option also get rid of the first character? Change to should be: $0 to keep it.

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
Participant ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

Thx Winterm

Your second option - with a little tweak - worked a treat!

M

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 ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

The Patina wrote:

Thx Winterm

Your second option - with a little tweak - worked a treat!

M

What was the little tweak?

Regards,

Uwe

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
Participant ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

Hi Laubender

Sorry, for being slightly misleading: the 'little tweak' was just the insertion of the correct character in the search ( a star '✴' , not an asterix '*').

Just out of curiosity, can yourself or any other forumites suggest a good resource for GREP learning and knowledge? It looks like I have a lot of book interior formats ahead of me in the next year and getting my head completely around this would be wonderful!

VBW

M

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
Enthusiast ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

A great place to start is Peter Kahrel's "GREP in InDesign" from O'Reilly. There is also a FB group "Treasures of GREP." We are another friendly group over there!

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
Guest
Jan 28, 2017 Jan 28, 2017

Copy link to clipboard

Copied

thanks for the information

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
Participant ,
Jan 28, 2017 Jan 28, 2017

Copy link to clipboard

Copied

Hi Erica

Many thanks for the info and links.

Very much appreciated!

M

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
Enthusiast ,
Jan 29, 2017 Jan 29, 2017

Copy link to clipboard

Copied

LATEST

Sure thing! I have Peter Kahrel's book on my iPad and reference the glossary in it constantly! Also, the FB group has members from all over the world...I find I can get an answer no matter what time of day (or night it is).

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
Mentor ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

@The Patina

You're welcome

@Uwe

Uwe, thank You for GREP tutorial. You're frighteningly perfect, as always

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 ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

winterm wrote:

…Find:
(?<=\*\r).

Change to: [leave blank]

Change Format: field define your desired Para Style.

That really should do it.

The expression explained:

(?<=\*\r)
winterm is using a positive lookbehind: (?<=)

After the = in that expression you should insert what characters should be positioned before the thing you want to change.

In your case it is a * followed by a paragraph sign.

Since a * is a special character in GREP you have to tell GREP that you are literally looking for a * and not using the special character.

That is called "escaping" a character and is done like that: \*

The escape sequence for an end of paragraph character is: \r

So the expression:

Find something that is preceded by a star and an end of paragraph character is:

(?<=\*\r)

The something you'd like to find is the text after the star and the end of paragraph character.

Since you want to change the paragraph style of the text behind, it is sufficient to only find a single character in the paragraph.

And that is a simple dot . in GREP.

So the complete expression is:

(?<=\*\r).

And that will find the first character after every star followed by a paragraph sign.

Now for the change.

Leave it blank, because you do not want to change the found character but its formatting.

A screenshot from my old InDesign CS4 is showing a before and after scenario:

Bildschirmfoto 2017-01-27 um 10.15.37.png

"Absatzformat" is "Paragraph style" in German…

So I think, you can give winterm's anwer the "Correct Answer" here.

Here some help pages:

Find/Change

Find/Change text in InDesign

Metacharacters for searching:

Find/Change text in InDesign

Regards,
Uwe

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
Participant ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

Hi all

I should've attached a screenshot!

Here's the 'offending' example with 'show invisibles' switched on:

InDesign-CCScreenSnapz002.jpg

As described earlier: asterix is on one para. The next / following para is the one I need to target and apply an untabbed style to.

If there's a way of targeting both together that would be acceptable, as I could do a secondary search and reformat just the asterix.

But if there's a way of targeting just that second paragraph, that would be awesome.

Many thanks for the continuing help!

M

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 ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

Hi

Did you try Winterm 2nd suggestion? I believe it does what you want...

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
Participant ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

Hi Vinny38

Yes! You're right. Winterm's second suggestion does work brilliantly!

I had to tweak the search term as the asterix is a slightly different glyph but - boom! - yes!

Thanks to everyone for their input and help 🙂

M

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
New Here ,
Jan 27, 2017 Jan 27, 2017

Copy link to clipboard

Copied

I do follow your screen snap.

Where do I send it?

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