Index Fixes: No Styling in Topic Names
Topic names cannot natively be styled in the Index panel. However, a simple solution is to add text tags such as <i>. . .</i> and use two GREP queries in the generated index to apply character styles and remove the tags, or set up a GREP style in the topic paragraph styles to hide those tags and apply some styling.
If the style code is at the start of the topic name you should set the sort order to the topic name without the codes to ensure that the topic is sorted correctly.
In this example, text tags for italic are added to a topic name, and because the opening tag is at the start of the name we set the topic’s sort order as well:

You then use two GREP queries to apply a character style that applies italic and to remove the text tags:
Apply a character style
Find what: <i>.+?</i>
Change to: $0
Change Format: The Italic character style
Remove the text tags
Find what: </?\l>
Change to: <Leave empty>
Find and Change Format: <Leave empty>
Alternatively, you can use two GREP styles to achieve the same appearance. First, create a character style that hides the text that it is applied to: point size 0.1, 1% horizontal scale, paper colour. Call the style e.g. Hide. Then add the following two GREP styles to the paragraph styles used for the index entries:
Apply Style: Italic
To Text: <i>.+?</i>
Apply Style: Hide
To Text: </?\l>
GREP styles are convenient, but you can’t use ‘hiding styles’ in Epubs, and they won’t do much good for accessibility.
Return to Index Fixes page.
Peter Kahrel Script Repository
Hosted as a community service, and with deep appreciation, by CreativePro.com
Scripts by Topic | Script Index
Basic Script Installation and Use
How to Modify or Configure These Scripts
Resources for Scripting and Publishing Automation
About This Repository
Contact Peter Kahrel
Note to users: You run scripts at your own risk: CreativePro and the author accept no liability for anything that may be caused by any of these scripts. Always take the necessary precautions. We encourage you to save backups and test scripts on copies of your documents.
This article was last modified on September 5, 2026
This article was first published on September 5, 2026
Commenting is easier and faster when you're logged in!
Recommended for you
InDesign Eye Candy, part 1: In Gravity’s Shadow
Why should all the Photoshop and Illustrator kids have all the fun, when you can...
Before&After Design Tip: Two Ways to Typeset a List
Design a list that bestows visible stature to the names on it
Menu Actions
The script displays a list of menu actions, which can be filtered and sorted for...
