• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to shade characters but not spaces

Community Expert ,
Dec 13, 2021 Dec 13, 2021

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:

 

2021-12-13_17-50-02.png

 

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!

 

TOPICS
How to , Type

Views

521

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 13, 2021 Dec 13, 2021

For example

\S+

character style underlined, thickness > font height with a negative offset

Votes

Translate

Translate
Community Expert ,
Dec 13, 2021 Dec 13, 2021

Copy link to clipboard

Copied

For example

\S+

character style underlined, thickness > font height with a negative offset

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2021 Dec 13, 2021

Copy link to clipboard

Copied

quote

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2021 Dec 13, 2021

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.


╟ Word & InDesign to Kindle & EPUB: a Guide to Pro Results (Amazon) ╢

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 13, 2021 Dec 13, 2021

Copy link to clipboard

Copied

Create a character style with a custom underline. Apply that character style to any letter in the paragraph style.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2021 Dec 13, 2021

Copy link to clipboard

Copied

Hi @davecourtemanche 

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+

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 13, 2021 Dec 13, 2021

Copy link to clipboard

Copied

But he's doing chord charts. I mean, even jazz doesn't have any million dollar chords. 😄

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2021 Dec 13, 2021

Copy link to clipboard

Copied

@davecourtemanche 

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2021 Dec 13, 2021

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!!

!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2021 Dec 13, 2021

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2021 Dec 14, 2021

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). 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 22, 2022 Mar 22, 2022

Copy link to clipboard

Copied

spaces between sentences
Like

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2022 Mar 22, 2022

Copy link to clipboard

Copied

LATEST
quote

spaces between sentences
Like

 


By @janö58856049

 

???

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines