Create index topics from text tags

The script creates topics and page references from text marked with certain tags. You enter the tags in the script's dialog, including, optionally, tags for subtopic separators and sort-order separators. Choose to replace an existing index or to add new topics and page references to an existing index.

Use

The script shows this dialog:

[image: index from tags]

Enter the start and end tags and the tags used for subtopics and sort order (you must enter tags for subtopics and sort order; if there aren't any subtopics and/or sort orders, just use any tags that aren't meaningful in the index, such as @ and #). For instance, an entry like this:

\index{Mathematicians#B. Russell@Russell, B.}

creates a topic Mathematicians with a subtopic B. Russell. And that subtopic's sort-order field will be set to Russell, B.

Sort orders can be specified for all (sub)topic levels. Schematically as follows:

\index{topic@sort#sub1@sort1#sub2@sort2#sub3@sort3}

which will end up in InDesign's page references options window as follows:

[image: InDesign's page references window]

Hiding/keeping tags

To keep your tags in the document, tick Keep (and hide) tags. The script creates a character style and applies it to the tags so that they become invisible (by setting the type size to 0.1 points and the horizontal scaling to 1%). The tags can be seen in the story editor.


Version history

26 February 2016: The script needed a fix to improve the handling of sort orders.

18 March 2011: Fixed a problem with consecutive index tags.

3 February 2011: Fixed an odd bug that caused page references to be deleted if the tag was followed by certain punctuation marks. The script now also remembers which tags you used the previous time the script was used.

May 2009: First posted.


Useful script? Saved you lots of time?

Consider making a donation. To make a donation, please press the button below. This is Paypal's payment system; you don't need a Paypal account to use it: you can use several types/brands of credit and debit card.

Peter Kahrel's paypal account

Show script (right click, Save Link/Target As to download)

Back to the main page on indexing

Back to the main script page

Installing and running scripts

Editing a script

Questions, comments? Get in touch