Hi everyone, I'm not that great at indesign, but my typography teacher couldn't find a solution either. I hope someone can help me.
I have a long text with different body paragraph styles assigned to different parts of the body text. Each paragraph style has grep styles that are assigned to a lot of different words and are ofcourse linked to character styles. Some body paragraph styles have the same words in grep but a different character style assigned to it. I need to keep this.
Now, I want to add space before and after each word-grep-style that is linked to character style1. I can find all the words with Find&Replace when I look for them with character style1 in Find Format. But I have to manually add space before and after each word. Is there a way I can write a line in Find&Replace that does that for me?
Find Format: Character style1
Change to: [space] Character style1 [space]
I would be very very happy if someone could tell me how to do this 🙂 Thank you!
Hi, it is hard for me to understand your exact needs. Could you post a screen shot?
BTW, GREP styles are character styles, they are not “linked” and they are a part (most every time) to a paragraph style.
Hi, I was already affraid it would be unclear...
So in my grep styles of the body paragraph style I have different words I want to change with character style1. But for each word that has character style1, I want space before and after like in the text example.
What I did now was find the words that have character style1 with find and replace, and then I manually added the spaces before and after each word since there are so many different words linked to character style1.
I would like to find an automated way which adds spaces before and after words with characterstyle1. This way, when I add new words in my grepstyle with character style1, these words will also have space added before and after the word.
I hope this is a bit more clear...?
When you do a find&replace, you can recover the found text to reuse in the "replace" field. You need to use the GREP tab in Find/Replace window.
Replace to: _$1_
Find format: Character Style 1
Explanation: in the Find field you search for any character (dot) one or more times (the plus symbol). The parenthesis in a GREP expresion delimits what you want to recover for the Replace field. You can store up to 9 different coincidences that can be recovered as $1, $2, $3,... in the Replace field. Also you can recover the whole found expresion with $0. Remember, this only works in the GREP tab.
So in the example avobe you simply add a "_" character after and before the word styled with CharacterStyle1.
But if you want to replace the space before and after the character style, you can't do it with find/replace because they have not been formated. When you do a find/replace searching for a formatted expression, it must be totally formatted (you can't search for a expression with two formats at once).
So my fast solution is:
1.- format with GREP expresion
2.- Use my example above to add the desired space ( space - long space - formatted word - long space - space)
3.- Do another two Find/replace operations to remove undesired spaces (change "space - long space" to "long space" and "long space - space" to "long space")
You can find up to 12 different spaces under the "@" simbol at the end of the Find field. Select whatever you need.