Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Here's a common problem when it comes to indexing. You have certain entries that need character-level formatting like italics. Things like book titles, newspapers, magazines, animal and plant species, and so on are all typically italicized. They are in my body text, and I'd like them italicized also in my index entries. For example, I have the title Alice in Wonderland here, and that should be italicized. The problem is, when I include these terms in an InDesign index, the italics gets lost. I can apply paragraph styles to each level of index, but no character-level formatting is retained from the original text.
So do you just have to accept that or manually fix it? Well, sure, you could do either of those things, but there is another option that combines a little bit of old-fashioned text tagging with a little bit of GREP Find/Change to get that character formatting into your index. What I need to do is to go to my Index panel and look at the Alice in Wonderland reference and double-click on the page number. I am going to apply some tags to the topic level. I'll click before it. And you can create any tags that you want.
I am going to use some square braces and just type the letter I inside of them, just to indicate italics. So open and close brace, and inside those I'll type a lowercase i and after the title, I'll type open and close brace and inside those, I'll type a forward slash and an I, just to indicate that it's a closing tag. Now I don't want to sort this reference by these things because right now it will sort by that first brace, and then we'll go into the Symbols section instead of sorting by the A. So I am going to click and drag and select Alice in Wonderland, copy it, and paste it into the Sort By field.
Now I'll click OK and regenerate my index. And here I can see now I have the tagging appearing in my index. Now, of course I don't want this tagging to come out in the final product, but this is going to allow me to do a Find/Change where I find and change anything between these two markers and replace it with italics formatting. So let's do that now. I'll press Command+F or Ctrl+F on the PC to bring up the Find/Change dialog box, and here I have an interesting GREP query.
That's what I am going to use to replace those braces with italics formatting. It looks a little intimidating and obscure at the start, but we'll take it one piece at a time, and you can figure it out. It's made up of three parts that are separated from each other in parentheses. There's one part here, a second part in the middle, and a third part here. So let's take the first part. The first part is just going to find this opening tag. So inside the parentheses I have the special character for the open brace, which is the slash and the brace.
Then I have the I, and then I have another GREP special character for the closing brace, which is the slash and the brace. And all that together is going to find this right here. Now in the middle I have another grouping, and these are the special characters for any character which is the period one or more times. So now I'll find any characters, and that's going to find anything in between my opening and closing tags--in this case, Alice in Wonderland.
The third part of the GREP expression is going to find this closing tag. So the first thing I have here is the special character for the closing brace, so the slash and the brace, and now I have to find this forward slash. This looks really weird, but it's these two slashes together. Then I have the I, which is this, and finally the closing brace. Taken all together, this will find anything inside these tags.
In the Change to field, I just want to find what's in the middle, the second expression. So that's what this $2 is. And I got that from picking in the special characters, Found > Found 2. So find the second thing that you found in this expression, right here in the middle. Then I am going to apply some formatting. I'll click down here to open the Format Settings, and I am applying a character style that I created, IndexItal. That just italicizes the words. So let's run this query and see what we get.
We'll click Change All, OK, and Done. So it found and removed those braces and applied italics to what it found in the middle. Now there's one thing to be aware of: If you generate the Index again, it'll overwrite this text that you performed the Find/Change on. It will find what was in the index markers, including those tags again. But if you save that query, you can run it again very quickly, and that's certainly a small price to pay for a fully formatted index.
It's just something to be aware of. Now that we've seen the ins and outs of native InDesign indexing, we'll take a look next at some third- party indexing alternatives.
Get unlimited access to all courses for just $25/month.Become a member
119 Video lessons · 50032 Viewers
117 Video lessons · 37350 Viewers
113 Video lessons · 81205 Viewers
65 Video lessons · 10658 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
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.
Your file was successfully uploaded.