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

NEED GREP FOR BYLINE

Explorer ,
Mar 12, 2022 Mar 12, 2022

This seems like a fairly common application, but I’ve not found a solution. Hoping the community can provide an answer for me.

 

Doing a book, and each chapter starts with quotes by notable people. I have a paragraph style for the quote, and a character style for the byline, but need a GREP to apply the character style to the em dash and the name.

 

Like this:

“notable individual quote.” —BYLINE

TOPICS
How to , Type
1.2K
Translate
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

Contributor , Mar 12, 2022 Mar 12, 2022

In the GREP tab:

 

Find what:
\x{2014}.+$

 

This finds the em dash (which is U+2014), followed by anything (.) as many times as possible (+) up to the end of the paragraph ($).

 

In Find Format, click on the top right corner ("T" with magnifying glass, Specify attributes to find), and choose the paragraph style for the quote.

 

Leave the Change to field empty.

 

In Change Format, choose the character style for the byline.

Translate
Community Expert ,
Mar 12, 2022 Mar 12, 2022

Not to diss the wonders of technology and automation, but it seems like you could format 50 such headings in a few minutes — or about as long as it took to write your post. I am always a bit puzzled at designers who want to automate or script simple, one-time tasks. 🙂

 

Translate
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
Explorer ,
Mar 12, 2022 Mar 12, 2022

What's odd is you don't know how many I need to format like this and what other numerous, similar items need special formatting where a GREP will save me hours ... now do you?

Please save your comments when you have something helpful. Take your puzzle elsewhere.

Translate
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 ,
Mar 12, 2022 Mar 12, 2022

Hey, I started off pasting bits on blueline board. I have great appreciation for time-saving and efficiency methods. 🙂

 

Translate
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
Contributor ,
Mar 12, 2022 Mar 12, 2022

In the GREP tab:

 

Find what:
\x{2014}.+$

 

This finds the em dash (which is U+2014), followed by anything (.) as many times as possible (+) up to the end of the paragraph ($).

 

In Find Format, click on the top right corner ("T" with magnifying glass, Specify attributes to find), and choose the paragraph style for the quote.

 

Leave the Change to field empty.

 

In Change Format, choose the character style for the byline.

Translate
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
Explorer ,
Mar 12, 2022 Mar 12, 2022

Samuel, this worked perfectly!!

Thank you for the valuable help without any arrogant smuggery. (RE: NitroPress)

Translate
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
Contributor ,
Mar 12, 2022 Mar 12, 2022

Glad I could help! The trick is to leave the Change to field empty, so the style you specify in the Change Format will be applied to the found string (from Find what).

Translate
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 ,
Mar 12, 2022 Mar 12, 2022

Why don't use simply nested styles?

Capture d’écran 2022-03-12 à 20.05.13.jpg

Translate
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 ,
Mar 12, 2022 Mar 12, 2022

@jmlevy @Jim's solution is the most efficient and elegant. 

David Creamer: Community Expert (ACI and ACE 1995-2023)
Translate
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
Explorer ,
Mar 12, 2022 Mar 12, 2022

perhaps, unfortunately, i only understand English. 

Translate
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 ,
Mar 13, 2022 Mar 13, 2022
LATEST

In the nested styles section, set the following:

  1. None up to [Em Dash] (type over the text that is there and actually type an Em Dash)
  2. [Your Char. Style] to Nested Style End Characters (this will go to end of paragraph is no such character is entered)
David Creamer: Community Expert (ACI and ACE 1995-2023)
Translate
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