Start learning with our library of video tutorials taught by experts. Get started

InDesign CS4 Beyond the Basics

Understanding GREP styles


From:

InDesign CS4 Beyond the Basics

with David Blatner

Video: Understanding GREP styles

In the last chapter, we looked at how to find text patterns using GREP in the Find/Change dialog box. You can even use Find/Change to apply a character style to whatever text you find, but that has a drawback. You have to manually run the Find/Change each time the text gets edited. InDesign CS4 has a solution, GREP styles. GREP styles let you apply a character styles to any text pattern and you can even do it as a part of a paragraph style. Let me show you how. I am going to place my cursor in this paragraph and zoom into 200% by pressing Command+2 on Mac, or Ctrl+2 on Windows and I can see that I have several numbers throughout this paragraph. I would like to apply the OpenType old style formatting just to those numbers, but I don't what to do it by hand. That would take forever. So instead I am going to use GREP styles. Up in the Control panel flyout menu, I will choose GREP styles. Once the GREP style dialog box is open, I will click the New GREP styles button to add my first style.
Expand all | Collapse all
  1. 2m 11s
    1. Welcome
      1m 3s
    2. Using the exercise files
      1m 8s
  2. 25m 16s
    1. Reviewing Control panel shortcuts
      8m 34s
    2. Managing panels
      6m 14s
    3. Letting InDesign do the math
      2m 52s
    4. Using Selection tool clicks
      1m 39s
    5. Using Quick Apply shortcuts
      3m 2s
    6. Setting up context shortcuts
      2m 55s
  3. 23m 51s
    1. Using column guides
      3m 42s
    2. Formatting and positioning guides
      5m 15s
    3. Setting first baseline options
      5m 30s
    4. Using the Document grid
      3m 13s
    5. Setting bleeds
      3m 3s
    6. Using slugs
      3m 8s
  4. 48m 2s
    1. Shuffling pages (or not)
      2m 47s
    2. Scaling objects to a specific size
      2m 32s
    3. Aligning objects to a page
      4m 41s
    4. Using advanced libraries
      4m 5s
    5. Using advanced anchored objects
      11m 21s
    6. Setting non-printing objects
      3m 10s
    7. Creating notes
      5m 23s
    8. Using Data Merge
      10m 41s
    9. Creating templates
      3m 22s
  5. 39m 32s
    1. Creating polygons and starbursts
      2m 35s
    2. Setting custom stroke styles
      5m 15s
    3. Using advanced effects
      8m 46s
    4. Making masks in InDesign
      4m 10s
    5. Integrating InDesign and Illustrator
      4m 59s
    6. Setting compound paths
      5m 4s
    7. Using advanced clipping paths
      6m 6s
    8. Using advanced image transparency
      2m 37s
  6. 55m 26s
    1. Using advanced text formatting
      5m 37s
    2. Using other languages
      4m 22s
    3. Setting advanced paragraph numbering
      3m 12s
    4. Using GREP to find/change
      6m 54s
    5. Managing glyphs
      5m 6s
    6. Finding and changing glyphs
      2m 39s
    7. Adding footnotes
      7m 57s
    8. Creating outlines
      3m 39s
    9. Setting conditional text
      9m 16s
    10. Creating cross-references
      6m 44s
  7. 33m 3s
    1. Advanced text importing
      7m 49s
    2. Using Apply Next Style
      5m 4s
    3. Advanced text styling
      6m 9s
    4. Setting load styles
      2m 58s
    5. Linking to text files on disk
      4m 1s
    6. Understanding GREP styles
      7m 2s
  8. 1h 4m
    1. Building a multi-document book
      4m 42s
    2. Setting page numbering across books
      7m 53s
    3. Setting chapter numbering
      6m 7s
    4. Using the Section Marker feature
      6m 53s
    5. Creating "Continued On..." numbers
      4m 44s
    6. Synchronizing documents in a book
      5m 41s
    7. Creating a table of contents
      11m 24s
    8. Indexing documents
      7m 24s
    9. Generating an index
      6m 47s
    10. Printing or exporting a book
      3m 10s
  9. 46m 4s
    1. Creating hyperlinks
      12m 53s
    2. Setting bookmarks
      6m 7s
    3. Creating buttons
      11m 16s
    4. Making movies
      8m 24s
    5. Creating sounds
      4m 51s
    6. Setting page transitions
      2m 33s
  10. 25m 59s
    1. Setting up swatch and style defaults
      3m 24s
    2. Using mixed ink colors
      6m 16s
    3. Working with duotones
      4m 23s
    4. Overprinting
      2m 10s
    5. Ink aliasing
      4m 50s
    6. Using the Kuler panel
      4m 56s
  11. 50m 27s
    1. Creating the transparency blend space
      4m 6s
    2. Understanding InDesign color settings
      9m 8s
    3. Assign Profile and Convert to Profile
      3m 26s
    4. Working with RGB images
      7m 54s
    5. Working with CMYK images
      6m 28s
    6. Soft-proofing
      5m 18s
    7. Managing color at print time
      7m 25s
    8. Managing color in a PDF export
      6m 42s
  12. 42m 1s
    1. Embedding preflight profiles
      5m 1s
    2. Using the Transparency Flattener preview
      3m 23s
    3. Reviewing Transparency Flattener settings
      6m 30s
    4. Setting print presets
      3m 35s
    5. Setting PDF presets
      3m 21s
    6. Exporting to XHTML
      7m 42s
    7. Exporting to SWF
      6m 45s
    8. Exporting to XFL
      5m 44s
  13. 25m 58s
    1. Understanding XML and InDesign
      6m 51s
    2. Structuring InDesign content
      4m 17s
    3. Importing XML
      6m 57s
    4. Exporting to XML
      7m 53s
  14. 34s
    1. Goodbye
      34s

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
Please wait...
InDesign CS4 Beyond the Basics
8h 3m Intermediate Dec 05, 2008

