Join Nigel French for an in-depth discussion in this video Creating a text highlight with padding, part of Type Tips Weekly.
- [Narrator] This weeks type tip is about creating a text highlight. Specifically it's about a work around to address a short coming of this technique. First just a little bit of background. So I want to be able to highlight a word or a string of words and then come and apply a character style to them like so. The benefit of this of course is that if I change my mind about the color of the highlighting, I can come and edit the character style and the highlight is actually created with an underline and just change the color right there and it will update in place.
Now here's the shortcoming of this approach. While you can use your underline options to determine the weight and vertical position of the highlight, what you can't do is add any padding either side of the word. So it just looks too tight to the letters. And I wish there were better news but I can't find a real way around this.
Let me just show you where the highlight is created. So in the first instance I selected a word and I held down my optional alt key and clicked on the underline. So here we specify the weight of the underline. It's offset and you can see if I turn on my preview and adjust the offset, how that is moving up and down relative to the type. And then we specify a color for the highlight.
But no option for adding in just a little bit of extra padding. Well you might be thinking, what about some other options? What about a paragraph rule? You can certainly add in padding around the type with the paragraph rule and the paragraph rules by the way are right here. The rule above and the rule below. As the name suggests, this rule would apply to the whole paragraph. So that's not going to work.
Another option that you might explore is using the strike through, because strike through could also be used to create highlighting but it's the same problem as with the underline. What about paragraph shading? Well unfortunately that doesn't work either because it applies to the whole paragraph. So anyway, here's what we can do. If we put a thin space either side of the highlighting and we just need to make sure that the thin space also has the character style applied.
So to do this manually which would be rather tedious if there's a lot, I would put my cursor before the word, use the keyboard shortcut for a thin space which is command option shift and m and then highlight that thin space and then do the same thing on the other side, command option shift or control alt shift m and in this instance it automatically picks up the highlighting. I'm just going to undo those two steps.
So how would we automate or at least semi automate the insertion of those thin spaces around the highlighted text? Well we can use a GREP find change to do this. I'll come to find change. I need to switch to GREP. So what I'm looking for is any character, I'll come down to repeat and I want it to be zero or more times. So what I'm going to change it to is found text and on the left of the found text I want thin space.
And on the right of the found text, I also want a thin space. Now the find format needs to be that highlight character style that I have already prepared. And the change format also needs to be in that character style. You can determine the scope of the search, I'm just going to search within this one story and then change all.
And now when I zoom in, we should see that all of my highlighting has a nice bit of padding either side of the start and the end of those text highlights. So I realize that's not perfect solution but until a perfect solution comes along, I think that's the best way of making sure that any highlighting applied with a character style has a bit of padding either side.