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

Set italic style for Latin names

New Here ,
Jan 11, 2021 Jan 11, 2021

Copy link to clipboard

Copied

Hi all

I have a document with a long list of plant names (genus + species = Panicum schinzii). Some have the same genus but a different species (Panicum deustum). They are not always mentioned in full in the text. In some instances it is just the genus (Panicum), or just the species (schinzii). Others have an abbreviation for the genus (P. schinzii). 

 

I am using the following GREP expression and setting the character style to italics. 

(?i)\b(Panicum|deustum|schinzii|P. schinzii)\b

 

For the most part this is working but I have a few problems that I am hoping to solve easily:

  1. One genus - sorghum - must not be italicised in the text in certain instances
  2. One of the species - maximum - is used as a normal word in certain places and should also not be italics

I can selectively turn off the GREP style in some instances but there are quite a few places where sorghum or maximum appear in the same paragraph as words that must not be turned off.

 

Can I turn off the GREP style selectively in these instances? Is there another way to handle this issue?

 

Thanks in advance

TOPICS
How to , Scripting , Type

Views

162

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

Participant , Jan 11, 2021 Jan 11, 2021

Hello @graywacke4 ,

 

GREP is a type of code language used to search for patterns. In GREP schinzii equals schinzii it's the same pattern, it cannot not equal schinzii. Understanding this helps though, if there is a much larger pattern you can look for vs the ones you don't want to effect or is there a pattern to the ones you want to not effect that you can effect after?

These patterns could be the text (pattern) before or after, the type of spaces before or after etc etc or other factors like diff

...

Votes

Translate

Translate
Participant ,
Jan 11, 2021 Jan 11, 2021

Copy link to clipboard

Copied

LATEST

Hello @graywacke4 ,

 

GREP is a type of code language used to search for patterns. In GREP schinzii equals schinzii it's the same pattern, it cannot not equal schinzii. Understanding this helps though, if there is a much larger pattern you can look for vs the ones you don't want to effect or is there a pattern to the ones you want to not effect that you can effect after?

These patterns could be the text (pattern) before or after, the type of spaces before or after etc etc or other factors like different paragraph styles effecting them.

If there isn't than GREP cannot read minds. You would than need to look maybe at a scripted approach, and this would only work if there was a logical repeatable reason why some are italicised over others.

 

Regards

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