Viewers: in countries Watching now:

David Blatner brings his knowledge of and passion for InDesign to the latest release of this state-of-the-art publishing program, showing how to harness its power and functionality. InDesign CS4 Beyond the Basics covers the process of publishing with an eye on the program's latest nuances: optimizing page layouts, automating InDesign with Data Merge and XML, exploring interactive documents (including making movies), and exporting publications to a variety of formats. Exercise files accompany the course.

Topics include:
  • Automating with Data Merge and XML
  • Optimizing page layouts
  • Using advanced effects
  • Creating interactive documents
  • Integrating with Illustrator
Subject:
Design
Software:
InDesign
Author:
David Blatner

Understanding GREP styles

In the last chapter, we looked at how to find text patterns using GREP in the Find/Change dialog box. You can even use Find/Change to apply a character style to whatever text you find, but that has a drawback. You have to manually run the Find/Change each time the text gets edited. InDesign CS4 has a solution, GREP styles. GREP styles let you apply a character styles to any text pattern and you can even do it as a part of a paragraph style. Let me show you how. I am going to place my cursor in this paragraph and zoom into 200% by pressing Command+2 on Mac, or Ctrl+2 on Windows and I can see that I have several numbers throughout this paragraph. I would like to apply the OpenType old style formatting just to those numbers, but I don't what to do it by hand. That would take forever. So instead I am going to use GREP styles. Up in the Control panel flyout menu, I will choose GREP styles. Once the GREP style dialog box is open, I will click the New GREP styles button to add my first style.

Now I can choose a character style from this pop up menu. I know it doesn't look like a pop up menu, but if I click on that word None, it turns into a pop up menu and now I can choose my character style. If you don't have one already created, you can go ahead and create New Character Style at the bottom. In this case, I am going to create one called old style numerals and the only thing it's going to do is apply the old style numeral formatting. So I will choose that from the Figure Style pop up menu here. So now my GREP styles is going to apply the old style numeral character style that I just created to some GREP formatting and in this case I happen to know that code /d+ as a default GREP code that appears whenever you make a GREP styles. That codes means all the digits, one or more digits in a row and in fact if we look at the text below the dialog box here in the background, we can see that those numbers changed to old style. That's because the Preview check box is turned on.

