Copy link to clipboard
Copied
Hi,
I would like to give colors to some letters.
For example, let's say I have the word "Word", I want this result : "Word".
I created 4 Characters Styles, each with a different color, now, I need to find how to "select the letter X of the word << Word >>".
Any idea please 😄 ?
Copy link to clipboard
Copied
Some context would be nice. Does this need to occur for a specific word or any word? Only four letter words? ALL four letter words? will there be other text in the paragraph? All of these will affect the solution.
Copy link to clipboard
Copied
There are other words in the paragraph, specific Word.
Copy link to clipboard
Copied
Any idea 😛 ?
Copy link to clipboard
Copied
What is the specific word? Will it appear more than one time in a paragraph? If it does, should all occurrences be treated the same?
Copy link to clipboard
Copied
"Pneumonoultramicroscopicsilicovolcanoconiosis" xD . Joking, but I dont think knowing the specific word can help us here, I would like a generic procedure to apply it on every word I would like.
Let's say it's present one time in each paragraph, but an answer for all possibilities where all occurences must be trated the same way is also interesting.
Copy link to clipboard
Copied
Unless there is something unique about your word (or list of words) you won't be able to identify it (them)using GREP. GREP matches patterns, so that pattern cannot exist anywhere you don't want to apply your style.
Copy link to clipboard
Copied
Okay, now we have a word, what could be the procedure ?
Copy link to clipboard
Copied
Simplistically:
Find/Replace “word” and insert a non-joiner before it, as:
Find: \bword\b
Replace by: ~j$0
Including Grep Styles in the para style as:
~j\K\w + color1
~j\w\K\w + color2
~j\w{2}\K\w + color3
~j\w{3}\K\w + color4
~j\w{4}\K\w + color5
...
(^/) The Jedi
Copy link to clipboard
Copied
I would like solution that I could use with a MergeData, I cant use find & replace (I didnt think it would involve a F&R solution so I didnt precise it, sorry).
If I understand well, this is what you propose :
- "Find << word >> between boundaries"
- "Store the data << word >> into the clipboard by replace it by << ~j >>"
Next, I dont see what it is, is it "find what is stored in ~j then apply a style to the letter number N from the left" ?
Copy link to clipboard
Copied
Nope! ...
You just need to insert the non-joiner before “word”!
... and it will be automatically colorized through the Grep styles.
About the use of “data merging”, you can run a F/R after it!
(^/)
Copy link to clipboard
Copied
There is not "step" after my DataMerging in my process, the file must not be modified.
What is a non-joiner ? The tilde " ~ " ?
I can add special characters in my text, can you give me an example please ?
Copy link to clipboard
Copied
Hi Michel,
I think what the OP wants to do is merge directly to PDF, so no post processing be done in this instance.
Rather than looking for a non-joiner, perhaps have the GREP look for a character that the user is unlikely to use in their general type such as | or © and then apply a "no fill or stroke" character style to that letter.
I've written about the "no fill or stroke" technique here: https://colecandoo.com/2012/08/08/no-fills-grep-styles-part-1/
What it means is that if the OP has the word paws for example, in their data merge file they would have to write |paws or ©paws for the GREP styles you've provided to be applied.
Copy link to clipboard
Copied
I'm okay with that.
Now I try to translate "
~j\K\w + color1
~j\w\K\w + color2
~j\w{2}\K\w + color3
~j\w{3}\K\w + color4
~j\w{4}\K\w + color5
"
into something usable in my case.
Copy link to clipboard
Copied
So, now that I renamed all my |words like that, what I can do ?