Skip to main content
Participant
January 11, 2021
Answered

Set italic style for Latin names

  • January 11, 2021
  • 1 reply
  • 266 views

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

This topic has been closed for replies.
Correct answer tacoeater

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

1 reply

tacoeaterCorrect answer
Participating Frequently
January 12, 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 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