From the course: InDesign Secrets
322 Change character style for text inside parentheses - InDesign Tutorial
From the course: InDesign Secrets
322 Change character style for text inside parentheses
- [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.
Download courses and learn on the go
Watch courses on your mobile device without an internet connection. Download courses using your iOS or Android LinkedIn Learning app.
Contents
-
-
229 Batch converting ID files to current version with the Book panel6m 9s
-
230 Getting around InDesign limitations6m 46s
-
(Locked)
231 Creating better callout lines with effects and object styles5m 47s
-
232 Swapping column and row information in tables6m 9s
-
(Locked)
233 Making bigger text link targets4m 52s
-
-
-
161 Keeping page numbers on top of master items3m 55s
-
162 Adding automatic currency symbols in a table cell or before text3m 50s
-
(Locked)
163 Make a pop-up footnote for your ebook3m 48s
-
(Locked)
164 Deleting tabs at the beginning of paragraphs and applying a paragraph style3m 10s
-
(Locked)
165 Five InDesign Presentation tips6m 28s
-
-
-
(Locked)
111 Packaging images on the pasteboard3m 32s
-
(Locked)
112 Automatically updating figure references for books6m 9s
-
(Locked)
113 Adding Tool Tips to your form fields in InDesign3m 21s
-
(Locked)
114 Setting poetry, flush left, center on longest line3m 54s
-
(Locked)
115 Use bookmarks to navigate long documents in production4m 57s
-
(Locked)
-
-
(Locked)
107 Using the same keyboard shortcut for two different commands with the Context feature5m 22s
-
(Locked)
108 Making a text highlighter3m 33s
-
(Locked)
109 Updating an interactive PDF without losing work done in Acrobat5m 30s
-
(Locked)
110 Adding custom text at the beginning of each line automatically4m
-
(Locked)
-
-
(Locked)
089 Three great Object Styles for any designer8m 1s
-
(Locked)
090 Choosing alpha channel image transparency2m 25s
-
(Locked)
091 Adding and reading metadata for InDesign files3m 25s
-
(Locked)
092 Adding ALT tags to your images6m 59s
-
(Locked)
093 How to Place & Link a text frame's text but not its formatting7m 4s
-
(Locked)
094 Setting the baseline position of a caption2m 39s
-
(Locked)
-
-
(Locked)
051 Five things that should be in every new file5m 19s
-
(Locked)
052 Forcing EPUB page breaks with invisible objects6m 21s
-
(Locked)
053 Understanding component information6m 39s
-
(Locked)
054 Creating running heads using section markers4m 16s
-
(Locked)
055 Making a font with InDesign using the IndyFont script5m 20s
-
(Locked)
056 Finding where that color is used7m 17s
-
(Locked)
-
-
(Locked)
047 Specifying an exact amount of space between objects5m 17s
-
(Locked)
048 Fixing last lines that are too short8m 16s
-
(Locked)
049 Creating web graphics from your InDesign artwork7m 20s
-
(Locked)
050 Using “No Language” to suppress unwanted hyphenation, spell-checking, and smart quotes2m 48s
-
(Locked)
-
-
(Locked)
037 Updating a linked table without losing formatting5m 18s
-
(Locked)
038 Creating electronic sticky notes4m 49s
-
(Locked)
039 Moving master page items to the top layer for visibility2m 48s
-
(Locked)
040 Five guide tricks that will impress your coworkers6m 18s
-
(Locked)
041 Letting InDesign add the diacritics4m 21s
-
(Locked)
042 Using single-cell table cells for custom paragraph formatting6m 2s
-
(Locked)
-
-
(Locked)
027 Creating running heads using variables5m 1s
-
(Locked)
028 Live Caption tips and tricks8m 3s
-
(Locked)
029 Making professional drop caps10m 37s
-
(Locked)
030 Making two-state buttons in interactive documents5m 5s
-
(Locked)
031 Moving pages from one document to another3m 15s
-
(Locked)
032 Wrapping bulleted text around a curve5m 58s
-
(Locked)
-
-
(Locked)
007 Selecting through and into objects using cmd-click and Select Above/Below5m 46s
-
(Locked)
008 Some great tips and tricks for the Swatches panel9m 40s
-
(Locked)
009 Saving down for backward compatibility with INX and IDML5m 54s
-
(Locked)
010 Using the INX and IDML formats to fix problems4m 46s
-
(Locked)