Copy link to clipboard
Copied
Good afternoon,
I have antoher GREP style which I need but can't figure out on my own. I need to create a fixed amount of space (either in millimeters or via a specific character, like an en dash) between a colon and its following character but only at the beginning of the paragraph. And it also needs to replace whatever existing space(s) might exist between the colon and the next character.
As you can see below, for interviews, we always have a name or initials followed by a colon. A normal space after that doesn't look very good. And different editors might add different kinds of spaces after the colon, which is why it should replace the existing space. And the automatic spacing should not be applied to colons later in the paragraph. Any help would be really great as this would save me a lot of time from having to manually format every section in 50-page+ interviews.
Here is how it should look with ample space after the first colon. Notice the second colon later in the same first line!
Thanks!
Warmly,
Jonathan
Copy link to clipboard
Copied
not thoroughly tested, but might work:
^(.+?):\K\h
change to whatever you need
Copy link to clipboard
Copied
Just a note: since you’re going to replace a found character (space after the first colon), you won’t be able to use this regex as a part of Paragraph style. Only Find/Change will work.
Copy link to clipboard
Copied
Thanks so much for the GREP. Am I correct that the needed Find/Change, in order to replace the space, would have to be done manually after all my typography is finished, or is there a way for a Find/Change to work continuously? If that's the case, that I would have to manually trigger the Find/Change, maybe a better solution is to manually delete all the spaces between the colon and the text and then use GREP to automatically add space or a space character. This takes time but at least I would be able to change the amount of spacing globally and not have to go through each instance multiple times if/when I want to try out different spacing. Do you agree? What the GREP be the same for this? Thanks again!!
Copy link to clipboard
Copied
GREP as a part of paragraph style options can not add, remove or replace any characters. Just think about it as a style. Styles change formatting, not content.
is there a way for a Find/Change to work continuously?
Nope.
maybe a better solution is to manually delete all the spaces between the colon and the text and then use GREP to automatically add space or a space character.
No point doing this. Remember, you can't add anything using just style! When your text is all here, just run Find/Change once. Think about Scope setting, maybe restrict replacements to specific paragraph style… You know your project better. That said, use settings in F/C panel window, and then hit Change All. If settings are correct, no need to stop on every found space.
A drawback vs GREP as a style: any newly added text will not catch those earlier changes automatically. No way.
But you always can repeat that F/C operation on the whole text - it will do no harm.
Copy link to clipboard
Copied
JonSimons wrote
maybe a better solution is to manually delete all the spaces between the colon and the text and then use GREP to automatically add space or a space character.
Well, thinking again, one may find this as a possible workflow, too.
1. To eliminate space after first colon using F/C and this query: ^(.+?):\K\h
2. In Paragraph style include GREP ^(.+?)\K: and apply Charstyle, which sets Tracking to a rather big value, say, 500.
Effectively this would work the same. Still no big advantages, since if you add more text you will need to run F/C again to remove spaces after the first colons in your added text, only then your GREP style will come into play *automatically*.
That said:
Option 1: run F/C; maybe run again later.
Option 2: run F/C; use GREP style; maybe run F/C again later.
Up to you.
JonSimons wrote
This takes time […]
Running F/C won't take any significant amount of time, really.
Copy link to clipboard
Copied
Thanks so much for this! I might have a followup question but only after I spend some more time experimenting with your suggestions.
Warmly,
Jonathan