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

Can I automatically italicise words after a comma?

New Here ,
Nov 01, 2023 Nov 01, 2023

Copy link to clipboard

Copied

Hello,

 

I have a document with thousands of names, and I need to be able to italicise names that come after a comma. For example:

 

John Smith, Scrooge 

Jane Smith, Mrs Crotchit

Bob Jones, Ghost Past

 

I don't want to have to highlight each individual name to italicise, so I was wondering if there's a way I can apply it to all words that come after a comma like above?

 

Thank you!

TOPICS
How to

Views

117

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 ,
Nov 01, 2023 Nov 01, 2023

Copy link to clipboard

Copied

A GREP find/change could do this, or if you want it to be ongoing, a GREP style for the relevant paragraph styles would do it on the fly.

 

I'm shaky with GREP codes, but I'd bet one of the elves will provide a code string shortly if you aren't up to it either. 🙂

 

A Word macro could do it as well, if you have the doc in Word format. Not elegant, but it works.


╟ Word & InDesign to Kindle & EPUB: a Guide to Pro Results (Amazon) ╢

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 ,
Nov 01, 2023 Nov 01, 2023

Copy link to clipboard

Copied

The Grep string that can be used is

(?<=,).*

This will search anything after a comma. Is this what is needed or we need to stop after some words after comma.

-Manan

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 ,
Nov 01, 2023 Nov 01, 2023

Copy link to clipboard

Copied

You can do it with GREP style or with nested Style. I would recommend to use the nested style, as GREP styles can slow down large documents. 
None style up to including comma, italic end to marker.

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 ,
Nov 02, 2023 Nov 02, 2023

Copy link to clipboard

Copied

LATEST

I tend to agree with Willi here, but I also want to add a warning that this can go bad if you have names with commas in them, as John Smith, Jr., Tiny Tim.

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