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

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.

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!

Similar Messages

  • How do I apply a grep style to the plus (+) sign?

    I was able to apply a grep style to the minus and equal sign, but not the plus sign "+".  It appears the plus sign means 'apply to all' in the grep style box.  Can some assist me with this? Thanks in advance.

    Thank you. It worked perfectly.

  • How can I have two different styles of hyperlink text on one page?

    Hi
    I'm using an external css document to control the look of my site, and would like to have two differnet types of hyperlink.
    One for within the content text, which would be the same size and style as the content text, and one that is BIGGER and BOLDER for 'title' hyperlinks.
    At the minute I have one set up for the content text, which is:
    a:link {
    color: #0000CC;
    text-decoration: none;
    a:visited {
    text-decoration: none;
    color: #666666;
    a:hover {
    text-decoration: underline;
    color: #0000CC;
    a:active {
    text-decoration: none;
    color: #666666;
    How can I set another style up for the title links without affecting the look of the content links??

    Pseudo-classes & Descendant selectors is what you're after...
    From your example, I would leave those styles for your standard links and would create new rules for the content area and then follow similar for your 'titles' or you could use Headings <h1> are they are actually headings that you want styled.
    The following is assuming that you have used a Div or a container with an ID of mainContent.
    #mainContent a:link {
         text-decoration: underline;
         color: #66CC99;
    #mainContent a:visited {
         text-decoration: underline;
         color: #66CC99;
    #mainContent a:hover {
         text-decoration: none;
         color: #333333;
         background-color: #FFFFFF;
    #mainContent a:active {
         text-decoration: underline;
         color: #66CC99;
    For another area of the page, say a left sidebar and gave it an ID of #leftcolumn 
    (I've used the same styles for easier copying pasting, but naturally, you would style then differently)
    #leftcolumn a:link {
         text-decoration: underline;
         color: #66CC99;
    #leftcolumn a:visited {
         text-decoration: underline;
         color: #66CC99;
    #leftcolumn a:hover {
         text-decoration: none;
         color: #333333;
         background-color: #FFFFFF;
    #leftcolumn a:active {
         text-decoration: underline;
         color: #66CC99;

  • How can I apply a new style with a snippet and make DW remove artifacts of the old style?

    Hello,
    I am using Dreamweaver CS5 on Windows XP SP3. My problem seems simple but the resolution remains elusive.
    Let's say I am editing pasted-in text from MS Word that DW has auto-formatted. I highlight some text and use a snippet to enclose the text in h2.
    Instead of deleting the former style and replacing it with h2, DW applies the h2, but copies the old style, enclosing nothing, and bumps it to the next line. If the old style included a paragraph tag, that throws in extra white space. For nothing at all.
    Now, this seems like a minor thing, but it's not so minor when you are trying to quickly prepare a large document with various header styles. Having to make dozens of edits that I think should be completely unnecessary becomes a real burden.
    Is there a way to enclose a bit of text in a new style with a snippet without having the old style stick around?
    Thanks for any and all replies!
    Michael Salmons

    Maybe auto-format is not the correct terminology, but DW does interpret MS Word formatting in some way,and in a way I cannot control (well, I can to a limited degree). The term that popped into my head describing this process was automatic formatting.
    I don't really want to paste in as text, then I have to touch everything. I mean, I do frequently end up touching everything in a document anyway, but if any decisions can be "automated," I like to at least give it a try.
    DW makes mostly good guesses* about Word formatting (*or whatever mechanism translates word formatting to html in DW). Even if it is just a little wrong, it saves me a lot of time. <p><strong> can be converted to <h2> faster than text that only has a CRLF to distinguish it from surrounding text.
    I'm not mixing any styles. I control the style absolutely. I would just like to know how to use snippets in a way that truly replaces the Word-suggested tags rather than preserving them for no good reason. Perhaps there is no way to do that, or I so fundamentally misunderstand snippets I am fooling myself.

  • Apply different font styles in single text frame

    hi all
    how can i apply different font styles in a single text frame using indesign script ?
    for example :
    "dasdnasndasndlasndnasdlasdasdas"
    may i know is it possible to do that and how to do that ?
    thanks

    You can set (as well as read) every single property of any text range with scripts. This is javascript; it assumes you text cursor is inside a frame with some text.
    * Setting some specific characters to a color:
    app.selection[0].parentStory.characters.itemByRange(5,10).fillColor = "Red";
    * Change the font of words:
    app.selection[0].parentStory.words[3].appliedFont = "Arial\tBold";
    * .. or just the style:
    app.selection[0].parentStory.lines[2].fontStyle = "Italic";
    * .. or any other attribute (this one requires you to have at least 5 characters selected):
    app.selection[0].characters[5].underline = true;
    Of course these operations are not limited to something you select; they work the same with any text frames you can refer to.
    app.activeDocument.textFrames[1].paragraphs[2].appliedCharacterStyle = "charstyle";

  • How can i apply adobe bridge in my ipad 2?

    how can i apply adobe bridge in my ipad 2?

    As when installing an app on a computer, there must be a version for the app that is compatible with the computer and the OS running the computer.
    Is there an Adobe Bridge app for the iPad available via the iTunes app store?

  • How can I apply my CS Photoshop membership to a second computer?

    how can I apply my CS Photoshop membership to a second computer?

    Thank You!
    I felt like I was wandering through mazes to get that question to the right
    venue.
    Thanks again,
    Gayatri

  • How can I apply text position attributes (e.g. lower third) to more than one title at a time?

    How can I apply text position attributes (e.g. lower third) to more than one title at a time?

    jhb3243
    What version of Premiere Elements are you using and on what computer operating system is it running?
    In the case of this theoretical lower third to be applied to more than one title at a time
    a. Is there text in the lower third besides a graphic of some kind?
    b. Are all the titles to which this lower third is to be applied all together on the Timeline or scattered?
    If no text in lower third and titles all together, then, with text titles on Video 1 and lower third on Video 2, drag out the lower third to cover the length of the text titles on Video 1.
    I do not find "lower third" title files to be in the same category as certain effects where the Copy and "Paste Attributes" or "Paste Effects and Adjustments" lend themselves so well.
    Let us see what others have to say about all this. I will continue to experiment with what you seek and how you would prefer to get there. I am not optimistic but I will try.
    Thanks.
    ATR

  • How can i apply gradient...

    I have a rectangular shape movie Clip (Size :130px X40 px). I
    want to apply linear gradient on it using action script. Can
    anybody help me how can I apply gradient on it.
    Note: This movie clip is made manually. Not by using
    createEmptyMovieClip method.

    i already checked this -
    MAKE A OVAL ON YOUR STAGE AND GIVE THIS INSTANCE NAME 'ovl'
    (withought single quote) and use the code under
    here i am creating two movie clips on stage --
    1st is 'ovl' and 2nd one is 'mc'
    But to apply gradient on ovl i have to use setMask method
    like this _root.mc.setMask(_root.ovl)
    i do not want to use SetMask... I want to apply gradient
    directly on 'ovl'
    How can i do ??????????????
    // create emtpy movieclip
    mc = createEmptyMovieClip("mc",1);
    // set the constants for the gradient fill
    // the colors
    col = [0x000066,0x0033FF];
    // the alphas
    alp = [100,30];
    // the ratios
    rat = [100,255];
    //this.onMouseMove = function () {
    // we will make a radial gradient
    // and make it move with the mouse
    // first we clear the previous gradient fill
    mc.clear();
    // get the mouse-position
    // the x-coordinate
    x = _xmouse-200;
    // the y-coordinate
    y = _ymouse-200;
    // set the matrix for the transformation
    matrix = { matrixType:"box",x:x,y:y,w:400,h:400,r:0 }
    // now make the new gradient fill
    mc.beginGradientFill("linear",col,alp,rat,matrix);
    // now make the shape to fill
    mc.lineTo(400,0);
    mc.lineTo(400,400);
    mc.lineTo(0,400);
    // end the fill
    mc.endFill();
    _root.mc.setMask(_root.ovl)
    Text
    Text

  • How can i apply different color for each cell in jlist component?

    hi guys i need your help and sorry if my english is very bad..guys how can i apply different colors for each cell in jlist component? for example for the first cell i want to apply color blue, for the second cell i want red, etc... i need your answer guys tnx..
    Edited by: ryrene on Mar 21, 2010 12:13 AM

    ryrene wrote:
    hi guys i need your help and sorry if my english is very bad.
    ..guys how can i apply different colors for each cell in jlist component? for example for the first cell i want to apply color blue, for the second cell i want red, etc... i need your answer guys tnx..I'll see your tnx, and raise you dve bmbrs & nplm.

  • How can i  apply this  java program for  a jsp page?

    import java.io.*;
    import java.util.*;
    public class FileProcessing
      //create a vector container  for the input variables
         Vector variables = new Vector();
      //create a vector container for the constants
         Vector constants = new Vector();
      /*create a string expression container for the equation
         as read from the file */
         String expression = " ";
      //create double result container for the final result
         double result = 0;
         public boolean processFile(String filename,String delim)
          //index for values vector
              int num_values = 0;
          //index for constants vector
              int num_constants = 0;
          //current line being read from the external file.
              String curline = " ";
          //start reading from the external file
              try
                   FileReader fr = new FileReader(filename);
                   BufferedReader br = new BufferedReader(fr);
                   while(true)
                        curline = br.readLine();
                        if(curline == null)
                             break;
                    //determine the type of current interaction
                        boolean variable = curline.startsWith("input");
                        boolean constant = curline.startsWith("constant");
                        boolean equation = curline.startsWith("equation");
                        boolean output = curline.startsWith("result");
                   //on input variables
                        if(variable)
                          StringTokenizer st = new StringTokenizer(curline,delim);
                          int num = st.countTokens();
                          int count=0;
                          while(st.hasMoreTokens())
                               String temp = st.nextToken();
                               if(count==1)
                                    byte b[]= new byte[100];
                                    System.out.println(temp);
                                    System.in.read(b);
                                    String inputval = (new String(b)).trim();
                                    variables.add(num_values,inputval);
                                    num_values++;
                               count++;
                        // on constant values
                        if(constant)
                             StringTokenizer st = new StringTokenizer(curline,delim);
                             int num = st.countTokens();
                             int count = 0;
                             while(st.hasMoreTokens())
                                  String temp = st.nextToken();
                                  if(count==1)
                                       byte b[]= new byte[100];
                                       System.out.println(temp);
                                       System.in.read(b);
                                       String cons = (new String(b)).trim();
                                       constants.add(num_constants,cons);
                                       num_constants++;
                                  count++;
                        // on equation
                        if(equation)
                             StringTokenizer st = new StringTokenizer(curline,delim);
                             int num = st.countTokens();
                             int count = 0;
                             while(st.hasMoreTokens())
                                  String temp = st.nextToken();
                                  if(count==2)
                                       this.expression = temp;
                                  count++;
              // now we are ready to evaluate the expression
                       if(output)
                          org.nfunk.jep.JEP  myparser= new org.nfunk.jep.JEP();
                          myparser.setAllowAssignment(true);
                          for(int i=1;i<variables.size()+1;i++)
                             String name = "arg"+Integer.toString(i);
                             myparser.addVariable(name,new Double(variables.get(i-1)
                                                .toString()).doubleValue());
                          for(int i=1;i<constants.size()+1;i++)
                               String name = "arg" +Integer.
                                         toString(i+variables.size());
                               myparser.addConstant(name,new Double(constants.get(i-1).toString()));
                   //output is obtained as follows
                          myparser.parseExpression(expression);
                          result = myparser.getValue();
                          System.out.println("Assay value: "+result);
              catch(Exception e)
                   System.out.println(e.toString());
              return true;
         public static void main(String[] args)
              FileProcessing fp = new FileProcessing();
              fp.processFile("input.eqn",":");
    }//my text file name is: "input.eqn" (given below)
    input:Enter Value1:arg1
    input:Enter Value2:arg2
    input:Enter Value3:arg3
    constant:arg4
    constant:arg5
    Equation:arg1+arg2+arg3
    result:

    how can i apply this java program for a jsp pagewhy do you want to do this ?
    Your program reads from a file on the disk and formats based on a patterm.
    Jsp is not intended for such stuff.
    ram.

  • How can I apply drop shadow effects to graphics and pictures? It was very easy in previous versions and I can't find it. Thanks

    How can I apply drop shadow effects to graphics and pictures? It was very easy in previous versions of Final Cut and I can’t find it. Thanks

    Try this one, works marvelous:
    http://www.rippletraining.com/using-the-rt-drop-shadow-in-final-cut-pro-x.html
    Regards
    Nolan

  • How can i apply border for fluid grid layout div

    How can i apply border for fluid grid layout div

    <!doctype html>
    <!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
    <!--[if IE 7]>    <html class="ie7 oldie"> <![endif]-->
    <!--[if IE 8]>    <html class="ie8 oldie"> <![endif]-->
    <!--[if gt IE 8]><!-->
    <html class="">
    <!--<![endif]-->
    <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Untitled Document</title>
    <link href="boilerplate.css" rel="stylesheet" type="text/css">
    <link href="CSS/Layout.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="flexslider.css" type="text/css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
    <script src="jquery.flexslider.js"></script>
    <!-- Place in the <head>, after the three links -->
    <script type="text/javascript" charset="utf-8">
      $(window).load(function() {
        $('.flexslider').flexslider();
    </script>
    <!--
    To learn more about the conditional comments around the html tags at the top of the file:
    paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
    Do the following if you're using your customized build of modernizr (http://www.modernizr.com/):
    * insert the link to your js here
    * remove the link below to the html5shiv
    * add the "no-js" class to the html tags at the top
    * you can also remove the link to respond.min.js if you included the MQ Polyfill in your modernizr build
    -->
    <!--[if lt IE 9]>
    <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <script src="respond.min.js"></script>
    </head>
    <body>
    <div class="gridContainer clearfix">
      <div id="LayoutDiv1"><img src="SJV-Images/Banners/Dark-green-curved-header.png"/></div>
      <div id="LayoutDiv2">
      <div class="flex-container">
      <div class="flexslider">
        <ul class="slides">
          <li>
            <img src="SJV-Images/Stud1.jpg"/>
          </li>
          <li>
            <img src="SJV-Images/Stud2.jpg" />
          </li>
          <li>
            <img src="SJV-Images/Stud3.jpg" />
          </li>
        </ul>
      </div>
    </div> </div>
      <div id="Nav">This is the content for Layout Div Tag "Nav"</div>
      <div id="Special_Features"><h3 align="center">SPECIAL FEATURES</h3>
      <ul>
      <li>
      It is one of the oldest school.</li>
      <li>It was first started as an orphanage for the children of British soldiers, and later moved to its current location.</li>
       <li>Rich in Anglo-Indian tradition dating back to three centuries.</li>
      <li>The campus now has separate buildings within the campus for year 1 to  year 8 (Junior and Sub Junior block) and year 9 to year 12 (Senior and   Super Senior block).</li>
      <li>The school has montessori facilities in a separate building.</li>
      <li>The School also has boarding facilities for students from distant places.</li>
      </ul></div>
      <div id="History"><img src="SJV-Images/His_Image.png" alt="Hisimage" class="floatleft">
      <h3>HISTORY OF OUR SCHOOL</h3><P>In 1750 – a very long time ago,a missionary and a teacher, Christian Frederick Schwartz came to India to work in the Danish Mission at Tranquebar.Due to his own personal charm, genius and integrity, soon he became a trusted envoy to the court of Princes ,both hostile and friendly. He even helped in the training and education of Serfogee Rajah, the adopted son of the Tanjore Raja Tuljagee.</P></div>
    <div id="Photo_Gall"><center>
        <strong>PHOTO GALLERY</strong>
    </center>
      <p><img src="SJV-Images/Photogall.png" width="174" height="70" class="floatright"/></p>
    </div>
      <div id="News_Events"><center>
        <strong>NEWS & EVENTS</strong>
      </center><center>Annual Day<br><center>
        Alumni Meet<br>
        Exam Time Table<br>Parents-Teacher's Meet</center>
      </center>
      <br></div>
      <div id="footer">This is the content for Layout Div Tag "footer"</div>
    </div>
    </body>
    </html>

  • How Can I Apply Color into my Datagrif

    I Have a Datagrid and the data provider is from database. the
    format is :
    [No] [JobID] [TargetTime]
    How can i apply a color into Datagrid if the TargetTime is
    Overdue, can you help me.

    May I suggest:  Layer - New Adjustment Layer - Black & White, then use the Tint facility.
    Personally, I often find it more handy (and providing more control) to use a Curves adjustment layer above all the others.  Grab the curves of individual color channels and pull them this way and that to alter the color of what's underneath.  It's not hard to keep whites white, blacks black, and give the stuff in between believable coloration.
    -Noel

  • How can i apply maxlength constraint on TextField Through JavaScript ?

    How can i apply maxlength constraint on TextField Through JavaScript ,
    when i am adding the row dynamically & adding the textfield dynamically into it . I can set its attributes like name, size, focus & else, But why its not setting maxlength attribute through javascript ?
    If any body is fammiliar with this problem Please answer the question.

    Hi Ashoka,
    here is the code to get the length of the test field. then you can set your own textfield restriction. I hope this what you are searching. or else you can set the max length of the text field in HTML tag itself it is very easy.
    HTML : <input name="textfield" type="text" maxlength="25">
    JAVASCRIPT:
    <html>
    <head>
    <title>mAX tEXT <title>
    <script>
    function maX()
         var data = document.form1.textfield.value
         len = data.length
         alert("Max Value "+len);
         return true;
    </script>
    </head>
    <body>
    <form name="form1" method="post" action="">
    <input name="textfield" type="text">
    <input type="button" name="but" onClick="return maX()">
    </form>
    </body>
    </html>

Maybe you are looking for

  • Error while updating the Patch

    Hi, I defined import queue to import the patches for SAP_BASIS, but while importing the patches it gives error "Current program has been modified while running", & screen become blank, I try so many times to continue & after that I click from menu er

  • "error code: -3" and "error -2093" during installation

    I just got my fifth generation iPod a few days ago. When I try to install the software from the CD that came in the box, the installation program can never quite finish. It gets through iTunes but then hangs up right as it is about to finish installi

  • Two mac mini and raid 1

    Hi All, Two mac mini with thunderbolt cable connecting, the second mac as external hard drive. Set on the first mac RAID 1 with the second mac... When the first mac fails, the second one can directly be started. Is that even possible? Thank you! mich

  • PCR rules in Schemas

    Any body help me How do we config PCR rules in SCHEMAS.can any body tell me in deep or with Screen shots. Thanks & Regards Srinivas

  • Windows 7 Installation on my Formatted Drive in Lenovo T410

    HI I have a Lenovo T410 laptop, in which I have formatted my hard drive completely including all default drives. Now I have a single partition, when I try to install the windows 7 with the recovery CDs which  I have created when my laptop was working