Indexing Case Sensitive Words
Indexing is a painful word, close to root canal in my opinion. I have been lucky enough in my life to never have had to personally create an entire index. While I have worked on long publications, someone else did the dirty work and supplied the index for me. Despite my hesitations with indexing, it is still an important part of InDesign. Earlier this week a client (who is a technical writer) was upgrading to CS4 presented an interesting problem.
She wanted to know if InDesign was able to index references automatically regardless of case. This was a problem for her because when she would create a reference for a word (“humans” for example) and click “add all” it would only add the case specific version of the word . If her word was at the beginning of a sentence (“Humans are great”), the index marker would not be inserted. If you select the word that is capitalized and add it to the index, it will create another entry that is capitalized. Now you have duplicate words in your index (humans & Humans).
Looking for an answer I searched the help system, opened up my trusty copy of Real Work InDesign CS3 (maybe someday the CS4 version will come out:), but I couldn’t find any help. That is when the sky opened up and the celestial choirs began to sing “GREP, GREP, GREP!”. When you create an index, the index markers are individual zero width characters placed in front of your word. Since these are selectable, you can perform a find/change operation to put them in front of capitalized versions of your word.
1. Create the reference for word as you want it to appear in your index.
2. Select the index marker and copy it to the clipboard. This can difficult if you try to freehand select the marker. To select the marker, either use the story editor (cmd/ctrl+Y) or put your cursor at the beginning of the word and hold shift and press the left arrow to select it.
3. Open Find/Change and choose the GREP tab.
In the “Find what” field, type the capitalized version of your word.
In the “Change to” field, go to the menu and choose other > contents of clipboard, formatted (unformatted works too) and then type in the capitalized word.
4. Make sure you are searching the entire document and click change all.
Now your index marker has been inserted in front of your specific capitalized words in your document. After you preform your search, your index panel will not be listing the page numbers for the entires used in the find/change operation.
After you generate the index, the page numbers will appear on the page and in the index panel. It is probably a refresh bug.
If your word is input multiple ways, HUMANS, humans, Humans, HUMANs, etc. you would need to preform the operation manually for each instance. I image that there is a way to consolidate all of these into one GREP expression, and I welcome suggestions in the comments to improve the search.
![]() |
I ran into this issue with an index I created a couple of weeks ago. Although Find/Change will find all instances, only the case-sensitive version would be added.
My workaround was to use a case sensitive find change and then add all instances under the same index topic. For example, both “humans” and “Humans” would be added to the topic “humans.” It worked as well.
However, this needs to be fixed or have a selectable option to add either or both. It’s definitely a weak area.
Very sweet tip, Fritz.
As for Real World InDesign CS4… we shipped it to the printer last week. Should be done, um, any minute now! ;)
That’s great, I can’t wait to get it. Although, what is with the cover? Are there crazy robot flaming eyeball rabbits where you live?
I just pre-ordered a copy of Real World InDesign CS4. Can’t wait!
I’ve built many complex indexes using this method since CS3 emerged.
Here are few issues I’d like to add:
(1) If I’m not mistaken, the page reference index marker can also be added using ‘Clipboard Content’ from the Text search method (^c instead of ~c).
(2) What the GREP method allows us is much more flexibility with the search of the indexed term as singular or plural, different declensions, or when accompanied by leading characters (as we have in Hebrew and probably some other languages).
(3) if you GREP search for Humans, you will also catch Humansoids, Humansaurs, ProHumans, and so…
To avoid that, your GREP expression should be \bHumans\b or \<Humans\>, while the Text method allows us to specify a Whole Word rule to the search.
@Adi – I didn’t realize you could use clipboard content in the regular search field (Adobe should list that in the @ menu).
Also, thanks for the grep expression for limiting to whole words.
@Fritz – Well, it’s there, under @ (Change to menu) > Other > Clipboard Contents (or is it only in my copy?)
Wow, I am blind today.
Thanks!
I was recently working on a technical manual with instances of words such as Phosphorus which needed to be indexed as both “Phosphorus” and “phosphorus”. It was quite annoying to find that InDesign wouldn’t let me do this in one operation, under one topic.
Fortunately I came across this thread after much searching, which gave me the idea for the following:
Find What:
(?i)Phosphorus
Change to:
~c$0
Where (?i) indicates that the seach is case insensitive. This would pick up the word phosphorus whether it had a capital P or not (although I didn’t test it on all caps), and then add the index marker (that was in the clipboard) in before the text that the find string had selected. It seemed to work for me ok. Hope this helps.
I am hoping that you can help me with an InDesign question. I am creating a book (.indb) and I am in the process of doing the index. It is working pretty well except for 3 small areas. I have searched the internet high and low and can’t find solutions.
Case sensitive.
I have the word – beta blockers and Beta blockers both in the book. I only want one reference listed in the index but of course, the search to reference words in the index is case sensitive. I am sure there is a solution using GREP but I haven’t be able to figure it out. Could you help? I am using CS3.
singular and plural
kinda the same issue – beta blockers vs beta blocker – how do I do the search for the index?
One more small issue
when I reference an individual, the first reference I use their whole name i.e. Jacque Smith. Afterward I use the first name Jacque, but I want every mention of Jacque to be in the index.
I tried this link but it didn’t work for me. Am I doing something wrong?
I
@Jacque
I would recommend that you post this question in the InDesign Secrets Forums. That area will be read by more people who maybe able to write a GREP expression that could work for you.
Good luck!