Indexes and concordances

The terms 'concordance' and 'index' are not used in the same way by everybody. For the purposes of this web page, I use concordance for a list of occurrences of one word in its context and index for a list of several words, each word accompanied by one or more page references. There are several types of index (word index [index verborum], language index, subject index, author index, etc.), but there's just one type of concordance.

In InDesign you can create indexes, not concordances, though concordances can be scripted (see the concordance script, below). Indexes should be done manually by adding topics and page references using the Index panel. InDesign's indexing is limited in that you can create just one index in a document, though with some trickery (to be outlined below) you can create, say, author, language, and subject indexes in one document.

Another approach to indexing in InDesign is to ignore its index feature entirely, using one or more scripts to find words from a word list and find all page references for each word. The first script listed here, under "Independent index from word list", is an example.

Independent index from word list

The script creates an index from a word list, sidelining InDesign's index altogether. It can be used for author, language, and citation indexes and similar indexes. For subject indexes it's not particularly good, but it can be used to get a start. The script runs on all opened documents. It's comparable in some ways to Marc Autret's (more elaborate) index brutal.

(20 September 2009: Marc Autret has another, very versatile, script which I discovered only today, see the discussion at IndesignSecrets. The script, indexmatic.js, can be downloaded here.)

Creating topics and page references

The scripts in this section create topics in a document from a variety of sources: an external word list, text fromatted with any character styles, text formatted with certain text tags, or topics imported from another document.

Topics and page references from a word list

On the basis of a word list, the script adds topics and page references to InDesign documents.

Topics and page references from character styles

This script creates topics and page references in InDesign documents using InDesign's index feature. It looks for the character styles you pick in the dialog and creates topics from and page references to whatever those character styles are applied to. Choose to replace an existing index or to add to it. Optionally prefix topics with the character style's name (handy for creating multiple indexes).

Topics and page references from text tags

The script looks for index text tags such as \index{collie} or {ix}collie{#ix}. Any format is possible as you specify the tags in a dialog. From these strings a topic collie is created, a page reference is added to the page on which the text string occurs, and the whole string is deleted. Subtopics are handled as well.

Page references from imported topics

When you import topics from another document, any page references aren't imported, naturally. The script adds these.

Editing topics

It's not so easy to edit topics in an InDesign document. Adding and removing subtopics, for instance, is very labour-intensive when the topic has page references associated with it. The method described here makes life a little easier.

Editing indexes

Most indexes need some editing after they've been created. Here are some scripts I use to make some of that work a bit easier.

Update index

When you edit an index, for example to combine entries, you can end up with unwellformed page ranges such as 2, 16-34, 4-8, 5-10, x, 12-18, ii-iv. The update script fixes this, either the whole index or just the selected entry.

Sectioning an index

Apply a paragraph style to entries that start a new letter. Optionally insert section headings.

Fix index problems: convert page references to text tags

Problems with indexes can be solved by converting all page references to text.

Build index from textual markers

The script that converts an index to text places text tags in a document such as <ix>cat</ix>. This script (re)builds an InDesign index from such tags. (The script is a simple version of the one listed above, "Topics and page references from text tags" in that it is fixed to the tags produced by the script that converts references to tags.)

Concordance

The concordancer takes one word and creates a list of sentence fragments that show the concordanced word in its context. In the interface you specify which word should be concordanced and how big the context should be (number of words before and after. The list includes the page numbers of the found items.


Back to script index

Questions, comments? Get in touch