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

overhanging characters in cells using GREP

Guest
Aug 12, 2009 Aug 12, 2009

I am trying to work out a way of using a multiple search in GREP for putting an overhanging character (ie: ), p, %) in a table cell. I have managed to succeed individually, using GREP along with character and paragraph styles. I have tried to search for all 3 of the above in a multiple search, but it seems to clash somewhere. The GREP search for individual characters is thus:

FIND: \)

CHANGE TO: )~h~j#

The "hash" has a style given to it, which includes kerning back, to achieve the overhang. So in the table cell, you would have:

1,100

(2,200)

3,300

This would apply to each search.

TOPICS
Scripting
1.4K
Translate
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 ,
Aug 16, 2009 Aug 16, 2009

Probably all you need to do is define your overhanging characters as a character class by putting them in square brackets: [%)p] -- no need to escape characters in character classes, so ")" is fine here, no need for "\)".

Peter

Translate
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
Guest
Sep 01, 2009 Sep 01, 2009

Thanks Peter
Have only just got to look at your reply
I have tried what you have suggested, searching for ) and replacing with [)]. Initially, the search couldn't recognise the parenthesis. So I put it in quotes ")". This time it did see the search. The end result was a parenthesis with brackets either side (as keyed). Being new to the GREP coding, am I keying in the correct characters? Remember, I am searching this within a cell table and need the ) to overhang the cell. Which characters do I need to put into the search?
I await your reply
Many thanks
Steve

Translate
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 ,
Sep 01, 2009 Sep 01, 2009

Steve,

I meant this:

Find what: [%)p]
Change to: )~h~j#

Placing characters in brackets creates a character class -- [%)p] stands for "find % and ) and p".

Peter

Translate
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
Guest
Sep 02, 2009 Sep 02, 2009

Thanks Peter, thats great.

Now, what would I have to insert into the replace panel, if I wanted to do a multiple search. By this I mean searching for the ) and % and p – and then replacing them with the relevant codes all in one search. Would InDesign be able to differentiate between the 'find' characters and replace them with the relevant replacements. So in my search it would be FIND – and then REPLACE – )hj# %hj# phj#

is this possible?

Many thanks

Steve

 

Translate
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
Guide ,
Sep 02, 2009 Sep 02, 2009

Find: [%)p]

Replace: $0~h~j#

@+

Marc

Translate
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
Guest
Sep 03, 2009 Sep 03, 2009

Thanks Marc

That seems to have done the trick. In conjunction with the individual styles I have made, the overhang works great. Do you know any more about producing an overhang without various styles. By this I mean one style for the ), one for % and one for p. Also, there is a style for the hash. I have tried incorporating all of these styles into one, but it doesn't work.

Regards

Steve

Translate
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
Guide ,
Sep 03, 2009 Sep 03, 2009
LATEST

stevieun wrote:

(...)
Do you know any more about producing an overhang without various styles. By this I mean one style for the ), one for % and one for p. Also, there is a style for the hash. I have tried incorporating all of these styles into one, but it doesn't work.
(...)

GREP-Styles could be a promising path:

* First, create a character style for each character you need to customize: RIGHT_PARENTHESIS, PERCENT_SIGN . . .

* Then, in your main paragraph style, add the corresponding GREP-Style rules, one to apply the RIGHT_PARENTHESIS style to the pattern \), another for % , et c.

@+

Marc

Translate
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