Let's see a before and after. I will turn Preview off, knows they are regular numbers, Preview on that's the old style numbers, so we can see that our GREP style is working. Let's click OK and I want to show you another little bit more complex GREP style. I want to scroll over here and I can see that I have text throughout my documents that inside brackets. I don't really want it to be inside brackets. What I really want is for that text to be in italics, but when I imported it, that's what the editor wrote. They typed in those brackets. Now I would like to get rid of those brackets and make that stuff Italic. Can I do that, sure, I can do it with GREP styles, but in this case I am not going to do it just to this one paragraph, I am going to change the paragraph style itself. So I will open up the Paragraph Style panel and I am going to edit the style, not of the numbering list but of Body, only because numbering list is actually based on body and I want this to apply to all the paragraph in my documents with Body, Paragraphs and numbering list. So I will edit Body by right clicking on it or Ctrl clicking with one button mouse, and I will click Edit "Body." Just move it over little bit so we can see what we are doing and then I am going to go right to the GREP style pane.

First thing I am going to do here is actually just recreate what I have done. I am going to apply the old style numerals character style to all numerals, one or more numbers in all my paragraphs that are assigned to body or anything based on body. The next thing I am going to do is create a new GREP style, which is going to apply Italic to that text inside the brackets. In this case, I will apply Italic Body Text, to text not to the digits so I will delete that, I just click on that code and that made it active, so I can delete it and I am going to apply to anything inside brackets.

Now I can't just type brackets, I happen to know. I have to type some special code to get those brackets. So this is what I am going to do. I will go to the little menu off on this side here, the one that has the @ sign in it and I will click on that and I will choose from the Symbols pop out menu, the Open Bracket Character. That shows me the code for a bracket is Slash+Bracket. Now I want any character, in other words, anything inside brackets, so I will go to the Wildcards and say give me Any Character at all and let's go ahead and Repeat that one or more times, shortest match and then a Closed Bracket again from the Symbol pop up menu. So this is going to apply the Italic Body Text character style to anything that looks like a bracket and then some text and then a closed bracket. I will click on this blank area in the bottom to make it apply and I will move the dialog box out of the way and we'll see if it worked.

Yup, there we go. My numbers got changed to old style and all of this text got changed to Italic. Now, for the last step. I want to get rid of those brackets. I could use a Find/Change to do search for a bracket and delete it, but again if I later had to edit the text and more brackets got in there, well, I would have to do the Find/Change over again. So let's use GREP styles. I am going to make a New GREP styles and in this case I am going to look for anything that's a bracket, either a closed bracket or an open bracket. You can do that by GREP by using this code. Bracket, I know this is going to be weird, but I want to type to the regular bracket symbol and then the code for looking for a bracket which is Slash+Bracket, and then the code for looking for the closed bracket, which is Slash+Closed Bracket, and then we want to type the Bracket again.

It's a very strange code. When you are working with GREP you get all kinds of weird combinations. So it's Bracket+Slash+ Open Bracket+Slash+Closed Bracket+Closed Bracket. That's the code we are looking for because that means search for either an Open or a Closed Bracket. And now what do I want to do when I find one of those two characters? I want it to go away. Now the GREP styles feature cannot change your text at all. It can only apply character styles, but here is a secret way to make text go away, or at least mostly they go away. You will see what I mean in a minute. I am going to create a new character style, so I will click on that little what they said None there and I am going to scroll down to New Character Style and I am going to make my new character style called hidden, you can call it anything you want really, but I am going to mine hidden and the style for this is going to be, the Horizontal Scale is going to be 1%, just 1%.

In other words, make it as thin as it can possibly be. It's almost zero. It takes the character and pushes it down to 1%. Then I am going to go to the Character Color and change its fill color to None. A character which has a horizontal width of 1% takes up almost no room on the page and if it's filled with none, you can't it at all. So it is in fact hidden. I will click OK, I will click off here and we can see if I move this out of the way that my brackets have disappeared. Everything that was inside a bracket is Italic and the brackets are now hidden.

Personally I think GREP styles is the coolest new feature in InDesign CS4. I am sure it's geeky, but wow, it's mighty powerful for formatting a document quickly.

There are currently no FAQs about InDesign CS4 Beyond the Basics.

Share a link to this course
Please wait... Please wait...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed InDesign CS4 Beyond the Basics.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Welcome to the redesigned course page.

We’ve moved some things around, and now you can



Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked