Skip to main content
Participating Frequently
October 15, 2014
Question

How can I apply a GREP style to a text variable?

  • October 15, 2014
  • 4 replies
  • 3701 views

Hello everybody,

I have a question concerning GREP styles inside Paragraph styles.

1. I've created a text variable to generate a recurring title on the upper side of the page based on the main title paragraph style;

2. The recurring title is in Adobe Garamond Small Caps, all letters in lower case, and it is formatted with a paragraph style sheet in the master page;

3. I want to create a GREP style for the recurring title, according to which every time that in the recurring title appear an apostrophe or the double quotes, they are automatically lowered 2pt on the baseline

(I already created the character style sheet that lowers letters of 2pt).

What I need is the correct GREP formula to automatically apply the character style sheet to apostrophes and double quotes, in the line of text generated by the text variable...

Thanks for your  help

p.

This topic has been closed for replies.

4 replies

polifiloAuthor
Participating Frequently
October 21, 2014

It works perfectly, thanks Obi-wan

polifiloAuthor
Participating Frequently
October 21, 2014

Extra help:

with this GREP formula ['"] I select apostrophes, quotation marks “” and Guillemets «». Instead I want Guillemets not to be selected...

Only apostrophes and quotation marks “” need to be lowered -2pt on the baseline, not Guillemets of course!

Thanks for your help!

Obi-wan Kenobi
Brainiac
October 21, 2014

Hi,

Even I've no problem with this, you can use the unicode values (see glyphs), as (for me):  [\x{2019}\x{02DD}]

« = \x{00AB}

» = \x{00BB}

polifiloAuthor
Participating Frequently
October 20, 2014

any advice on the GREP formula that I need?

GREP formula to automatically apply the character style sheet to apostrophes and double quotes

Obi-wan Kenobi
Brainiac
October 20, 2014

Hi,

As I said, using Power Headers is the best way to do it.

As Power Headers treats the header as "live text", you can use a simple grep style inserted in the header para style:

… to obtain:

For the sample, I use a char style named "-2pts" with Shift -5 pts and Green color to show you the place of ' and ".

Don't forget that, even Power Headers treats the header as "live text", you only have to update Power Headers to make an update of the headers! 

Even I use in another cases Tomaxxi's [JS] and it's a good way to treat the question, Jean-Claude Tremblay's solution is less interesting because the variable used is converted in text. If the variable text content changes, it's more complicated to manage the update!

polifiloAuthor
Participating Frequently
October 20, 2014

Yes, I saw Tomaxxi's script and I'm aware of the problem of the text update...

Power Headers is surely more "powerful"...

Many thanks for your help!

Jongware
Community Expert
October 15, 2014

Text variables do not "generate" a line of text, so this cannot be done with text variables. You have to convert them to plain text first.

polifiloAuthor
Participating Frequently
October 15, 2014

Hello Jongware,

so how do I convert them to plain text? is it possible to do it automatically?

jctremblay
Community Expert
October 16, 2014

When I need to convert variable to plain text, I like to use the «tomaxxiVARIprocessor» script. You can find it here: Downloads | tomaxxi.com | All about Adobe Creative Suite