Copy link to clipboard
Copied
Hi all
We have a job we are typesetting in Bembo and we need to change the start of the figure captions to bold. "Fig.12 Blah..." to "Fig.12 Blah..." and I thought a GREP style would be perfect for this as all the captions are styled with the same para style. NB The figures are styled using Bembo's "Small Caps & Oldstyle Figures". I've done this sort of thing before so I created a character style which was "Bold Oldstyle Figures" and used the following GREP style in the appropriate para style; Fig\.\s\d+
"Fig. " changes to bold but not the number. If I select the number it shows that the character style is being applied to it (at the foot of the Char Style panel) but the font has not actually changed from "Small Caps & Oldstyle Figures" to "Bold Oldstyle Figures". Just to prove I was not going mad I changed the char style that is being applied to be magenta and sure enough the figures become magenta as per the char style but the font specified by the char style is not being applied;
If I use the same GREP expression in Find/Change to find the text and apply the same char style it works as expected. I'm confused - can anyone tell me what I am doing wrong? I know I could do this using Javascript or manually using Find/Change but this has to be applied to multiple documents on this and future jobs and GREP styles really is the most efficient way to do this, if possible.
thanks,
Iain
Ah, there is your problem then!
Local formatting always trumps GREP styles, just as it also trumps character styles. In addition, character styles trump GREP styles as well. Even when applying your Old Style font to digits with a style instead of locally overriding it, would still not work.
So you need to remove the overrides, for these occurrences only. Try this: search for the formatting combination of "GREP Character style" + "override font style", and replace with only the GREP character style
...Copy link to clipboard
Copied
Is there another GREP style that applies the OldStyle (regular) font to all plain decimals? If so, make sure this new GREP style is applied *after* that one, not before.
Copy link to clipboard
Copied
Hi Jongware - thanks for your reply. No, there are no other GREP styles in that para style. The digits were converted to OldStyle (regular) by a blanket GREP expression in a javascript ran after import. The OldStyle font is not being applied with char styles either.
Iain
Copy link to clipboard
Copied
Ah, there is your problem then!
Local formatting always trumps GREP styles, just as it also trumps character styles. In addition, character styles trump GREP styles as well. Even when applying your Old Style font to digits with a style instead of locally overriding it, would still not work.
So you need to remove the overrides, for these occurrences only. Try this: search for the formatting combination of "GREP Character style" + "override font style", and replace with only the GREP character style again.
Copy link to clipboard
Copied
Thanks Jongware - I didn't know that. Certainly explains what I am seeing. Doesn't sound like I can use just GREP styles to do what I want - I don't really want to have to do a manual Find/Change for each document although that would work. I could also clear all the overrides in my document and that will make my GREP style work as intended, but I don't want to lose any overrides we may have set deliberately.
I have found a way to do it using nested styles so all's well that ends well.
thanks,
Iain