September 7 2007 • 5:04 PM

Sorting Words and Paragraphs in a Glossary

Tom wrote:

I have been trying to find a way to do an alphabetical sort to produce a glossary of definitions. The project is a manual that has many procedures. We would like to place definitions from all of the procedures and place them in their own section. We have looked for a sorting feature but cannot find one.

While InDesign doesn’t have a sort feature built-in, it does come with a script called SortParagraphs.jsx. In CS2, you have to find this on your install disks or on the Web, but in CS3, it’s installed automatically. When you select some text and run the script, InDesign sorts each paragraph alphabetically.

But I think what you want goes even further than this. It sounds like you want a tool to grab certain words or phrases, then put them in a list alphabetically. My first thought was the Table of Contents feature, but that can only grab whole paragraphs (based on paragraph styles), not words (based on character styles). Then I found the answer: The Index palette.

You can tag words or phrases throughout your document with the Index palette by selecting the word and (when the Index palette is open… choose Window > Type & Tables > Index) and then pressing the New Index Entry button (or pressing Command/Ctrl-U). In the New Page Reference dialog box, choose Suppress Page Range from the Type pop-up menu. That way you’re just capturing the word/phrase and ignoring what page it’s on.

indexbox
indexbox

Later, after tagging all the words you want, press the Generate Index button in the palette and it creates one for you — alphabetized for your pleasure! — and loads it into the Place cursor. Next time you need to update it, just click Generate Index again!

indexbox2
indexbox2

However, once you’ve made your list of terms, you’ll want to add the glossary definitions, right? And that’s where things can get messy. You can simply edit the index you made (it’s just a text story, after all), but if you later generate a new index, it will likely wipe out all your work. (Replacing the old index is an option when generating an index, but it’s easily overlooked.)

So what I would suggest is to duplicate the text frame with the index (or copy and paste the story into a new frame). Your duplicate is not linked to the original index, so it’s not wiped out when you generate a new index. However, your edited glossary is obviously no longer going to stay updated with the rest of the document. So it’s not a perfect solution.

(By the way, CS3 5.0 definitely has some problems with indexing multiple documents in a book. I know that Adobe is aware of the problem and they’re trying to fix it. Perhaps a 5.01 will come soon! I hope so. More on this in a separate post.)

2 Responses discussing this post. Add yours below.

  1. Eli
    September 11th, 2007 • 3:51 pm • Link

    Use the same technique you use for an advertiser index. Put the terms and glossary definitions on a separate, nonprinting layer (as nonprinting objects)

    My problem with this: CS2 doesn’t always get the alphabetical order right. The proper placement of one entry seems to depend on the presence or absence of nearby entries. I haven’t been able to figure out the pattern.

  2. Jocatlo
    January 4th, 2008 • 9:47 pm • Link

    Just wanted to say thanks for the tip - you saved me alot of time!

Subscribe to the Discussion

Get the ongoing discussion surrounding "Sorting Words and Paragraphs in a Glossary" delivered to you. Click here to subscribe via RSS.

Leave a Reply

You can use limited HTML tags, such as <em></em> for emphasis/italics and <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .

InDesignSecrets reserves the right to edit and/or remove posts and comments.