The script converts all page references in a document to text tags of the form <ix>dog</ix> and inserts these where the page reference occurs in the text. This is usually right before the first character of the indexed word, so that you end up with e.g.
<ix>dog</ix>dog
where the tag shown in red is inserted before the text occurrence dog, shown in black.
Any subtopics are separated from the main topic and other subtopics by #. Example: all page references to the topic dog with subtopic collie which itself has a subtopic border collie are replaced with the text string <ix>dog#collie#border collie</ix>. If a page reference to this topic chain occurred at the phrase border collie in the text, you would see this:
<ix>dog#collie#border collie</ix>border collie
After converting all page references, all topics are deleted and the index is cleared.
If a topic has a sort order defined, the sort order is suffixed to the topic's name separated by @. For example, the topic \target with sort order target is inserted as follows:
<ix>\target@target</ix>\target
The remaining properties (page-reference type, style override, and limit) are added to the string, separated by %%. Example:
dog%%FOR_NEXT_N_PAGES~~Principal~~4%%
where FOR_NEXT_N_PAGES is the page-reference type, Principal is the name of the number style override, and 4 is the page count.
The script has no interface; just run it. You could change the codes that the script expects with other codes. The index can be rebuilt later using this script.
Problem entries are skipped so that their markers stay in the text. After running the script, if there were any errors an alert is shown. Check the index panel and try to fix the problematic entries.
10 Aug. 2023: Added support for page reference type, style override, and limit.
11 July 2018: Improved error handling.
26 February 2016: Sort orders are now added to the text tag.
May 2009: First posted.
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.
Show script (right-click, Save Target/Link As to download)
Back to the main page on indexing
Installing and running scripts
Questions, comments? Get in touch