Copy link to clipboard
Copied
Hey guys,
question. i have a really big layout that has lots of "P" values. see screenshots below. How do i tell indesign to apply italics to all of the "P" it find before a "<" or ">" or "="?
Thanks
Jonathan
Ah, for initial code to work your P must be uppercase - true, not with All Caps applied...
That's must be the case.
So, try to add case-insensitive ON/OFF:
(?i)\bP(?=[<>=])(?-i)
Copy link to clipboard
Copied
Well, you could start with this, and see how it works for you. Tested as a paragraph style option.
\bP(?=[<>=])
Copy link to clipboard
Copied
P(<|>|=)(\d+\.\d+|\d+)
This one only finds
P=1.234
P<1.234
P>1.234
P=1
P<1
P>1
Copy link to clipboard
Copied
this apply italic to the entire thing. i just want to apply italic to the "P"
Copy link to clipboard
Copied
did not worked
Copy link to clipboard
Copied
It does for me. Are you sure there is nothing unexpected between that P and the next character? And that you actually have applied this style to that paragraph?
Copy link to clipboard
Copied
i don't know what i am doing wrong.
Copy link to clipboard
Copied
Create a new text frame. Fill it with placeholder text. Type "P<0.01" somewhere inside. Then add this GREP style using the Paragraph panel menu to its containing paragraph only. That should work, right?
There could be an invisibly-thin or other code character in your original text. Typing it a-fresh will make sure the GREP Style works as intended.
Copy link to clipboard
Copied
Thank You, Jongware!
@Jonathan:
and if your test will pass it possibly indeed means the 'unexpected characters' in your text.
Then you can try to catch and eliminate them using this grep:
Find:
\bP.([<>=])
Change to:
P$1
Or just include that character in the initial code...
Copy link to clipboard
Copied
did a an empty text frame, applied the style. nothing. see below.
Copy link to clipboard
Copied
Ah, for initial code to work your P must be uppercase - true, not with All Caps applied...
That's must be the case.
So, try to add case-insensitive ON/OFF:
(?i)\bP(?=[<>=])(?-i)
Copy link to clipboard
Copied
still does not work:
Copy link to clipboard
Copied
this one worked!!
Copy link to clipboard
Copied
would it help to share the file? i might be making a mistake with setting up the styles? if it works for you guys than it must be something i am doing wrong in the styles.