Join David Blatner for an in-depth discussion in this video 322 Change character style for text inside parentheses, part of InDesign Secrets.
- [Instructor] I'd like to change the styling for all the text that is inside parentheses or brackets inside these paragraphs, like this figure reference here and this one down here. Now of course I could just select the text and change the formatting, but I'd like something a little bit more automated. So I'm going to use GREP styles. It sounds scary, but it's really easy if you just follow along. Now before I make the GREP style, I need to have a character style that applies all the formatting I want.
And you can see that I've saved one here inside my character styles panel. It's called figure reference. This character style changes the font and the color of the text. Okay, so now I'm going to edit my paragraph style to apply that character style to just the text inside the brackets. I'll open my paragraph styles panel, and then I'm going to edit my body paragraph style. I'll do that by right-clicking with my mouse, right-click on body, and then choose edit body. Here inside my paragraph style options dialog box, I'm going to choose GREP style.
And you can see that currently I don't have any GREP styles listed. So I'll come down here and click new GREP style. That adds my first one. So I'm going to make this rule, this GREP style apply the character style that I made. So I'll choose that up here by clicking on apply style and then choosing the character style that I already made. Now I need to write a little bit of GREP code. And I admit the codes are a little bit weird, but it's nothing that you can't do. Just follow along. Okay, the main question you need to ask right now is when you're applying the style, do you want to also include the parentheses? If you do, then it's a pretty easy code.
You simply come in here, click on this code here. I'll delete that 'cause I want to replace it, and then I'll type backslash, open parentheses, and then a dot or period plus question mark. Finally, backslash close parentheses. The backslashes mean look for a real open and closed parenthesis character. The dot plus question mark means basically find everything, all the text in between those parentheses. Now to finish, I'll simply click in this blank area out here.
That applies the GREP style. Now because the preview checkbox is turned on, you'll see that it worked. All the text inside the parentheses and the parentheses themselves have been styled with my character style. So okay, what if I now decide I want to format the text but not the parentheses? I can do that. The code just gets a tiny bit more complicated, but it's not too bad. First I'm going to come up here and delete the code that I had typed. Now I need to add some codes that I honestly can never remember.
So I'm going to ask InDesign to type them for me. To do that, I'll click on this little at symbol, and I'll scroll down and choose from the match sub-menu. Here I'm going to choose positive look behind. Did you see that? InDesign typed those codes for me. Now I need to place my cursor in between the equal symbol and that closed parentheses. And I'm going to type backslash open parenthesis just like I did earlier. That means look for an open parenthesis but don't format it. Now I'm going to place my cursor to the right outside that code, and I'm going to type the dot plus question mark just like I did before.
That finds all the text, right? And now to finish I'm going to go back to that match sub-menu, but this time I'm going to choose a positive look ahead. Then right after that equal symbol, I'm going to type backslash, close parentheses. So that's it. That crazy-looking code looks for all the text inside parentheses but not including the parentheses. So when I click out here, you can see that it worked. The preview checkbox is turned on so I see that all the text inside the parentheses has been formatted but not the parentheses themselves.
Looks good, so I'll come over here and click okay. GREP styles are incredibly powerful for automating your text styles. You can do it. You just need to take these codes one step at a time.
Updated
12/23/2020Released
8/25/2011New techniques will be added to the collection every other week, so check back early and often. Find more tips and tricks at indesignsecrets.com.Note: Because this is an ongoing series, viewers will not receive a certificate of completion.
Skill Level Intermediate
Duration
Views
Q: Why can't I earn a Certificate of Completion for this course?
A: We publish a new tutorial or tutorials for this course on a regular basis. We are unable to offer a Certificate of Completion because it is an ever-evolving course that is not designed to be completed. Check back often for new movies.
Related Courses
-
InDesign CC 2018 Essential Training
with David Blatner6h 30m Beginner -
InDesign: Interactive PDFs
with David Blatner2h 27m Intermediate -
InDesign CC 2018: EPUB
with Anne-Marie Concepción4h 35m Intermediate -
InDesign CC 2019 Essential Training
with David Blatner5h 23m Beginner -
InDesign Quick Start
with David Blatner22m Beginner
-
This Week's Secret
-
Introduction
-
Welcome to InDesign Secrets1m 10s
-
-
December 2020
-
November 2020
-
October 2020
-
September 2020
-
Use one frame, not many4m 37s
-
August 2020
-
July 2020
-
June 2020
-
May 2020
-
Threading filled frames3m 14s
-
Custom page numbering tricks5m 13s
-
November 2012
-
October 2012
-
061 Embedding images7m 44s
-
-
September 2012
-
057 Text wrapping6m 54s
-
-
August 2012
-
July 2012
-
June 2012
-
May 2012
-
April 2012
-
March 2012
-
January 2012
-
April 2020
-
Making speech bubbles3m 32s
-
Working with ligatures5m 9s
-
February 2012
-
December 2011
-
016 Running a script9m 33s
-
November 2011
-
October 2011
-
August 2011
-
September 2011
-
March 2020
-
February 2020
-
Auto-expand acronyms4m 39s
-
-
January 2020
-
December 2019
-
November 2019
-
October 2019
-
409 Copy and paste effects4m 39s
-
-
September 2019
-
408 The master page trick1m 46s
-
August 2019
-
July 2019
-
June 2019
-
May 2019
-
April 2019
-
March 2019
-
February 2019
-
376 Make cast shadows3m 35s
-
-
January 2019
-
November 2018
-
December 2018
-
369 Shared CC Libraries tips5m 15s
-
October 2018
-
360 Find spacing problems4m 50s
-
363 Export all text8m 16s
-
-
August 2018
-
351 Change default fonts5m 51s
-
352 Best default RGB4m 45s
-
-
September 2018
-
July 2018
-
May 2018
-
343 Border spacing fix4m 59s
-
June 2018
-
346 Export to HTML55m 38s
-
April 2018
-
February 2018
-
March 2018
-
January 2018
-
325 Link text frames6m 10s
-
December 2017
-
November 2017
-
September 2017
-
October 2017
-
313 Quick Apply preferences6m 35s
-
August 2017
-
July 2017
-
May 2017
-
290 Work with scripts3m 35s
-
June 2017
-
April 2017
-
286 How to format ellipses5m 39s
-
March 2017
-
281 Share a CC library7m 10s
-
January 2017
-
February 2017
-
December 2016
-
271 Add images to an index4m 39s
-
November 2016
-
September 2016
-
October 2016
-
260 Batch process images7m 33s
-
263 Sync master pages5m 51s
-
-
August 2016
-
July 2016
-
June 2016
-
April 2016
-
May 2016
-
240 Side-by-side tables5m 35s
-
March 2016
-
February 2016
-
228 Setting text at an angle6m 24s
-
December 2015
-
January 2016
-
222 Adding paragraph shading1m 50s
-
October 2015
-
November 2015
-
September 2015
-
July 2015
-
August 2015
-
204 Creating a8m 14s
-
205 Managing scripts5m 38s
-
May 2015
-
189 Placing InDesign files5m 14s
-
-
June 2015
-
193 Printing tracked changes5m 41s
-
-
April 2015
-
186 Making long shadows5m 41s
-
February 2015
-
March 2015
-
January 2015
-
December 2014
-
November 2014
-
October 2014
-
September 2014
-
August 2014
-
July 2014
-
148 Cropping with paste into5m 18s
-
-
June 2014
-
May 2014
-
141 Inserting glyphs6m 42s
-
April 2014
-
March 2014
-
February 2014
-
January 2014
-
December 2013
-
November 2013
-
October 2013
-
September 2013
-
August 2013
-
105 Working with MiniBridge5m 45s
-
106 Customize your QR codes6m 17s
-
July 2013
-
June 2013
-
May 2013
-
April 2013
-
March 2013
-
February 2013
-
December 2012
-
069 Ten uses of the Story Editor11m 39s
-
-
January 2013
- Mark as unwatched
- Mark all as unwatched
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.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: 322 Change character style for text inside parentheses