Copy link to clipboard
Copied
I'm facing a GREP problem and need some help. I'm creating a Bible devotional and have a GREP paragraph style set up that superscripts the Bible verses. The problem is, each paragraph starts with the reference, which I don't want superscripted. I've been able to do the following using the formula
\s\d+(?!\:|\,)
(The reason I'm using a : or , is it will be translated into multiple languages)
My problem arises when sometimes the reference has multiple verses, in which case the second reference is superscripted:
My question is, is there a way to ignore a GREP style? Ideally, I would have an en space after the reference and start my style after that. I've also tried using a nested character style, but the character style doesn't override the GREP style.
Thanks!
The following should work using your current GREP style.
1. Create a second GREP style for your run-in head: ^.+?\d\s(?=\u).
2. In the character style for the run-in head, set Basic Character Formats > Position: Normal.
3. Make sure that the new GREP comes after the GREP style for the verse number in the GREP Style pane.
Copy link to clipboard
Copied
Based on your example, where the verse number always follows a space and directly precedes an uppercase letter, would \s\d+(?=\u) not work in place of your current expression?
Copy link to clipboard
Copied
Thanks David. That's not always the case—especially with different versions and languages.
Copy link to clipboard
Copied
If hyphenation and spellchecking is important, you may want to consider a paragraph style for each language with the correct Language settings. You could customize your GREP code for each style where different patterns occur.
Copy link to clipboard
Copied
The following should work using your current GREP style.
1. Create a second GREP style for your run-in head: ^.+?\d\s(?=\u).
2. In the character style for the run-in head, set Basic Character Formats > Position: Normal.
3. Make sure that the new GREP comes after the GREP style for the verse number in the GREP Style pane.
Copy link to clipboard
Copied
Fantastic! That did exactly what I needed. Thanks so much.
And, I can simplify the entire superscript to \d+, which is an added bonus.
Copy link to clipboard
Copied
Unfortunately, I won't be doing the layout on the other languages—we send out the files to local workers, some of whom have very little knowledge of InDesign. I guess another way of asking my question is, is there a way to apply a GREP style in a way similar to a nested style, where it only occurs after a specific character (like an en space).
Find more inspiration, events, and resources on the new Adobe Community
Explore Now