Copy link to clipboard
Copied
I'd like to create a paragraph style or even character style, if appropriate, where the text characters have a background color, but the spaces are unformatted space. Something like this effect:
I can't figure out how to shade only the non-space characters. I have a GREP style in play that can detect and modify the character style, but I can't figure out how to shade only the non white spaces.
Any help is appreciated!
For example
\S+
character style underlined, thickness > font height with a negative offset
Copy link to clipboard
Copied
For example
\S+
character style underlined, thickness > font height with a negative offset
Copy link to clipboard
Copied
For example
\S+
character style underlined, thickness > font height with a negative offset
By @pixxxelschubser
OK, with this, I think I'm on the right track! I knew there had to be a trick to the shading, I didn't think of ultra thick underlines! and with a little extra GREP tweaking, I can pick up a single space before and after the characters so there's a bit of a border.
Thanks!
Copy link to clipboard
Copied
I think the GREP style is your only option. I don't think ID has any option to exclude style from whitespace. Interesting notion for an option but I think the need is so slight (except for certain types of art/display type) it's not likely to happen.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
a good start. But for any grep style, it's useful to test it with a few examples. Try your own grep on a simple sample text like "my first $100,000.00".
What happens?
And what with \S+
Copy link to clipboard
Copied
But he's doing chord charts. I mean, even jazz doesn't have any million dollar chords. 😄
Copy link to clipboard
Copied
Too bad. I'm afraid I don't get the joke. English is not my native language. And even worse, my English is not the best.
Copy link to clipboard
Copied
I've got it sorted, thanks to @pixxxelschubser 's suggestion. My regular expression is working just fine, the trick for me was to use the underline as the background. Thanks everyone for your help!!
!
Copy link to clipboard
Copied
Glad to hear that.
Just out of curiosity - what's your grep?
In my opinion, there are only two efficient notations for your requirements:
\S+
or
[^\s]+
Both Grep means the same.
Copy link to clipboard
Copied
Right now I'm using simply \w which matches all the "word characters" (letters, digits and underscore, but omits punctuation). This is working well.
I considered \s\w+\s to pick up the spaces surrounding the word characters, but I think that underlining a white space doesn't create a visible underline (have to try that but I believe it will not highlight the white space).
Copy link to clipboard
Copied
spaces between sentences
Like
Copy link to clipboard
Copied