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:
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
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
Copy link to clipboard
Copied
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